73 releases (2 stable)
Uses new Rust 2024
| 1.1.0 | Jan 16, 2026 |
|---|---|
| 1.0.0 | Oct 23, 2025 |
| 0.50.0 | Jun 27, 2025 |
| 0.48.0 | Feb 11, 2025 |
| 0.7.2 | Nov 23, 2022 |
#60 in Math
1,991 downloads per month
Used in 13 crates
(6 directly)
1MB
16K
SLoC
twenty-first
A collection of cryptography primitives written in Rust.
Content of this library
This library contains primarily the following cryptographic primitives:
- The Tip5 hash function
- Lattice-crypto
- arithmetic for the quotient ring $\mathbb{F}_ p[X] / \langle X^{64} + 1 \rangle$
- arithmetic for modules over this quotient ring
- a IND-CCA2-secure key encapsulation mechanism
- Lattice-Based Cryptography in Miden VM
BFieldElement,XFieldElement- The prime-field type $\mathbb{F}_p$ where $p = 2^{64} - 2^{32} + 1$
- The extension field $\mathbb{F}_p[x]/(x^3 - x + 1)$
- A codec trait for encoding and decoding structs as
Vecs ofBFieldElement - An efficient prime for number-theoretic transforms
- NTT
- Number Theoretic Transform (discrete Fast Fourier Transform)
- Anatomy of a STARK, Part 6: Speeding Things Up
- Univariate polynomials
- Merkle Trees
- Merkle Mountain Ranges
Wasm support
The twenty-first library can be built for WebAssembly. See the dedicated readme for
further information.
Dependencies
~5–7MB
~120K SLoC