-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When encapsulating, only call key_gen() for EC algorithms (#50)
* Small change to how invert_ntt is called in ind_cpa::encrypt.
- Loading branch information
Showing
3 changed files
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use libcrux::digest; | ||
use libcrux::drbg::Drbg; | ||
use libcrux::kem; | ||
|
||
fn main() { | ||
let mut drbg = Drbg::new(digest::Algorithm::Sha256).unwrap(); | ||
let (_secret_key, public_key) = kem::key_gen(kem::Algorithm::Kyber768, &mut drbg).unwrap(); | ||
|
||
for _i in 0..100000 { | ||
let (_shared_secret, _ciphertext) = | ||
kem::encapsulate(kem::Algorithm::Kyber768, &public_key, &mut drbg).unwrap(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters