lattice_commitments/lib.rs
1//! lattice-commitments [](https://dl.circleci.com/status-badge/redirect/gh/chancehudson/lattice-commitments/tree/main) [](https://docs.rs/lattice-commitments) [](https://crates.io/crates/lattice-commitments)
2//!
3//! Structured lattice commitments based on [Baum et al.](https://eprint.iacr.org/2016/997.pdf)
4use ring_math::polynomial_ring;
5use ring_math::Polynomial;
6use ring_math::PolynomialRingElement;
7use scalarff::scalar_ring;
8use scalarff::FieldElement;
9
10pub mod commitment;
11
12pub use commitment::Vcs;
13
14scalar_ring!(BabyBearRingElement, 2013265921, "baby bear 32 bit");
15
16const RING_DEGREE: usize = 1024;
17
18polynomial_ring!(
19 FieldPolynomial,
20 BabyBearRingElement,
21 {
22 let mut p = Polynomial::identity();
23 p.term(&BabyBearRingElement::one(), RING_DEGREE);
24 p
25 },
26 "% x^RING_DEGREE + 1"
27);