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

k256 v0.13.3 causes an error on secp256k1_recover_pubkey_works test #2010

Closed
loloicci opened this issue Jan 31, 2024 · 5 comments · Fixed by #2014
Closed

k256 v0.13.3 causes an error on secp256k1_recover_pubkey_works test #2010

loloicci opened this issue Jan 31, 2024 · 5 comments · Fixed by #2014
Milestone

Comments

@loloicci
Copy link
Contributor

After executing cargo update on packages/crypto to update k256 to v0.13.3, test secp256k1::tests::secp256k1_recover_pubkey_works fails with

---- secp256k1::tests::secp256k1_recover_pubkey_works stdout ----
thread 'secp256k1::tests::secp256k1_recover_pubkey_works' panicked at packages/crypto/src/secp256k1.rs:355:88:
called `Result::unwrap()` on an `Err` value: GenericErr { msg: "signature error", backtrace: <disabled> }

This error is not caused with k256 v0.13.1.

@loloicci loloicci changed the title k256 v0.13.3 causes an error on secp256k1_recover_pubkey k256 v0.13.3 causes an error on secp256k1_recover_pubkey_test Jan 31, 2024
@loloicci loloicci changed the title k256 v0.13.3 causes an error on secp256k1_recover_pubkey_test k256 v0.13.3 causes an error on secp256k1_recover_pubkey_works test Jan 31, 2024
@webmaster128
Copy link
Member

Thanks you. I can reproduce the issue with k256 v0.13.2 and v0.13.3. On it

@webmaster128
Copy link
Member

Caused by this change: Reject signatures which aren't low-S normalized (RustCrypto/elliptic-curves#914) (https://github.com/RustCrypto/elliptic-curves/blob/master/k256/CHANGELOG.md#0132-2023-11-15)

@webmaster128
Copy link
Member

Thank you for the report. I think we can address this in two steps:

  1. Pin version to 0.13.1
  2. Figure out if the old behaviour can be restored by a different way of using k256. I asked here, let's see how straight forward that is.

@webmaster128
Copy link
Member

I think #2000 (last commit) is a better fix since it avoids the pinning

@webmaster128
Copy link
Member

Update: the fix is now in #2014. In #2000 we are back to adding only test vectors without touching the implementation.

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 a pull request may close this issue.

2 participants