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

11 adding post quantum support #16

Merged
merged 14 commits into from
Jan 30, 2025
Merged

Conversation

Nichokas
Copy link
Owner

This pull request introduces several changes to the codebase, focusing on adding new dependencies, updating benchmarks, and modifying encryption and key exchange functionalities. The most important changes include the addition of new dependencies, the creation of new benchmark files for kyber and chacha, and significant modifications to the encryption and key exchange implementations.

New Dependencies:

  • Added kyberlib, rand, and zerocopy to Cargo.toml to support new cryptographic functionalities.

Benchmark Updates:

  • Created new benchmark file benches/chacha_bench.rs to benchmark ChaCha20-Poly1305 key derivation, encryption, and decryption.
  • Created new benchmark file benches/kyber_bench.rs to benchmark Kyber keypair generation, encapsulation, decapsulation, and full encryption/decryption.
  • Removed old benchmark files benches/encryption.rs and benches/key_exchange.rs which were based on x25519-dalek. [1] [2]

Encryption and Key Exchange Modifications:

  • Modified src/encryption.rs to use anyhow for error handling and updated the encryption function to remove unnecessary mut keyword. [1] [2]
  • Updated src/key_exchange.rs to replace x25519-dalek with Kyber for key exchange and added new structures for client and server handshakes.
  • Updated src/lib.rs to integrate Kyber-based encryption and decryption, replacing the previous x25519-dalek-based implementation.

Documentation:

  • Updated the README.md file to reflect changes in the CodSpeed Badge URL.

Main File:

  • Added a new src/main.rs file to generate and verify encrypted data using the new Kyber-based encryption scheme.

@Nichokas Nichokas added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Jan 29, 2025
@Nichokas Nichokas added this to the v0.1.0 milestone Jan 29, 2025
@Nichokas Nichokas self-assigned this Jan 29, 2025
@Nichokas Nichokas linked an issue Jan 29, 2025 that may be closed by this pull request
2 tasks
Copy link

codspeed-hq bot commented Jan 29, 2025

CodSpeed Performance Report

Merging #16 will create unknown performance changes

Comparing 11-adding-post-quantum-support (7784a9e) with master (431adb7)

Summary

🆕 18 new benchmarks
⁉️ 4 dropped benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 decrypt_1024B N/A 17.8 µs N/A
🆕 decrypt_128B N/A 14.2 µs N/A
🆕 decrypt_16B N/A 13.1 µs N/A
🆕 decrypt_4096B N/A 26.3 µs N/A
🆕 encrypt_1024B N/A 17.4 µs N/A
🆕 encrypt_128B N/A 14.4 µs N/A
🆕 encrypt_16B N/A 13.5 µs N/A
🆕 encrypt_4096B N/A 26.1 µs N/A
🆕 chacha_key_derivation N/A 553.9 ns N/A
⁉️ decryption 296 µs N/A N/A
⁉️ encryption 394.4 µs N/A N/A
⁉️ derive_chacha_key 17.3 µs N/A N/A
⁉️ generate_ephemeral_keypair 103.1 µs N/A N/A
🆕 kyber_decapsulation N/A 233.4 µs N/A
🆕 kyber_encapsulation N/A 240.7 µs N/A
🆕 full_decryption_long N/A 315.5 µs N/A
🆕 full_decryption_medium N/A 286.5 µs N/A
🆕 full_decryption_short N/A 276 µs N/A
🆕 full_encryption_long N/A 328.7 µs N/A
🆕 full_encryption_medium N/A 291.1 µs N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

@Nichokas
Copy link
Owner Author

Performance does not apply its a security fix that obviously its going to use more resources

@Nichokas Nichokas merged commit 9d39094 into master Jan 30, 2025
4 of 5 checks passed
@Nichokas Nichokas deleted the 11-adding-post-quantum-support branch January 30, 2025 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
1 participant