Report interesting moduli for BLS and BN curves
This commit is contained in:
parent
ff9dec4813
commit
71a2acc202
|
@ -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
|
||||
|
||||
|
|
|
@ -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)'
|
||||
|
|
Loading…
Reference in New Issue