Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PublicKey::from_encoded_point go through PublicKey::from_affine #416

Merged
merged 1 commit into from
Dec 18, 2020

Conversation

rozbb
Copy link
Contributor

@rozbb rozbb commented Dec 18, 2020

Fixes #415

@rozbb
Copy link
Contributor Author

rozbb commented Dec 18, 2020

It's hard to add a regression test for this, because there are no concrete curves we can use to run a test

@tarcieri
Copy link
Member

It'd be fantastic if you could add a regression test for this as well

@rozbb
Copy link
Contributor Author

rozbb commented Dec 18, 2020

One way to allow for a regression test is to pull in a curve like p256 just for this test. Might be overkill though, and it's a bit circular

@tarcieri
Copy link
Member

@rozbb yeah this is something of an ongoing problem... no worries!

I have a "mock curve" in the ecdsa crate but not in this one.

Perhaps I should move it to this crate (e.g. in a dev module) and then the ecdsa crate could reuse it.

@tarcieri tarcieri merged commit 487430a into RustCrypto:master Dec 18, 2020
tarcieri added a commit that referenced this pull request Dec 22, 2020
The invariant of `PublicKey` is that the inner affine point is *NOT*
the identity, however there was a bug in the `FromEncodedPoint`
implementation which was fixed in #416.

However, at the time we couldn't add a regression test because there was
no concrete curve type to use for writing such a test.

A `MockCurve` was added in #419, so this commit uses it to write such
a regression test.
tarcieri added a commit that referenced this pull request Dec 22, 2020
The invariant of `PublicKey` is that the inner affine point is *NOT*
the identity, however there was a bug in the `FromEncodedPoint`
implementation which was fixed in #416.

However, at the time we couldn't add a regression test because there was
no concrete curve type to use for writing such a test.

A `MockCurve` was added in #419, so this commit uses it to write such
a regression test.
tarcieri added a commit that referenced this pull request Dec 22, 2020
The invariant of `PublicKey` is that the inner affine point is *NOT*
the identity, however there was a bug in the `FromEncodedPoint`
implementation which was fixed in #416.

However, at the time we couldn't add a regression test because there was
no concrete curve type to use for writing such a test.

A `MockCurve` was added in #419, so this commit uses it to write such
a regression test.
@tarcieri tarcieri mentioned this pull request Dec 22, 2020
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.

PublicKeys can be zero
2 participants