Skip to content

fix compactabtility check#772

Merged
tarcieri merged 4 commits into
RustCrypto:masterfrom
helium:lthiery/compactability-fix
Mar 2, 2023
Merged

fix compactabtility check#772
tarcieri merged 4 commits into
RustCrypto:masterfrom
helium:lthiery/compactability-fix

Conversation

@lthiery

@lthiery lthiery commented Mar 2, 2023

Copy link
Copy Markdown
Contributor

The function to_compact_encoded_point should return a CtOption where is_some set to 0 if the AffinePoint is non-compactable.

The current implementation checks if the EncodedPoint from bytes decodes properly to determine compactability. However, the EncodedPoint will always decode just fine, even when a non-compactable point has been compacted.

Instead, what needs to be checked is if the compacted point and the original affine points Y coordinates match.

Comment thread p256/tests/affine.rs Outdated
@tarcieri

tarcieri commented Mar 2, 2023

Copy link
Copy Markdown
Member

Needs rustfmt, otherwise looks good

lthiery and others added 2 commits March 2, 2023 12:17
Co-authored-by: Tony Arcieri <bascule@gmail.com>
@lthiery

lthiery commented Mar 2, 2023

Copy link
Copy Markdown
Contributor Author

Thanks for the quick review. Let me know if it's good now.

@lthiery

lthiery commented Mar 2, 2023

Copy link
Copy Markdown
Contributor Author

Working on the test still.

@lthiery

lthiery commented Mar 2, 2023

Copy link
Copy Markdown
Contributor Author

Okay, I think it's ready unless you spot anything else.

Is it possible for a point-release with this? We have a downstream crate that we'd like to publish with this dependency updated.

@tarcieri

tarcieri commented Mar 2, 2023

Copy link
Copy Markdown
Member

You caught me just as I was about to cut a new set of breaking crate releases after merging #770.

Backports are a bit messy.

@tarcieri tarcieri merged commit 3049c50 into RustCrypto:master Mar 2, 2023
@lthiery

lthiery commented Mar 2, 2023

Copy link
Copy Markdown
Contributor Author

Perfect! Thanks for everything.

@lthiery lthiery deleted the lthiery/compactability-fix branch March 2, 2023 21:03
This was referenced Mar 3, 2023
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.

2 participants