diff --git a/sage/test_curves.sage b/sage/test_curves.sage index 354d271884a803f55cca7ccbd40d94d1a30f5e93..c83ce2b4e62187417da26da5c1418de6f6568846 100644 --- a/sage/test_curves.sage +++ b/sage/test_curves.sage @@ -267,6 +267,8 @@ elif curve == FST64: elif curve == FST66: if k==24: from tnfs.param.testvector_other_sparseseed import test_vector_sparse_fst66_k24 as test_vector + elif k==22: + from tnfs.param.testvector_other_sparseseed import test_vector_fst66_k22 as test_vector elif k==20: from tnfs.param.testvector_other_sparseseed import test_vector_sparse_fst66_k20 as test_vector else: diff --git a/sage/tnfs/gen/compute_test_vector_curve.py b/sage/tnfs/gen/compute_test_vector_curve.py index b5929a0558d87f47002fdafab78824964da2abb8..0d51af90b83930cfdf1212aa6ddd38b52ae65301 100644 --- a/sage/tnfs/gen/compute_test_vector_curve.py +++ b/sage/tnfs/gen/compute_test_vector_curve.py @@ -63,6 +63,7 @@ from tnfs.curve.cyclotomic import allowed_k as allowed_k_cyclo # sage -python -m tnfs.gen.compute_test_vector_curve --kss -k 22 -D 1 -choice_kss 0 -r 0 576 --find_all_u # --negative_u # sage -python -m tnfs.gen.compute_test_vector_curve --kss -k 22 -D 1 -choice_kss 1 -r 0 512 --find_all_u # --negative_u # sage -python -m tnfs.gen.compute_test_vector_curve --fst63 -k 22 -r 256 384 --find_all_u # px is even, no --negative_u needed +# sage -python -m tnfs.gen.compute_test_vector_curve --fst66 -k 22 -r 256 384 --find_all_u # --negative_u # sage -python -m tnfs.gen.compute_test_vector_curve --kss -k 32 -r 384 400 --find_all_u # sage -python -m tnfs.gen.compute_test_vector_curve --kss -k 36 -r 384 384 --find_all_u # diff --git a/sage/tnfs/param/testvector_other_sparseseed.py b/sage/tnfs/param/testvector_other_sparseseed.py index 852a0737851b8e163923b34c4144aed556dcceed..7c7dc03fb7e2c4b9617e1de51a90e71f99863634 100644 --- a/sage/tnfs/param/testvector_other_sparseseed.py +++ b/sage/tnfs/param/testvector_other_sparseseed.py @@ -216,6 +216,53 @@ test_vector_fst63_k22 = [ {'u':0x492005, 'u_mod_11':10,'a': 1, 'pnbits':575,'rnbits':444, 'deg_h_S':22,'cost_S':194, 'deg_h_C':11, 'cost_C':254, 'label':"u=+2^22+2^19+2^16+2^13+2^2+1 Hw2NAF=6"},#31 ] +test_vector_fst66_k22 = [ + # x = 1, 5 mod 11 to ensure p = 1 mod 11 + # p up to 512 bits + # negative u + {'u':-0x4b5d5, 'u_mod_11':0, 'b': 1, 'pnbits':510,'rnbits':365, 'deg_h_S':None,'cost_S':None, 'label':"u=-2^18-2^16+2^14+2^11+2^9+2^6-2^4-2^2-1 Hw2NAF=9"},#0 + {'u':-0x4bfd7, 'u_mod_11':1, 'b': 1, 'pnbits':510,'rnbits':365, 'deg_h_S':None,'cost_S':None, 'label':"u=-2^18-2^16+2^14+2^5+2^3+1 Hw2NAF=6"},#1 + {'u':-0x4c0ac, 'u_mod_11':8, 'b':-2, 'pnbits':510,'rnbits':365, 'deg_h_S':None,'cost_S':None, 'label':"u=-2^18-2^16+2^14-2^8+2^6+2^4+2^2 Hw2NAF=7"},#2 + {'u':-0x4db9d, 'u_mod_11':8, 'b': 1, 'pnbits':511,'rnbits':366, 'deg_h_S':None,'cost_S':None, 'label':"u=-2^18-2^16+2^13+2^10+2^7-2^5+2^2-1 Hw2NAF=8"},#3 + {'u':-0x4dcb7, 'u_mod_11':1, 'b': 1, 'pnbits':511,'rnbits':366, 'deg_h_S':None,'cost_S':None, 'label':"u=-2^18-2^16+2^13+2^10-2^8+2^6+2^3+1 Hw2NAF=8"},#4 + {'u':-0x4e4e2, 'u_mod_11':0, 'b':-2, 'pnbits':511,'rnbits':366, 'deg_h_S':None,'cost_S':None, 'label':"u=-2^18-2^16+2^13-2^10-2^8+2^5-2 Hw2NAF=7"},#5 + # positive u + {'u': 0x4b865, 'u_mod_11':7, 'b': 1, 'pnbits':510,'rnbits':365, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^18+2^16-2^14-2^11+2^7-2^5+2^2+1 Hw2NAF=8"},#6 + {'u': 0x4e268, 'u_mod_11':4, 'b':-2, 'pnbits':511,'rnbits':366, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^18+2^16-2^13+2^9+2^7-2^5+2^3 Hw2NAF=7"},#7 + {'u': 0x4e712, 'u_mod_11':10,'b':-2, 'pnbits':511,'rnbits':366, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^18+2^16-2^13+2^11-2^8+2^4+2 Hw2NAF=7"},#8 + # r close to 384 bits + {'u': 0x7d722, 'u_mod_11':5, 'b':-2, 'pnbits':530,'rnbits':380, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^19-2^13-2^11-2^8+2^5+2 Hw2NAF=6"},#9 + {'u': 0x80572, 'u_mod_11':3, 'b':-2, 'pnbits':531,'rnbits':381, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^19+2^11-2^9-2^7-2^4+2 Hw2NAF=6"},#10 + {'u': 0x80b51, 'u_mod_11':10,'b': 1, 'pnbits':531,'rnbits':381, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^19+2^12-2^10-2^8+2^6+2^4+1 Hw2NAF=7"},#11 + {'u': 0x811e4, 'u_mod_11':10,'b':-2, 'pnbits':531,'rnbits':381, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^19+2^12+2^9-2^5+2^2 Hw2NAF=5"},#12 + {'u': 0x818f8, 'u_mod_11':7, 'b':-2, 'pnbits':531,'rnbits':381, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^19+2^13-2^11+2^8-2^3 Hw2NAF=5"},#13 + {'u': 0x82a1a, 'u_mod_11':4, 'b':-2, 'pnbits':532,'rnbits':381, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^19+2^13+2^11+2^9+2^5-2^3+2 Hw2NAF=7"},#14 + {'u': 0x853ab, 'u_mod_11':8, 'b': 1, 'pnbits':533,'rnbits':382, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^19+2^14+2^12+2^10-2^6-2^4-2^2-1 Hw2NAF=8"},#15 + {'u': 0x879b5, 'u_mod_11':0, 'b': 1, 'pnbits':533,'rnbits':382, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^19+2^15-2^11+2^9-2^6-2^4+2^2+1 Hw2NAF=8"},#16 + {'u': 0x880b4, 'u_mod_11':9, 'b':-2, 'pnbits':533,'rnbits':382, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^19+2^15+2^8-2^6-2^4+2^2 Hw2NAF=6"},#17 + {'u': 0x8894b, 'u_mod_11':8, 'b': 1, 'pnbits':534,'rnbits':382, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^19+2^15+2^11+2^8+2^6+2^4-2^2-1 Hw2NAF=8"},#18 + {'u': 0x8919a, 'u_mod_11':1, 'b':-2, 'pnbits':534,'rnbits':382, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^19+2^15+2^12+2^9-2^7+2^5-2^3+2 Hw2NAF=8"},#19 + {'u': 0x89c1a, 'u_mod_11':5, 'b':-2, 'pnbits':534,'rnbits':383, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^19+2^15+2^13-2^10+2^5-2^3+2 Hw2NAF=7"},#20 + {'u': 0x89e3c, 'u_mod_11':1, 'b':-2, 'pnbits':534,'rnbits':383, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^19+2^15+2^13-2^9+2^6-2^2 Hw2NAF=6"},#21 + {'u': 0x8a808, 'u_mod_11':1, 'b':-2, 'pnbits':534,'rnbits':383, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^19+2^15+2^13+2^11+2^3 Hw2NAF=5"},#22 + {'u': 0x8e1e3, 'u_mod_11':6, 'b': 1, 'pnbits':535,'rnbits':384, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^19+2^16-2^13+2^9-2^5+2^2-1 Hw2NAF=7"},#23 + {'u': 0x8e483, 'u_mod_11':7, 'b': 1, 'pnbits':535,'rnbits':384, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^19+2^16-2^13+2^10+2^7+2^2-1 Hw2NAF=7"},#24 + {'u': 0x90265, 'u_mod_11':1, 'b': 1, 'pnbits':536,'rnbits':384, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^19+2^16+2^9+2^7-2^5+2^2+1 Hw2NAF=7"},#25 + {'u': 0x916e4, 'u_mod_11':1, 'b':-2, 'pnbits':536,'rnbits':384, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^19+2^16+2^13-2^11-2^8-2^5+2^2 Hw2NAF=7"},#26 + {'u': 0x91f51, 'u_mod_11':2, 'b': 1, 'pnbits':536,'rnbits':384, 'deg_h_S':None,'cost_S':None, 'label':"u=+2^19+2^16+2^13-2^8+2^6+2^4+1 Hw2NAF=7"},#27 + # + {'u':-0x81bc3, 'u_mod_11':4, 'b': 1, 'pnbits':531,'rnbits':381, 'deg_h_S':None,'cost_S':None, 'label':"u=-2^19-2^13+2^10+2^6-2^2+1 Hw2NAF=6"},#28 + {'u':-0x824c9, 'u_mod_11':4, 'b': 1, 'pnbits':532,'rnbits':381, 'deg_h_S':None,'cost_S':None, 'label':"u=-2^19-2^13-2^10-2^8+2^6-2^3-1 Hw2NAF=7"},#29 + {'u':-0x82bad, 'u_mod_11':0, 'b': 1, 'pnbits':532,'rnbits':381, 'deg_h_S':None,'cost_S':None, 'label':"u=-2^19-2^14+2^12+2^10+2^6+2^4+2^2-1 Hw2NAF=8"},#30 + {'u':-0x83f12, 'u_mod_11':7, 'b':-2, 'pnbits':532,'rnbits':381, 'deg_h_S':None,'cost_S':None, 'label':"u=-2^19-2^14+2^8-2^4-2 Hw2NAF=5"},#31 + {'u':-0x866ed, 'u_mod_11':1, 'b': 1, 'pnbits':533,'rnbits':382, 'deg_h_S':None,'cost_S':None, 'label':"u=-2^19-2^15+2^13-2^11+2^8+2^4+2^2-1 Hw2NAF=8"},#32 + {'u':-0x86984, 'u_mod_11':9, 'b':-2, 'pnbits':533,'rnbits':382, 'deg_h_S':None,'cost_S':None, 'label':"u=-2^19-2^15+2^13-2^11-2^9+2^7-2^2 Hw2NAF=7"},#33 + {'u':-0x86987, 'u_mod_11':6, 'b': 1, 'pnbits':533,'rnbits':382, 'deg_h_S':None,'cost_S':None, 'label':"u=-2^19-2^15+2^13-2^11-2^9+2^7-2^3+1 Hw2NAF=8"},#34 + {'u':-0x8e04c, 'u_mod_11':5, 'b':-2, 'pnbits':535,'rnbits':383, 'deg_h_S':None,'cost_S':None, 'label':"u=-2^19-2^16+2^13-2^6-2^4+2^2 Hw2NAF=6"},#35 + {'u':-0x925d3, 'u_mod_11':4, 'b': 1, 'pnbits':536,'rnbits':384, 'deg_h_S':None,'cost_S':None, 'label':"u=-2^19-2^16-2^13-2^11+2^9+2^6-2^4-2^2+1 Hw2NAF=9"},#36 +] + + # BLS21 curves with sparse seed u = [1, 4] mod 6 of 33--33 bits Hw2naf 5 and s.t. r has 384 to 384 bits # u % 7 == 1 allows to have p = 1 mod 7 as (px-1).roots(GF(7)) gives root (1). test_vector_sparse_bls21 = [