ethereum / py_ecc

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

Add strict deserialization format validation #110

Closed hwwhww closed 3 years ago

hwwhww commented 3 years ago

What was wrong?

Fix #108

How was it fixed?

Note: py_ecc doesn't provide APIs decompressed form deserialization, only compressed form deserialization.

  1. Check if c_flag is True
  2. If b_flag is True, check if a_flag is False and the value is 0.
  3. For decompress_G2, check c_flag2 == b_flag2 == a_flag2 == False

Cute Animal Picture

🦩

hwwhww commented 3 years ago

Thanks for the reviews! :)