Report interesting moduli for BLS and BN curves

This commit is contained in:
Mamy André-Ratsimbazafy 2020-05-22 17:55:03 +02:00
parent ff9dec4813
commit 71a2acc202
No known key found for this signature in database
GPG Key ID: 7B88AD1FE79492E1
2 changed files with 11 additions and 1 deletions

View File

@ -30,9 +30,14 @@ def compute_curve_characteristic(u_str):
else:
print(' Parameter u (hex): 0x' + u.hex())
print(f' p mod 4: ' + str(p % 4))
print(f' p mod 8: ' + str(p % 8))
print(f' p mod 12: ' + str(p % 12))
print(f' p mod 16: ' + str(p % 16))
if __name__ == "__main__":
# Usage
# sage '-(2^63 + 2^62 + 2^60 + 2^57 + 2^48 + 2^16)'
# sage sage/curve_family_bls12.sage '-(2^63 + 2^62 + 2^60 + 2^57 + 2^48 + 2^16)'
from argparse import ArgumentParser

View File

@ -30,6 +30,11 @@ def compute_curve_characteristic(u_str):
else:
print(' Parameter u (hex): 0x' + u.hex())
print(f' p mod 4: ' + str(p % 4))
print(f' p mod 8: ' + str(p % 8))
print(f' p mod 12: ' + str(p % 12))
print(f' p mod 16: ' + str(p % 16))
if __name__ == "__main__":
# Usage
# sage sage/curve_family_bn.sage '-(2^62 + 2^55 + 1)'