-
Notifications
You must be signed in to change notification settings - Fork 111
[cryptography] Refactor Scheme
#991
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
Conversation
cryptography/src/lib.rs
Outdated
| message: &[u8], | ||
| public_key: &Self::PublicKey, | ||
| signature: &Self::Signature, | ||
| public_key: &K::PublicKey, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we may be able to get away with impl PublicKey and impl Signature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose they should be fixed for a single instance of a BatchVerfier (so maybe we should make both generic)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow. We can't put impl PublicKey / impl Signature because a BatchVerifier is parameterized on a PublicKey type, so it can only verify using its PublicKey type and associated Signature.
Scheme
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #991 +/- ##
==========================================
- Coverage 91.18% 91.09% -0.10%
==========================================
Files 191 191
Lines 54967 54836 -131
==========================================
- Hits 50124 49954 -170
- Misses 4843 4882 +39
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Resolves: #755
Resolves: #1049
Unblocks: #432
This PR updates the cryptography traits defined in
cryptography/src/lib.rs. Notably, it removesSpecificationandScheme. The new crypto design has several interlocking traits:Signeris capable of producing a signature over a messageVerifieris capable of verifying a signature over a messagePrivateKeyis aSignerthat is serializable and had aPublicKeyPublicKeyis aVerifierthat is serializableThe vast majority of the diff is updating downstream code. There are also many generic types
C: Scheme(Schemein the old code is most analogous toPrivateKeyin the new code) that have been turned intoC: PublicKeybecause they don't rely on private key capabilities.