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 a Fully Homomorphic Version of the AES-128 Cryptosystem using TFHE-rs #135

Open
zaccherinij opened this issue Dec 6, 2024 · 0 comments

Comments

@zaccherinij
Copy link
Collaborator

zaccherinij commented Dec 6, 2024

Overview

The goal of this bounty is to implement a homomorphic version of the AES-128 cryptosystem using the TFHE-rs library. The primary focus of the implementation should be on performance optimization. The implementation is expected to consist of two main blocks: KeyExpansion and Encryption/Decryption. This split is motivated by the possibility of performing key expansion as an offline phase, which may not always be required for all use cases.

You are encouraged to utilize recent research results and optimization techniques. If new cryptographic primitives or parameters are introduced, they must ensure:

  • A failure probability for operations lower than 2^-64.
  • A security level of at least 2^128.

Alternatively, you may focus on achieving the fastest possible implementation using the existing parameter sets provided in TFHE-rs. If you decide to use the WoPBS primitives, the parameter sets might need adjustment to meet the requirements above, as the provided sets are only examples for an experimental feature.

What We Expect

We expect a complete FHE AES-128 implementation. For reference, you may consult:

  • The ISO/IEC 18033-4 standard.
  • The tfhe-csprng implementation.
  • Other Rust implementations of AES, such as the aes crate.

You are allowed to use any API from the TFHE-rs library. The implementation must:

  1. Be tested using standard test vectors as well as randomly generated test cases.
  2. Use the noise-asserts feature (available only in main). We recommend starting with the commit 38a7e4feef7d398b8e7a6f8f8d02e285855396ec
    or any later commit that includes bug fixes or performance improvements.

Additionally, you are required to provide a small executable that:

  • Takes as input a number of outputs, an IV, and a key.
  • Generates the requested number of AES values using a cleartext implementation (e.g., the aes crate) as a reference.
  • Produces the same values homomorphically in FHE, decrypts them, and verifies correctness.

Program Inputs

You can use the clap library to parse command-line flags. The program inputs should be named as follows:

  • --number-of-outputs
  • --iv
  • --key

Runtime Output

The executable must print FHE runtime details (excluding encryption and decryption times) in the following format:

AES key expansion took: {key_expansion_elapsed:?}
AES of #{number_of_outputs} outputs computed in: {elapsed:?}

The elapsed variables should be computed using std::time::Instant::elapsed() on the relevant start instant.

Additional Requirements

A README file must accompany the submission, explaining:

  • How to use the FHE implementation.
  • How to run the provided executable.

Benchmarking

All benchmarks will be conducted on an AWS hpc7a.96xlarge instance. When benchmarking, ensure that:

  • AVX512 is enabled by using the nightly-avx512 feature.
  • The implementation is compiled with a modern nightly toolchain.

Reward

🥇Best submission: up to $5,000

To be considered best submission, a solution must be efficient, effective and demonstrate a deep understanding of the core problem. Alongside the technical correctness, it should also be submitted with a clean code, clear explanations and a complete documentation.

🥈Second-best submission: up to $3,000

For a solution to be considered the second best submission, it should be both efficient and effective. The code should be neat and readable, while its documentation might not be as exhaustive as the best submission, it should cover the key aspects of the solution.

🥉Third-best submission: up to $2,000

The third best submission is one that presents a solution that effectively tackles the challenge at hand, even if it may have certain areas of improvement in terms of efficiency or depth of understanding. Documentation should be present, covering the essential components of the solution.

Register

Step 1: Registration

Click here to register for the fhEVM Bounty. Fill out the registration form with your information. Once you fill out the form, you will receive a confirmation email with a link to the submission portal for when you are ready to submit your code.

Note

Check your spam folder in case you don't receive the confirmation email. If you haven't received it within 24 hour, please contact us by email at [email protected].

Step 2: Work on the Challenge

Read through the Bounty details and requirements carefully. Use the provided resources and create your own GitHub repository to store your code.
If you have any questions during your work, feel free to comment directly in the Bounty issue and our team will be happy to assist you.

Step 3: Submission

Once you have completed your work, upload your completed work to the submission portal using the link provided in the confirmation email.

Note

The deadline for submission is February, 9th 2025 (23:59, Anywhere On Earth). Late submissions will not be considered.

We wish you the best of luck with the challenge!

Support

  • Comment on this issue with any questions regarding this bounty.
  • Email for private questions: [email protected]
  • Join the Zama community channels here.
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

No branches or pull requests

1 participant