Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ tooling/provekit-wasm/pkg/*
# logs for passport circuit benchmarks
noir-examples/noir-passport/merkle_age_check/benchmark-inputs/logs/
.omx/

# Python bytecode
__pycache__/
*.pyc
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ members = [
"skyscraper/hla",
"skyscraper/bn254-multiplier",
"skyscraper/bn254-multiplier-codegen",
"skyscraper/bn254-multiplier-constants",
"skyscraper/core",
"provekit/common",
"provekit/backend/bn254",
Expand Down Expand Up @@ -93,6 +94,7 @@ opt-level = 3
# Workspace members - Skyscraper
bn254-multiplier = { path = "skyscraper/bn254-multiplier" }
bn254-multiplier-codegen = { path = "skyscraper/bn254-multiplier-codegen" }
bn254-multiplier-constants = { path = "skyscraper/bn254-multiplier-constants" }
fp-rounding = { path = "skyscraper/fp-rounding" }
hla = { path = "skyscraper/hla" }
skyscraper = { path = "skyscraper/core" }
Expand Down
1 change: 1 addition & 0 deletions ntt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ark-bn254.workspace = true
ark-ff.workspace = true
rayon.workspace = true
bn254-multiplier.workspace = true
bn254-multiplier-constants.workspace = true

[dev-dependencies]
divan.workspace = true
Expand Down
7 changes: 2 additions & 5 deletions ntt/src/b51_interleaved.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ use {
crate::{define_ntt, extend_roots_table},
ark_bn254::Fr,
bn254_multiplier::{
constants::{self, U64_P_MULTIPLES},
rne,
utils::{self, addv, div_p_2b, subtraction_reduce},
},
bn254_multiplier_constants::U64_P_MULTIPLES,
rayon::iter::{IntoParallelRefMutIterator, ParallelIterator},
std::mem,
};
Expand All @@ -31,10 +31,7 @@ fn b51_kernel(even: &mut [u64; 4], odd: &mut [u64; 4], omega: &[u64; 4]) {
// creating our invariant
let f = rne::mono::mul(*odd, *omega);
let l = subtraction_reduce(div_p_2b, addv(*even, f));
let r = subtraction_reduce(
div_p_2b,
addv(*even, utils::sub(constants::U64_P_MULTIPLES[3], f)),
);
let r = subtraction_reduce(div_p_2b, addv(*even, utils::sub(U64_P_MULTIPLES[3], f)));
(*even, *odd) = (l, r);
}

Expand Down
1 change: 1 addition & 0 deletions skyscraper/bn254-multiplier-codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ repository.workspace = true

[dependencies]
# Workspace crates
bn254-multiplier-constants.workspace = true
hla.workspace = true

[lints]
Expand Down
37 changes: 3 additions & 34 deletions skyscraper/bn254-multiplier-codegen/src/constants.rs
Original file line number Diff line number Diff line change
@@ -1,39 +1,8 @@
// -- [Scalar CONSTANTS] -- //

pub const U64_P: [u64; 4] = [
0x43e1f593f0000001,
0x2833e84879b97091,
0xb85045b68181585d,
0x30644e72e131a029,
];

pub const U64_2P: [u64; 4] = [
0x87c3eb27e0000002,
0x5067d090f372e122,
0x70a08b6d0302b0ba,
0x60c89ce5c2634053,
];

pub const U64_I1: [u64; 4] = [
0x2d3e8053e396ee4d,
0xca478dbeab3c92cd,
0xb2d8f06f77f52a93,
0x24d6ba07f7aa8f04,
];
pub const U64_I2: [u64; 4] = [
0x18ee753c76f9dc6f,
0x54ad7e14a329e70f,
0x2b16366f4f7684df,
0x133100d71fdf3579,
];

pub const U64_I3: [u64; 4] = [
0x9bacb016127cbe4e,
0x0b2051fa31944124,
0xb064eea46091c76c,
0x2b062aaa49f80c7d,
];
pub const U64_MU0: u64 = 0xc2e1f593efffffff;
pub use bn254_multiplier_constants::{
I1_LIMB, I2_LIMB, I3_LIMB, MU0_LIMB, P_LIMB, U64_2P, U64_I1, U64_I2, U64_I3, U64_MU0, U64_P,
};

// -- [FP SIMD CONSTANTS] -- //

Expand Down
Loading
Loading