-
Notifications
You must be signed in to change notification settings - Fork 2k
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
pkg/micro-ecc/psa_uecc: convert between SEC 1 and micro-ecc public key formats #20676
Conversation
Thanks, very good catch! How did you find out about that one? If you have some testing data (aka signatures and a matching public key for verify), it would be nice to augment our tests (probably |
4868314
to
458b7c2
Compare
I do not have an ATECC608A but I think the psa_crypto_se_ecdsa test should already fail. |
Ah really? I think the tests are currently generating a new keypair and using its public part to verify a selfmade signature - which should currently succeed on both hardware and software backends. Only the interaction between different implementations would be a problem. So a test which imports a public key and verifies a pre-signed message should have passed on the hardware but not with micro-ecc, which you are fixing here. |
You're right. I just misunderstood the test.
Seems like a good idea. I gave it a try. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the test vector! I can confirm that the test fails on BOARD=native
before the bugfix and passes after applying it.
Just a minor note below.
92c191d
to
2ed082a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! :)
Contribution description
micro-ecc uses the SEC 1 public key format without the 0x04 prefix [1]. This PR adds conversions between SEC 1 and micro-ecc public key formats in the micro-ecc PSA backend driver.
[1]: https://github.com/kmackay/micro-ecc/blob/master/README.md#point-representation
Testing procedure
make -C tests/sys/psa_crypto_ecdsa all test
Issues/PRs references
None