rfc6979: add generate_k_mut; remove digest bounds#773
Merged
Conversation
Adds an API which writes `k` into an output buffer rather than allocating and returning it, which also accepts slices as inputs. This makes it possible to use `rfc6979` to implement the `dsa` crate. Also removes output size bounds on the underlying digest function, which aren't actually relevant to the implementation at all since HMAC-DRBG writes a variable-sized amount of output. This makes it possible to use `rfc6979` + `ecdsa` in conjunction with `p521`, which has unusually sized scalars (66-bytes) which don't match the output size of the underlying digest function (SHA-512, which has a 64-byte output).
0948c21 to
509b92b
Compare
tarcieri
added a commit
to RustCrypto/elliptic-curves
that referenced
this pull request
Jan 16, 2024
Now that RustCrypto/signatures#773 and RustCrypto/signatures#774 have landed it should be possible to use the upstream RFC6979 implementation from the `ecdsa` crate in conjunction with `p521`, which uses a Digest with a 64-byte output, but uses 66-byte field elements. However, we're currently failing to match RFC6979 test vectors.
tarcieri
added a commit
to RustCrypto/elliptic-curves
that referenced
this pull request
Jan 16, 2024
Now that RustCrypto/signatures#773 and RustCrypto/signatures#774 have landed it should be possible to use the upstream RFC6979 implementation from the `ecdsa` crate in conjunction with `p521`, which uses a Digest with a 64-byte output, but uses 66-byte field elements. However, we're currently failing to match RFC6979 test vectors.
This was referenced Jan 17, 2024
tarcieri
added a commit
to RustCrypto/elliptic-curves
that referenced
this pull request
Jan 17, 2024
Now that RustCrypto/signatures#773 and RustCrypto/signatures#774 have landed it should be possible to use the upstream RFC6979 implementation from the `ecdsa` crate in conjunction with `p521`, which uses a Digest with a 64-byte output, but uses 66-byte field elements.
tarcieri
added a commit
to RustCrypto/elliptic-curves
that referenced
this pull request
Jan 17, 2024
Now that RustCrypto/signatures#773 and RustCrypto/signatures#774 have landed it should be possible to use the upstream RFC6979 implementation from the `ecdsa` crate in conjunction with `p521`, which uses a Digest with a 64-byte output, but uses 66-byte field elements.
Merged
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.
Adds an API which writes
kinto an output buffer rather than allocating and returning it, which also accepts slices as inputs. This makes it possible to userfc6979to implement thedsacrate.Also removes output size bounds on the underlying digest function, which aren't actually relevant to the implementation at all since HMAC-DRBG writes a variable-sized amount of output. This makes it possible to use
rfc6979+ecdsain conjunction withp521, which has unusually sized scalars (66-bytes) which don't match the output size of the underlying digest function (SHA-512, which has a 64-byte output).