This commit is contained in:
Pascal Engélibert 2026-02-20 16:02:58 +01:00
commit 610cc4784a
5 changed files with 39 additions and 310 deletions

View file

@ -2,8 +2,6 @@
Modular arithmetic, polynomial quotient rings in Rust.
Early development, really.
Goals:
* Easy to use, obvious when you look at the documentation and type system
* Fast, most possible work is done at compile time
@ -13,12 +11,20 @@ Non-goals:
* Generic (it's generic but only for primitive types)
* Complete (it's simple because it's not a complete implementation of modern algebra)
* Dynamic (vector dimensions and moduli are strongly typed)
* Footgun-free (if you give incoherent arguments to the macros, it may produce unsafe code)
Supported:
* ring Zq
* ring Zq/(x^N+1) with additive operations
* ring Zq/(x^N+1) with multiplicative operations if q=p or q=2p with p prime and 2N divides p-1
* vectors and matrices of the above rings
* lift between different rings (see example ntwe) (lifting may lack some features or be unsafe)
**Warning**: There are some TODOs in the code. The code has not been audited nor proven. Please don't use it in production yet.
## Why
When implementing Dilithium and other similar lattice-based schemes, I found no crate that was both easy and fast, so I made one with the exact set of features I needed.
## Name
@ -28,7 +34,7 @@ Pronounce _grizienn_. It's Breton for "root", because we use roots of unity to c
[Support me via LiberaPay](https://liberapay.com/tuxmain/donate)
GNU AGPL v3, CopyLeft 2025 Pascal Engélibert [(why copyleft?)](https://txmn.tk/blog/why-copyleft/)
GNU AGPL v3, CopyLeft 2025-2026 Pascal Engélibert [(why copyleft?)](https://txmn.tk/blog/why-copyleft/)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.