-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Conversion function between raw and DER ECDSA signatures #8681
Conversation
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
…ersion functions Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
d4633b7
to
9816ae5
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.
This is mostly a complete review, but there are a few more things I want to do:
- compare with previous functions
- check test coverage.
Overall it's looking good even though I had quite a lot to say :)
Following this discussion with Gilles, actually could you try prototyping (in another PR) an alternative implementation of these functions that doesn't rely on existing (IMO this doesn't have to be blocking this PR. We can perfectly start by merging a version that depends on |
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
- Replace 192 case with 256 - Replace 256 case with 512 - Add 521 case Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This is mandatory to have support for the error codes defined in the asn1write.h header file. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Sure! I will start the new PR based on this one |
c6c68ed
to
696803a
Compare
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
There is no PSA equivalent to ASN1 legacy symbols. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This is possible because we know that DER format can have at most 1 leading zero. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
da4e233
to
4e53147
Compare
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Tests with 256 bits curve simply depends on any curve of that size, but they don't really care about which family is enabled. Here I replaced PSA_WANT_ECC_SECP_R1_256 with PSA_WANT_ECC_SECP_K1_256 because otherwise there were test disparities in the "analyze_driver_vs_reference_tfm_config" component of "analyze_outcomes.py". It looked simpler to change the curve type in the test suite's data rather than adding proper exceptions in "analyze_outcomes.py" Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
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 addressing my feedback.
(Still not a complete review, same points left as last time.)
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
57f91a9
to
df4e456
Compare
Closing this one as agreed on #8696 (comment). This feature will be completed in #8703 |
Description
Add ECDSA's conversion functions between raw and DER (ASN.1) format.
Resolves #7765
PR checklist