Skip to content

Commit

Permalink
add g2
Browse files Browse the repository at this point in the history
  • Loading branch information
asanso committed Mar 4, 2024
1 parent 7152884 commit 4468479
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,21 +205,7 @@ def case01_add_G1():
"Expected": int_to_hex(int(result_doubling_P1[0]), 64) + (int_to_hex(int(result_doubling_P1[1]), 64)),
"Gas": BLS12_G1ADD_GAS,
"NoBenchmark": False
},
{
"Input": int_to_hex(int(G1[0]), 64) + (int_to_hex(int(G1[1]), 64)) + int_to_hex(int(G1[0]), 64) + (int_to_hex(int(neg(G1)[1]), 64)),
"Name": "bls_g1add_(g1+(-g1)=0)",
"Expected": int_to_hex(0, 64) + int_to_hex(0, 64),
"Gas": BLS12_G1ADD_GAS,
"NoBenchmark": False
},
{
"Input": int_to_hex(int(P1[0]), 64) + (int_to_hex(int(P1[1]), 64)) + int_to_hex(int(P1[0]), 64) + (int_to_hex(int(neg(P1)[1]), 64)),
"Name": "bls_g1add_(p1+(-p1)=0)",
"Expected": int_to_hex(0, 64) + int_to_hex(0, 64),
"Gas": BLS12_G1ADD_GAS,
"NoBenchmark": False
},
}
]


Expand Down Expand Up @@ -273,6 +259,13 @@ def case02_add_G2():
"NoBenchmark": False
},
{
"Input": int_to_hex(int(G2[0].coeffs[0]), 64) + int_to_hex(int(G2[0].coeffs[1]), 64) + int_to_hex(int(G2[1].coeffs[0]), 64) + int_to_hex(int(G2[1].coeffs[1]), 64) + int_to_hex(int(neg(G2)[0].coeffs[0]), 64) + int_to_hex(int(neg(G2)[0].coeffs[1]), 64) + int_to_hex(int(neg(G2)[1].coeffs[0]), 64) + int_to_hex(int(neg(G2)[1].coeffs[1]), 64),
"Name": "bls_g2add_(g2-g2=0)",
"Expected": int_to_hex(0, 64) + int_to_hex(0, 64) + int_to_hex(0, 64) + int_to_hex(0, 64),
"Gas": BLS12_G2ADD_GAS,
"NoBenchmark": False
},
{
"Input": int_to_hex(int(G2[0].coeffs[0]), 64) + int_to_hex(int(G2[0].coeffs[1]), 64) + int_to_hex(int(G2[1].coeffs[0]), 64) + int_to_hex(int(G2[1].coeffs[1]), 64) + int_to_hex(int(G2[0].coeffs[0]), 64) + int_to_hex(int(G2[0].coeffs[1]), 64) + int_to_hex(int(G2[1].coeffs[0]), 64) + int_to_hex(int(G2[1].coeffs[1]), 64),
"Name": "bls_g2add_(g2+g2=2*g2)",
"Expected": int_to_hex(int(result_doubling_G2[0].coeffs[0]), 64) + int_to_hex(int(result_doubling_G2[0].coeffs[1]), 64) + int_to_hex(int(result_doubling_G2[1].coeffs[0]), 64) + int_to_hex(int(result_doubling_G2[1].coeffs[1]), 64),
Expand Down

0 comments on commit 4468479

Please sign in to comment.