Skip to content

Add strict deserialization format validation#110

Merged
hwwhww merged 8 commits intomasterfrom
c_flag_check
Nov 16, 2020
Merged

Add strict deserialization format validation#110
hwwhww merged 8 commits intomasterfrom
c_flag_check

Conversation

@hwwhww
Copy link
Copy Markdown
Contributor

@hwwhww hwwhww commented Nov 16, 2020

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

🦩

Comment thread py_ecc/bls/ciphersuites.py Outdated
Comment thread py_ecc/bls/point_compression.py Outdated
Comment thread py_ecc/bls/point_compression.py Outdated
Copy link
Copy Markdown
Contributor

@ChihChengLiang ChihChengLiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Added some nitpicks.

Comment thread py_ecc/bls/point_compression.py Outdated
Comment thread py_ecc/bls/point_compression.py Outdated
Comment thread py_ecc/bls/point_compression.py Outdated
Comment thread py_ecc/bls/ciphersuites.py Outdated
Comment thread py_ecc/bls/point_compression.py Outdated
Comment thread tests/bls/test_g2_core.py
Copy link
Copy Markdown
Contributor

@ChihChengLiang ChihChengLiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found some duplications, other looks good to me.

Comment thread py_ecc/bls/point_compression.py Outdated
Comment thread py_ecc/bls/point_compression.py Outdated
Comment thread py_ecc/bls/point_compression.py
Comment thread py_ecc/bls/point_compression.py Outdated
@hwwhww
Copy link
Copy Markdown
Contributor Author

hwwhww commented Nov 16, 2020

Thanks for the reviews! :)

@hwwhww hwwhww merged commit d0439bf into master Nov 16, 2020
@hwwhww hwwhww deleted the c_flag_check branch November 16, 2020 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BLS point (de)compression issue

3 participants