Skip to content

Commit

Permalink
mul
Browse files Browse the repository at this point in the history
  • Loading branch information
asanso committed Mar 5, 2024
1 parent 2fb4178 commit ea81694
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def hex_to_int(x: str) -> int:
# TODO to change
BLS12_G1ADD_GAS = 600
BLS12_G2ADD_GAS = 4500
BLS12_G1MUL_GAS = 1200
BLS12_G1MUL_GAS = 12000

# random point in G1
P1 = (
Expand Down Expand Up @@ -298,6 +298,20 @@ def case03_mul_G1():
assert result_doubling_P1 == multiply(P1, 2)

yield 'mul_G1_bls', [
{
"Input": int_to_hex(int(G1[0]), 64) + (int_to_hex(int(G1[1]), 64)) + int_to_hex(int(2), 32),
"Name": "bls_g1mul_(g1+g1=2*g1)",
"Expected": int_to_hex(int(result_doubling_G1[0]), 64) + (int_to_hex(int(result_doubling_G1[1]), 64)),
"Gas": BLS12_G1MUL_GAS,
"NoBenchmark": False
},
{
"Input": int_to_hex(int(P1[0]), 64) + (int_to_hex(int(P1[1]), 64)) + int_to_hex(int(2), 32),
"Name": "bls_g1mul_(p1+p1=2*p1)",
"Expected": int_to_hex(int(result_doubling_P1[0]), 64) + (int_to_hex(int(result_doubling_P1[1]), 64)),
"Gas": BLS12_G1MUL_GAS,
"NoBenchmark": False
}
]


Expand Down

0 comments on commit ea81694

Please sign in to comment.