Skip to content

Conversation

@daxpedda
Copy link
Contributor

Companion PR to RustCrypto/traits#2004.

@daxpedda
Copy link
Contributor Author

Looking into how this would work for ML-DSA, because it uses a custom SHAKE wrapper internally that doesn't implement Digest.

@daxpedda
Copy link
Contributor Author

So the wrapper isn't necessary to compute µ, we can use Shake256 for D here.
The problem is just that DigestSigner requires Digest, so what do you think about removing that requirement?
Individual implementations can still require it separately.

@tarcieri
Copy link
Member

@daxpedda the only digest-related functionality that's really needed by the caller now is Update, so you can change it to that

@tarcieri
Copy link
Member

@daxpedda want to try it out with ml-dsa external mu or save that for another PR?

@daxpedda
Copy link
Contributor Author

daxpedda commented Sep 12, 2025

Working on it right now.
Just adding a test actually.

&self,
f: F,
) -> Result<Signature<P>, Error> {
let mut digest = Shake256::default().chain(self.tr).chain([0, 0]);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, we should just call a method on SigningKey here so we don't duplicate the internals.

I could change SigningKey::raw_sign_deterministic() to take a Fn instead as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I did try this in daxpedda@2c77bab.
I believe my attempt ended up being quite awful.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daxpedda could you extract some methods, one to do setup and one to do finalization? Kind of like what you proposed in RustCrypto/traits#2004 but to abstract over the internals for computing Shake256

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #1073.

@tarcieri tarcieri merged commit 923fe6f into RustCrypto:master Sep 13, 2025
76 checks passed
@tarcieri
Copy link
Member

@daxpedda mind doing a PR for https://github.com/RustCrypto/elliptic-curves too?

@daxpedda
Copy link
Contributor Author

@daxpedda mind doing a PR for https://github.com/RustCrypto/elliptic-curves too?

Will do!

ackintosh added a commit to ackintosh/enr that referenced this pull request Oct 4, 2025
`try_sign_digest_with_rng` and `verify_digest` have been updated in
RustCrypto/signatures#1064
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 this pull request may close these issues.

2 participants