Skip to content

Commit

Permalink
fixing build
Browse files Browse the repository at this point in the history
  • Loading branch information
asanso committed Feb 29, 2024
1 parent 225e9c7 commit 6998ac5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from ruamel.yaml import YAML

from hashlib import sha256


from py_ecc.bls12_381 import (
G1,
Expand All @@ -22,30 +21,34 @@
)

from py_ecc.optimized_bls12_381 import (
FQ2,
neg
FQ2
)

from py_ecc.bls.hash_to_curve import hash_to_G2

def to_bytes32(i):
return i.to_bytes(32, byteorder='big')


def hash(x):
return sha256(x).digest()


def encode_hex(value: bytes) -> str:
return value.hex()


def int_to_big_endian(value: int) -> bytes:
return value.to_bytes((value.bit_length() + 7) // 8, byteorder='big')


def int_to_hex(n: int, byte_length: int = None) -> str:
byte_value = int_to_big_endian(n)
if byte_length:
byte_value = byte_value.rjust(byte_length, b'\x00')
return encode_hex(byte_value)


def hex_to_int(x: str) -> int:
return int(x, 16)

Expand Down Expand Up @@ -104,6 +107,7 @@ def expect_exception(func, *args):
else:
raise Exception("should have raised exception")


def case01_add_G1():

# Commutativity
Expand Down

0 comments on commit 6998ac5

Please sign in to comment.