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

Implement Covercrypt CCA #136

Merged
merged 6 commits into from
Jun 11, 2024
Merged

Implement Covercrypt CCA #136

merged 6 commits into from
Jun 11, 2024

Conversation

tbrezot
Copy link
Collaborator

@tbrezot tbrezot commented May 23, 2024

This PR implements Covercrypt CCA as described in the latest version of the Covercrypt paper.

Changes

  • ML-KEM (Kyber768 CCA) is used with AES256-GCM to build a post-quantum PKE that replaces Kyber-PKE CPA;
  • the MSK does not contain post-quantum keypairs anymore since kyber::SecretKey can extract the kyber::PublicKey from within itself;
  • for symmetry, only the ElGamal::Scalar is stored instead of the key-pair, this means that a boolean storing the activation status needs to be added (this information was previously contained by the presence of the elgamal::EcPoint);
  • the tag and output seed are generated from hashing both the encapsulated seed and the encapsulations (the eakem_hash! macro is removed);
  • a random order of the encapsulation is chosen by the encapsulator, the Encapsulation therefore replaces the HashSet by a Vec in order to conserve this order through serialization;
  • the EA trait was modified to reorder parameters in a more usual fashion and EA::decrypt now returns a Zeroizing<Vec<u8>> instead of a plain Vec<u8>.

Impact on performances and sizes

  • USK size significantly increases since it now stores both public and private Kyber CPA keys (both contained in the Kyber CCA private key);
  • decryption performs the FO transformation and therefore encrypt after each decryption;
  • since the tag is now generated by hashing all the encapsulations, more time will be spent hashing (one hybridized encapsulation is 1KB).

Note: The impact of the increased hashing time should be negligible and the encryption upon decryption should not be predominant. However, the benchmarks need to be added again in order to quantify the performance degradation.

Copy link

@Adamk93 Adamk93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly for me is good! I don't see anything to complain about.

Copy link
Contributor

@Manuthor Manuthor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

Could you please:

@tbrezot tbrezot merged commit c5499e5 into feat/check_ap_homogeneity Jun 11, 2024
7 checks passed
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.

3 participants