diff --git a/sage/curve_family_bls12.sage b/sage/curve_family_bls12.sage index 701c8aa..a8324a0 100644 --- a/sage/curve_family_bls12.sage +++ b/sage/curve_family_bls12.sage @@ -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 diff --git a/sage/curve_family_bn.sage b/sage/curve_family_bn.sage index 2a2a443..2b81286 100644 --- a/sage/curve_family_bn.sage +++ b/sage/curve_family_bn.sage @@ -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)'