Skip to content
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

Allow signing and verifying by hash #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Allow signing and verifying by hash #29

wants to merge 1 commit into from

Conversation

mkj
Copy link

@mkj mkj commented Sep 23, 2022

I have a need to sign and verify messages that are not contiguous in memory. These added methods allow that, with a user provided closure providing the hash of the message.

The use case is that I am serializing a message on-the-fly from parts to sign or verify, without copying it into a contiguous buffer. I have implemented DynDigest so that the user provided functions can more easily use Salty's sha512.

This allows signing a message which isn't contiguous in memory,
using normal (not prehashed) ed25519.

A test for the new methods is added.
@mkj
Copy link
Author

mkj commented Mar 29, 2023

I've noticed a pull request for a similar feature in ed25519-dalek, though that API would only work for verification not signing (signing needs the hash twice whereas verification only needs one pass). dalek-cryptography/ed25519-dalek#196
Just in case anyone's thinking of common APIs.

@nickray
Copy link
Member

nickray commented Apr 6, 2023

Interesting choice of API, I like it!

I was previously thinking of something along the lines of https://doc.rust-lang.org/std/io/trait.Read.html#method.read_vectored (to have precedent), that is, passing a slice of slices.

There is movement in the Dalek repos, a long term goal would be to merge this library as a backend there so I no longer have to maintain it :)

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