Repository Public Apache-2.0
1// =============================================================================2// SP BOUCHER | SOFTWARE & RESEARCH3// ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING4// =============================================================================5//6// Project : SPB Quantum Crypto7// File : crates/spb-pqc-core/src/math/mod.rs8// Module : Crates9// Repository : https://git.spboucher.ai/spb-quantum-crypto10// Project Website : https://pqce.spboucher.ai11// Created : 2026-12-0312// Last Modified : 2026-12-0313//14// Author : Simon-Pierre Boucher15// Position : Professor of Finance16// Institution : Université du Québec en Outaouais (UQO)17// Organization : SP Boucher18// Website : https://spboucher.ai19// Git : https://git.spboucher.ai20//21// Preferred Contact: contact@spboucher.ai22// Development : dev@spboucher.ai23// Support : support@spboucher.ai24// Security/Admin : admin@spboucher.ai25//26// Copyright (c) 202627// Simon-Pierre Boucher28// All rights reserved where applicable. This file is governed by the29// applicable project license, copyright notices and relevant law.30// Existing third-party rights and notices remain unaffected.31//32// License : Apache-2.033//34// Do not embed credentials, private keys, access tokens,35// certificates or confidential personal information.36//37// =============================================================================38// END OF SP BOUCHER SOURCE HEADER39// =============================================================================4041//! Integer arithmetic for the two lattice standards.42//!43//! The two rings share the shape `Z_q[X]/(X^256 + 1)` but nothing else:44//!45//! | | [`mlkem`] (FIPS 203) | [`mldsa`] (FIPS 204) |46//! |---|---|---|47//! | modulus `q` | 3329 (12 bits) | 8380417 (23 bits) |48//! | root of unity | ζ = 17, primitive **256th** root | ζ = 1753, primitive **512th** root |49//! | NTT depth | 7 layers, degree-1 residues (pairs) | 8 layers, fully split |50//! | product in NTT domain | 128 products modulo `X² − γ` | 256 pointwise products |51//! | reduction | Barrett, canonical `[0, q)` | Montgomery (`R = 2³²`), signed lazy |52//!53//! They are therefore implemented separately; no code is shared between them.54//! `unsafe` is denied in this module tree.55#![deny(unsafe_code)]5657pub mod mldsa;58pub mod mlkem;59