starkom_goldilocks/lib.rs
1// Copyright 2026 The Libernet Team
2// SPDX-License-Identifier: Apache-2.0
3
4#![doc = include_str!("../README.md")]
5
6mod helpers;
7
8pub mod base;
9pub mod gl2;
10pub mod gl4;
11
12pub use base::Scalar as GL;
13pub use gl2::Scalar as GL2;
14pub use gl4::Scalar as GL4;
15
16/// The order of the Goldilocks field, `0xffffffff00000001`.
17pub const MODULUS: u64 = helpers::MODULUS;
18
19/// The quadratic non-residue used to build the extension: `X^2 = QUADRATIC_NON_RESIDUE` in the base
20/// field.
21pub const QUADRATIC_NON_RESIDUE: u64 = helpers::QUADRATIC_NON_RESIDUE;
22
23/// Alias for [`GL::from_const`].
24#[inline(always)]
25pub const fn from_const(value: u64) -> GL {
26 GL::from_const(value)
27}