Revamping Ferveo Ciphertexts (breaking changes ⚠️ )#149
Revamping Ferveo Ciphertexts (breaking changes ⚠️ )#149KPrasch merged 7 commits intonucypher:mainfrom
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 |
* 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? |
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:
Ciphertextimplementation.construct_tag_hashandCiphertext.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: