ethereum / py_ecc

Python implementation of ECC pairing and bn_128 and bls12_381 curve operations
MIT License
183 stars 82 forks source link

BLS point (de)compression issue #108

Closed hwwhww closed 3 years ago

hwwhww commented 3 years ago

What is wrong?

Follow up with #107, to see what's wrong with the (de)compression.

History

The implementation and the given test case

The decompress_G1 function: https://github.com/ethereum/py_ecc/blob/d17ee3cec483642e5a6bcd67c06d86eb6b3e7994/py_ecc/bls/point_compression.py#L55-L77

I think decompress_G1 should have checked c_flag (c_flag == 1 in decompress_G1). So do other (de)compress functions.

/cc @ChihChengLiang @CarlBeek could you 👀 sanity check it?