9 releases

0.4.1 Jun 28, 2024
0.4.0 Oct 12, 2023
0.3.0 Feb 9, 2023
0.2.2 Oct 21, 2022
0.1.6 Mar 25, 2021

#294 in Cryptography

Download history 1163/week @ 2024-10-07 1066/week @ 2024-10-14 1768/week @ 2024-10-21 671/week @ 2024-10-28 1268/week @ 2024-11-04 697/week @ 2024-11-11 946/week @ 2024-11-18 995/week @ 2024-11-25 1720/week @ 2024-12-02 1243/week @ 2024-12-09 1344/week @ 2024-12-16 639/week @ 2024-12-23 960/week @ 2024-12-30 1160/week @ 2025-01-06 1007/week @ 2025-01-13 997/week @ 2025-01-20

4,134 downloads per month
Used in 9 crates (2 directly)

BSD-3-Clause-Clear

140KB
2.5K SLoC

Concrete CSPRNG

This crate contains a fast Cryptographically Secure Pseudoramdon Number Generator, used in the TFHE-rs library, you can find it here in this repo.

The implementation is based on the AES blockcipher used in CTR mode, as described in the ISO/IEC 18033-4 standard.

Two implementations are available, an accelerated one on x86_64 CPUs with the aes feature and the sse2 feature, and a pure software one that can be used on other platforms.

The crate also makes two seeders available, one needing the x86_64 feature rdseed and another one based on the Unix random device /dev/random the latter requires the user to provide a secret.

Running the benchmarks

To execute the benchmarks on an x86_64 platform:

RUSTFLAGS="-Ctarget-cpu=native" cargo bench --features=seeder_x86_64_rdseed,generator_x86_64_aesni 

License

This software is distributed under the BSD-3-Clause-Clear license. If you have any questions, please contact us at hello@zama.ai.

Dependencies

~0.5–0.9MB
~19K SLoC