-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add StreamVerifier #542
Add StreamVerifier #542
Conversation
ad3c67f
to
230a842
Compare
230a842
to
11a97dc
Compare
Why not a function that takes
Source: https://docs.rs/blake3/latest/blake3/struct.Hasher.html#method.update |
That requires
I thought we had something like that already but now I can't find it, so maybe we need to add something. |
11a97dc
to
e44e614
Compare
Maybe silly question: isn't this what prehashed signatues are for? Or is this in a setting where you don't have control over what the sender does? |
Yea exactly, my particular use case is Discord Webhooks. There's some relevant discussion in the old PR. |
Will rebase after CI fixes here: #543 |
Ok then I like this! One thing to avoid code duplication: do you think you could move the current |
Awesome 👍🏻
I've had a go but having trouble doing in a way that actually reduces code. From my limited knowledge of recent refactors, problem seems to be that |
Ah np. I'll take a crack at it |
I've pushed #556 which builds on |
fwiw - embedded folk seems to be fan of a trait that works in but yeah that would be fragmented impl and further complicate things with endless permutations |
e44e614
to
3d90368
Compare
3d90368
to
ddefde3
Compare
Context
In web applications, it is desirable to avoid storing the request payload. It is currently impossible to verify a signature based on a request payload that is receieved in a chunk stream without allocating additional memory equal to the size of the payload.
Solution
A stateful type that holds the public key, candidate signature, and hash state that can be updated incrementally.
References
StreamVerifier
ed25519-dalek#196