mirror of
https://github.com/arnaucube/ark-curves-cherry-picked.git
synced 2026-01-27 14:13:46 +01:00
BigInt fixes corresponding to algebra#372
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
use ark_ff::{biginteger::BigInteger256 as BigInteger, field_new, fields::*};
|
||||
use ark_ff::{
|
||||
biginteger::{BigInt, BigInteger256 as BigInteger},
|
||||
field_new,
|
||||
fields::*,
|
||||
};
|
||||
|
||||
pub type Fq = Fp256<FqParameters>;
|
||||
|
||||
@@ -11,7 +15,7 @@ impl FftParameters for FqParameters {
|
||||
const TWO_ADICITY: u32 = 1;
|
||||
|
||||
#[rustfmt::skip]
|
||||
const TWO_ADIC_ROOT_OF_UNITY: BigInteger = BigInteger([
|
||||
const TWO_ADIC_ROOT_OF_UNITY: BigInteger = BigInt::new([
|
||||
0x68c3488912edefaa,
|
||||
0x8d087f6872aabf4f,
|
||||
0x51e1a24709081231,
|
||||
@@ -21,7 +25,7 @@ impl FftParameters for FqParameters {
|
||||
impl FpParameters for FqParameters {
|
||||
/// MODULUS = 21888242871839275222246405745257275088696311157297823662689037894645226208583
|
||||
#[rustfmt::skip]
|
||||
const MODULUS: BigInteger = BigInteger([
|
||||
const MODULUS: BigInteger = BigInt::new([
|
||||
0x3c208c16d87cfd47,
|
||||
0x97816a916871ca8d,
|
||||
0xb85045b68181585d,
|
||||
@@ -35,7 +39,7 @@ impl FpParameters for FqParameters {
|
||||
const REPR_SHAVE_BITS: u32 = 2;
|
||||
|
||||
#[rustfmt::skip]
|
||||
const R: BigInteger = BigInteger([
|
||||
const R: BigInteger = BigInt::new([
|
||||
0xd35d438dc58f0d9d,
|
||||
0x0a78eb28f5c70b3d,
|
||||
0x666ea36f7879462c,
|
||||
@@ -43,7 +47,7 @@ impl FpParameters for FqParameters {
|
||||
]);
|
||||
|
||||
#[rustfmt::skip]
|
||||
const R2: BigInteger = BigInteger([
|
||||
const R2: BigInteger = BigInt::new([
|
||||
0xf32cfc5b538afa89,
|
||||
0xb5e71911d44501fb,
|
||||
0x47ab1eff0a417ff6,
|
||||
@@ -54,7 +58,7 @@ impl FpParameters for FqParameters {
|
||||
|
||||
// GENERATOR = 3
|
||||
#[rustfmt::skip]
|
||||
const GENERATOR: BigInteger = BigInteger([
|
||||
const GENERATOR: BigInteger = BigInt::new([
|
||||
0x7a17caa950ad28d7,
|
||||
0x1f6ac17ae15521b9,
|
||||
0x334bea4e696bd284,
|
||||
@@ -62,7 +66,7 @@ impl FpParameters for FqParameters {
|
||||
]);
|
||||
|
||||
#[rustfmt::skip]
|
||||
const MODULUS_MINUS_ONE_DIV_TWO: BigInteger = BigInteger([
|
||||
const MODULUS_MINUS_ONE_DIV_TWO: BigInteger = BigInt::new([
|
||||
0x9e10460b6c3e7ea3,
|
||||
0xcbc0b548b438e546,
|
||||
0xdc2822db40c0ac2e,
|
||||
@@ -74,7 +78,7 @@ impl FpParameters for FqParameters {
|
||||
// T = (MODULUS - 1) // 2^S =
|
||||
// 10944121435919637611123202872628637544348155578648911831344518947322613104291
|
||||
#[rustfmt::skip]
|
||||
const T: BigInteger = BigInteger([
|
||||
const T: BigInteger = BigInt::new([
|
||||
0x9e10460b6c3e7ea3,
|
||||
0xcbc0b548b438e546,
|
||||
0xdc2822db40c0ac2e,
|
||||
@@ -84,7 +88,7 @@ impl FpParameters for FqParameters {
|
||||
// (T - 1) // 2 =
|
||||
// 5472060717959818805561601436314318772174077789324455915672259473661306552145
|
||||
#[rustfmt::skip]
|
||||
const T_MINUS_ONE_DIV_TWO: BigInteger = BigInteger([
|
||||
const T_MINUS_ONE_DIV_TWO: BigInteger = BigInt::new([
|
||||
0x4f082305b61f3f51,
|
||||
0x65e05aa45a1c72a3,
|
||||
0x6e14116da0605617,
|
||||
|
||||
Reference in New Issue
Block a user