RFC: New facility for exposing "bundled signatures". #186
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.
Sometimes it's useful to save up one or more signatures and have
them verified later on. For example, in Arti, we sometimes want to
parse a large document containing many internal signatures, but save
the verification of the signatures for another thread. We can't
use precomputed hashes for this, since the protocol is already
specified. Thus, our only choice for now is to carry around the
original message--either by copy or by reference--until we're
ready to verify the signature on it.
With this patch, ed25519-dalek exposes a new type, BundledSignature.
A BundledSignature contains the public key, the InternalSignature,
and the scalar
k
needed to verify the signature against the message.To avoid code bloat and to reuse testing, it uses these objects
internally to implement signature verification. (According to
cargo bench
, there is no performance loss.)**
Please don't merge this yet. I'm marking this as a "RFC" branch for a few reasons:
First, it seems that my editor setup accidentally ran "cargo fmt" on a few of your files, and I assume you don't want that.
Second, I bet that you'll have comments on the naming and documentation, and I'd like to be responsive to those.
Third, once you think that the basic approach is reasonable, I'd like to add support for batch verification over BundledSignatures.
**
No hurry on the review here, BTW: I'm writing this for fun while I'm on vacation, and I hope you won't look at it until you also feel like it would be fun to look at some code.