| Crates.io | tfhe-csprng |
| lib.rs | tfhe-csprng |
| version | 0.7.0 |
| created_at | 2024-11-21 09:51:46.764224+00 |
| updated_at | 2025-09-24 13:10:49.647557+00 |
| description | Cryptographically Secure PRNG used in the TFHE-rs library. |
| homepage | https://zama.ai/ |
| repository | https://github.com/zama-ai/tfhe-rs |
| max_upload_size | |
| id | 1455970 |
| size | 184,965 |
This crate contains a fast Cryptographically Secure Pseudorandom 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 instruction rdseed and another one based on the Unix random device /dev/random the latter requires the user to provide a secret.
To execute the benchmarks on an x86_64 platform:
RUSTFLAGS="-Ctarget-cpu=native" cargo bench
This software is distributed under the BSD-3-Clause-Clear license. If you have any questions,
please contact us at hello@zama.ai.