From aa9d181fc23367a0f1a54a87e06e7af011f28d0c Mon Sep 17 00:00:00 2001
From: Aurore Guillevic <aurore.guillevic@inria.fr>
Date: Thu, 13 Jul 2023 23:17:14 +0200
Subject: [PATCH] FST 6.7 k=12 D=2 rho=1.75, Fotiadis Martindale ePrint
 2018/969, for Jolijn Cottaar

---
 sage/test_curves.sage                          |  2 ++
 sage/tnfs/param/testvector_other_sparseseed.py | 16 ++++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/sage/test_curves.sage b/sage/test_curves.sage
index c83ce2b..837c1d9 100644
--- a/sage/test_curves.sage
+++ b/sage/test_curves.sage
@@ -220,6 +220,8 @@ elif curve == KSS:
 elif curve == FotiadisMartindale:
     if code == 17:
         from tnfs.param.testvector_other_sparseseed import test_vector_sparse_fm12_17 as test_vector
+    if code == 18:
+        from tnfs.param.testvector_other_sparseseed import test_vector_sparse_fm12_18 as test_vector
     elif code == 23:
         from tnfs.param.testvector_other_sparseseed import test_vector_sparse_fm16_23 as test_vector
     elif code == 25:
diff --git a/sage/tnfs/param/testvector_other_sparseseed.py b/sage/tnfs/param/testvector_other_sparseseed.py
index 7c7dc03..13ea0a6 100644
--- a/sage/tnfs/param/testvector_other_sparseseed.py
+++ b/sage/tnfs/param/testvector_other_sparseseed.py
@@ -7,6 +7,22 @@ test_vector_sparse_fm12_17 = [ # family 17 in eprint 2019/555
     {'u':-0x43ffbfffffffe000, 'b':-2, 'pnbits':384, 'rnbits':254, 'deg_h_S':6,'cost_S':129, 'label':"-2^62-2^58+2^46+2^13 Hw2naf 4"},
     {'u':-0x47ffffffe0000002, 'b': 2, 'pnbits':384, 'rnbits':254, 'deg_h_S':6,'cost_S':129, 'label':"-2^62-2^59+2^29-2 Hw2naf 4"},
 ]
+
+# FM12 curves with sparse seed u = [1] mod 2 of 32--33 bits Hw2naf 5
+test_vector_sparse_fm12_18 = [
+    {'u': 0x87e00001, 'u_mod_6':3, 'a':-30, 'b':56, 'pnbits':433, 'rnbits':249, 'cost_S':133, 'deg_h_S':12, 'label':"2^31+2^27-2^21+1 Hw2naf 4"},
+    {'u':0x100024001, 'u_mod_6':5, 'a':-30, 'b':56, 'pnbits':446, 'rnbits':257, 'cost_S':134, 'deg_h_S':12, 'label':"2^32+2^17+2^14+1 Hw2naf 4, u=4295114753 for Family 8 p.27 in ePrint 2018/969, Fotiadis-Martindale"},
+    {'u':0x10087ffff, 'u_mod_6':1, 'a':-30, 'b':56, 'pnbits':446, 'rnbits':257, 'cost_S':134, 'deg_h_S':12, 'label':"2^32+2^23+2^19-1 Hw2naf 4"},
+    {'u':0x104000011, 'u_mod_6':1, 'a':-30, 'b':56, 'pnbits':446, 'rnbits':257, 'cost_S':134, 'deg_h_S':12, 'label':"2^32+2^26+2^4+1 Hw2naf 4"},
+    # Hamming weight 5, r of 256 bits.
+    {'u': 0xfffff817, 'u_mod_6':1, 'a':-30, 'b':56, 'pnbits':445, 'rnbits':256, 'cost_S':134, 'deg_h_S':12, 'label':"+2^32-2^11+2^5-2^3-1 Hw2naf 5"},
+    {'u': 0xc07ffeff, 'u_mod_6':3, 'a':-30, 'b':56, 'pnbits':440, 'rnbits':253, 'cost_S':134, 'deg_h_S':12, 'label':"+2^32-2^30+2^23-2^8-1 Hw2naf 5"},
+    # Hamming weight 5, r of 256 bits.
+    {'u': 0x80060041, 'u_mod_6':1, 'a':-30, 'b':56, 'pnbits':432, 'rnbits':249, 'cost_S':133, 'deg_h_S':12, 'label':"+2^31+2^18+2^17+2^6+1 Hw2naf 5"},
+    {'u': 0x88400401, 'u_mod_6':1, 'a':-30, 'b':56, 'pnbits':433, 'rnbits':249, 'cost_S':133, 'deg_h_S':12, 'label':"+2^31+2^27+2^22+2^10+1 Hw2naf 5"},
+]
+test_vector_sparse_fst67_k12 = test_vector_sparse_fm12_18
+
 test_vector_sparse_fm16_23 = [ # family 23 in eprint 2019/555
     {'u':0x1000014000000, 'a': 1, 'pnbits':767, 'rnbits':385, 'deg_h_S':16,'cost_S':196, 'deg_h_C':4,'cost_C':209, 'label':"+2^48+2^28+2^26 Hw2naf 3"},
     {'u':-0xfffffffd7ff8, 'a': 1, 'pnbits':766, 'rnbits':384, 'deg_h_S':16,'cost_S':196, 'deg_h_C':4,'cost_C':209, 'label':"-2^48+2^17+2^15+2^3 Hw2naf 4"},
-- 
GitLab