Sign/verify by digest update, StreamVerifier refactoring #304
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.
I'd like to be able to sign/verify non-prehash signatures without the whole message in memory. The use case is for running on
no_std
embedded where the message is serialized directly into the sha512 digest. It's for SSH protocol so I can't use ed25519 prehashed.There's the existing work in #196 for
StreamVerifier
, but that can't be extended to signing since signing needs two passes. Instead I've addedraw_sign_byupdate()
andraw_verify_byupdate()
that take a closure to update the message digest.As suggested in #196 (comment) I've moved
recompute_R
into its own struct and madeStreamVerifier
use it too.Would something like this be reasonable to add? I'm open to other suggestions on how achieve the same thing.
(I only just noticed
ComputeR
is a bit of a silly looking name, that could change. Likewise_byupdate
isn't the best name, but other names I came up with would get confused with prehashed methods).