Crates.io | ajtai |
lib.rs | ajtai |
version | 0.1.1 |
source | src |
created_at | 2025-01-19 16:51:02.417725+00 |
updated_at | 2025-01-19 17:10:23.019522+00 |
description | A no-std implementation of the Ajtai commitment scheme. |
homepage | |
repository | https://github.com/autoparallel/ajtai |
max_upload_size | |
id | 1522987 |
size | 54,540 |
A no-std implementation of the Ajtai commitment scheme with compile-time parameter validation and target-specific optimizations.
This library provides a high-performance implementation of cyclic/negacyclic convolution over finite fields using the Number Theoretic Transform (NTT), primarily targeting the Ajtai commitment scheme and other lattice-based cryptographic constructions.
no-std
compatibleAdd to your Cargo.toml
:
[dependencies]
ajtai = "0.1.0"
Basic example:
use ajtai::ring::{CyclotomicRing, StandardBasis};
use ff::PrimeField;
[derive(PrimeField)]
[PrimeFieldModulus = "17"]
[PrimeFieldGenerator = "3"]
[PrimeFieldReprEndianness = "little"]
pub struct ExampleField([u64; 1]);
// Create polynomials in Z[X]/(X^8 + 1)
let a = CyclotomicRing::<ExampleField, 8, 8, StandardBasis>::new([1, 1, 0, 0, 0, 0, 0, 0]);
let b = CyclotomicRing::<ExampleField, 8, 8, StandardBasis>::new([0, 0, 1, 0, 0, 0, 0, 0]);
// Multiply using NTT
let c = a * b;
The library implements fast polynomial multiplication in cyclotomic rings Z[X]/(X^n + 1) using the Number Theoretic Transform (NTT). Key components include:
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.