Open benma opened 1 month ago
The FixedOutput
change might be possible.
It's somewhat complicated by the nature of Ed25519, which does two passes over the input message rather than one, as a mechanism for preventing collisions in the underlying hash function from breaking the construction.
If you're looking for an API similar to signature algorithms like RSASSA or ECDSA which simply accept a message hash to compute a signature over, Ed25519 simply doesn't work that way. There's a related construction, Ed25519ph, which does, however it's a separate construction and you can't verify an Ed25519ph signature using Ed25519.
https://docs.rs/ed25519-dalek/latest/ed25519_dalek/hazmat/fn.raw_sign_prehashed.html
I want to simply pass my pre-hashed message that is a
[u8; 64]
. I had to open the source code to realize currently,.finalize()
is called on theMsgDigest
to exctract it, making this function needlessly hard to use if I don't have Digest implementation.Could you consider simply changing the
prehashed_message
to be of type[u8; 64]
?Or use the more narrow trait
FixedOutput
instead ofDigest
: https://docs.rs/digest/latest/digest/trait.FixedOutput.html