Repository navigation
Conversation
Add ES512 (ECDSA with P-521 and SHA-512) to `Algorithm` and `KeyAlgorithm`, and implement signing, verification and JWK creation for P-521 keys in both crypto backends. - aws_lc_rs: use ECDSA_P521_SHA512_FIXED(_SIGNING). - rust_crypto: add the `p521` crate. The RustCrypto ECDSA signers are now generated by one macro that decodes PKCS#8 into a `SecretKey` and converts it to a signing key. ES256/ES384 output is unchanged (both old and new paths use RFC 6979). - p521 0.13 signs with a random nonce from OsRng instead of RFC 6979, so rust_crypto ES512 signatures are valid but not deterministic. - Recognise 133-byte uncompressed P-521 public keys when building a JWK from a DecodingKey. Tests use the RFC 7520 P-521 key (section 3.2) and the ES512 JWS (section 4.3). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gjasny
commented
Nov 10, 2026
|
|
||
| macro_rules! define_ecdsa_signer { | ||
| ($name:ident, $alg:expr, $signing_key:ty) => { | ||
| ($name:ident, $alg:expr, $secret_key:ty, $signing_key:ty, $signature:ty, $from_secret:expr) => { |
Author
There was a problem hiding this comment.
The updated crypto stack from #536 will simplify the define_ecdsa_signer macro, again.
Collaborator
|
Really? #532 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
I had some JWT and wanted to decode them with jwt-ui to visualize the content. Unfortunately, my tokens use the ES512 algorithm which
jsonwebtokendoes not support. This patch is the result of Claude adding ES512 support.My rust knowledge is very basic so I cannot really judge if all of the changes are sensible. Nevertheless the code worked for me and I'd like to share it in good faith.
Thanks,
Gregor
Add ES512 (ECDSA with P-521 and SHA-512) to
AlgorithmandKeyAlgorithm, and implement signing, verification and JWK creation for P-521 keys in both crypto backends.p521crate. The RustCrypto ECDSA signers are now generated by one macro that decodes PKCS#8 into aSecretKeyand converts it to a signing key. ES256/ES384 output is unchanged (both old and new paths use RFC 6979).Tests use the RFC 7520 P-521 key (section 3.2) and the ES512 JWS (section 4.3).