-
Notifications
You must be signed in to change notification settings - Fork 10
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
Revamping Ferveo Ciphertexts (breaking changes ⚠️ ) #149
Conversation
7a90b1a
to
1c814b8
Compare
Codecov Report
@@ Coverage Diff @@
## main #149 +/- ##
==========================================
+ Coverage 77.96% 78.40% +0.43%
==========================================
Files 23 23
Lines 4979 4969 -10
==========================================
+ Hits 3882 3896 +14
+ Misses 1097 1073 -24
|
The error on CI is unrelated to this PR. In order to fix it, bump MSRV to |
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.
LGTM 🎉
(I realize this is WIP, please feel free to re-request a review anytime)
* Remove unused Ciphertext.construct_tag_hash() * Refactor Ciphertext.check() to take the functionality of check_ciphertext_validity() function
@cygnusv, so #[serde_as(as = "serialization::SerdeAs")]
pub commitment: E::G1Affine,
// W
#[serde_as(as = "serialization::SerdeAs")]
pub auth_tag: E::G2Affine,
// V
#[serde(with = "serde_bytes")]
pub ciphertext: Vec<u8>, So from a |
Yeah, good question. For the request you only need the commitment, the auth_tag, and the hash of the symmetric ciphertext. BTW, I'm not sure the term Kem/Dem is technically correct once we introduce the hash of the Dem, but I don't have a better suggestion for the moment. |
@cygnusv, 👍 thanks for the clarification. Could we do a quick chat about this whenever you are around? |
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.
🎸
Type of PR:
Required reviews:
What this does:
Some of the changes introduced by this PR, all of them related with how ciphertexts are produced and used:
Ciphertext
implementation.construct_tag_hash
andCiphertext.check()
#144Apart from this, bumps MSRV to 1.67.0, and associated clippy changes.
Why it's needed:
@jMyles and @KPrasch identified an important limitation of current ciphertexts and TDec requests construction. Essentially, the TDec request included the full ciphertext, which implies a big overhead even for relatively small media files (e.g. short audio clips). The main goal of this PR was to decouple the bulk of symmetric ciphertext from the validation procedure, using a hash instead. This enables very small TDec requests ( see #147). In the nucypher side, will allow to close nucypher/nucypher#3176 via nucypher/nucypher#3194
Notes for reviewers: