| Crates.io | cralgebra |
| lib.rs | cralgebra |
| version | 0.2.1 |
| created_at | 2025-08-30 16:23:44.259201+00 |
| updated_at | 2025-09-08 18:31:28.600178+00 |
| description | A fast crypto algebra library |
| homepage | |
| repository | https://github.com/aerkiaga/cralgebra |
| max_upload_size | |
| id | 1817746 |
| size | 183,991 |
A fast crypto algebra library.
The current version is to be considered unstable, and breaking changes are possible. New features and fixes will be added in small incremental releases.
| Feature | Completion | Optimization |
|---|---|---|
| Modular arithmetic | ✅ | ✅ |
| Big integers | ⚡ | ❌ |
| Cyclotomic polynomials | ⚡ | ❌ |
| Primality testing | ⚡ | ⚡ |
| Uniform sampling | ⚡ | ✅ |
| Discrete Gaussian sampling | ⚡ | ✅ |
"Complete" optimization here refers to using optimal algorithms. SIMD and/or inline assembly may also be considered in the future.
See the documentation.
Run this to measure latencies for different operations:
cargo run --example bench --release
This Cargo.toml configuration is recommended for maximum performance:
[profile.release]
opt-level = 3
debug-assertions = false
overflow-checks = false
lto = true
panic = 'unwind'
incremental = false
codegen-units = 1
rpath = false
Further tips:
MontgomeryDyn instead of ModularDyn if doing multiple operations in series, containing multiplications.