nautilus_lighter/signing/field/mod.rs
1// -------------------------------------------------------------------------------------------------
2// Copyright (C) 2015-2026 Nautech Systems Pty Ltd. All rights reserved.
3// https://nautechsystems.io
4//
5// Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
6// You may not use this file except in compliance with the License.
7// You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14// -------------------------------------------------------------------------------------------------
15
16//! Field arithmetic underpinning Lighter's L2 signing scheme.
17//!
18//! - [`Fp`] is the Goldilocks prime field `GF(p)` with `p = 2^64 - 2^32 + 1`.
19//! - [`Fp5`] is the quintic extension `GF(p^5)`, defined over [`Fp`] with the
20//! irreducible polynomial `z^5 - 3`.
21//!
22//! Both types expose constant-time arithmetic and canonical little-endian byte
23//! encodings, suitable for direct reuse from the Poseidon2 hash and the ecgfp5
24//! curve layers built on top.
25
26mod goldilocks;
27mod quintic;
28
29pub use goldilocks::{Fp, MODULUS};
30pub use quintic::Fp5;