repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/lib.rs
kzg/src/lib.rs
#![cfg_attr(not(feature = "std"), no_std)] extern crate alloc; use alloc::{borrow::ToOwned, string::String, vec::Vec}; use arbitrary::Arbitrary; use core::fmt::Debug; use msm::precompute::PrecomputationTable; pub mod common_utils; mod das; pub mod eip_4844; pub mod eth; pub mod msm; pub use das::{EcBackend, DAS}; ...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/eip_4844.rs
kzg/src/eip_4844.rs
#![allow(non_camel_case_types)] extern crate alloc; use crate::common_utils::reverse_bit_order; use crate::eth; use crate::eth::c_bindings::CKZGSettings; use crate::eth::FIELD_ELEMENTS_PER_EXT_BLOB; use crate::msm::precompute::PrecomputationTable; use crate::G1Affine; use crate::G1Fp; use crate::G1GetFp; use crate::G1...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
true
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/common_utils.rs
kzg/src/common_utils.rs
extern crate alloc; use alloc::string::String; use core::mem; pub fn reverse_bit_order<T>(vals: &mut [T]) -> Result<(), String> where T: Clone, { if vals.is_empty() { return Err(String::from("Values can not be empty")); } // required for tests if vals.len() == 1 { return Ok(()); ...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/parallel_pippenger_utils.rs
kzg/src/msm/parallel_pippenger_utils.rs
use crate::msm::pippenger_utils::num_bits; pub fn breakdown(window: usize, ncpus: usize) -> (usize, usize, usize) { const NBITS: usize = 255; option_env!("WINDOW_NX") .map(|v| { v.parse() .expect("WINDOW_NX environment variable must be valid number") }) .map...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/sppark.rs
kzg/src/msm/sppark.rs
use std::ffi::c_void; use crate::{Fr, G1Affine, G1Fp, G1GetFp, G1Mul, G1ProjAddAffine, G1}; #[derive(Debug)] pub struct SpparkPrecomputation<TFr, TG1, TG1Fp, TG1Affine, TG1ProjAddAffine> where TFr: Fr, TG1: G1 + G1Mul<TFr> + G1GetFp<TG1Fp>, TG1Fp: G1Fp, TG1Affine: G1Affine<TG1, TG1Fp>, TG1ProjAddA...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/diskcache.rs
kzg/src/msm/diskcache.rs
use core::marker::PhantomData; use sha2::{Digest, Sha256}; use std::{ fs::File, io::{BufReader, BufWriter, Read, Write}, }; use crate::{G1Affine, G1Fp, G1}; pub struct DiskCache<TG1: G1, TG1Fp: G1Fp, TG1Affine: G1Affine<TG1, TG1Fp>> { pub table: Vec<TG1Affine>, pub numpoints: usize, pub batch_tab...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/precompute.rs
kzg/src/msm/precompute.rs
extern crate alloc; use alloc::{string::String, vec::Vec}; use crate::{Fr, G1Affine, G1Fp, G1GetFp, G1Mul, G1ProjAddAffine, G1}; #[cfg(any( all(feature = "arkmsm", feature = "bgmw"), all(feature = "arkmsm", feature = "sppark"), all(feature = "arkmsm", feature = "wbits"), all(feature = "bgmw", feature...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/tiling_parallel_pippenger.rs
kzg/src/msm/tiling_parallel_pippenger.rs
use core::{ num::Wrapping, sync::atomic::{AtomicUsize, Ordering}, }; use alloc::sync::Arc; use std::sync::{mpsc::channel, Barrier}; use crate::{G1Affine, G1Fp, G1GetFp, Scalar256, G1}; use super::{ cell::Cell, parallel_pippenger_utils::breakdown, pippenger_utils::{pippenger_window_size, P1XYZZ}, ...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/tiling_pippenger_ops.rs
kzg/src/msm/tiling_pippenger_ops.rs
use crate::{G1Affine, G1Fp, G1GetFp, Scalar256, G1}; use alloc::vec; use super::pippenger_utils::{ booth_decode, booth_encode, get_wval_limb, is_zero, p1_dadd, p1_to_jacobian, pippenger_window_size, type_is_zero, type_zero, P1XYZZ, }; /// Calculate bucket sum /// /// This function multiplies the point in eac...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/pippenger_utils.rs
kzg/src/msm/pippenger_utils.rs
use core::mem::size_of; use crate::{G1Affine, G1Fp, G1GetFp, Scalar256, G1}; #[repr(C)] #[derive(Default, Clone, Copy, Debug)] pub struct P1XYZZ<TFp: G1Fp> { pub x: TFp, pub y: TFp, pub zzz: TFp, pub zz: TFp, } #[inline(always)] pub fn type_zero<T>(ret: &mut T) { let rp = ret as *mut T as *mut u6...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/types.rs
kzg/src/msm/types.rs
// use ark_bls12_381::G1Affine; // use ark_ec::{models::CurveConfig, AffineRepr}; // use ark_ff::{FpConfig, PrimeField, Field}; pub const G1_SCALAR_SIZE: u32 = 255; // TODO: Double check if not 256 pub const G1_SCALAR_SIZE_GLV: u32 = 128u32; pub const GROUP_SIZE_IN_BITS: usize = 6; pub const GROUP_SIZE: usize = 1 << G...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/mod.rs
kzg/src/msm/mod.rs
pub mod arkmsm; pub mod cell; pub mod msm_impls; pub mod precompute; #[cfg(feature = "parallel")] pub mod thread_pool; #[cfg(feature = "parallel")] pub mod tiling_parallel_pippenger; pub mod tiling_pippenger_ops; pub mod types; #[cfg(feature = "parallel")] mod parallel_pippenger_utils; mod pippenger_utils; #[cfg(feat...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/thread_pool.rs
kzg/src/msm/thread_pool.rs
pub trait ThreadPoolExt { fn joined_execute<'any, F>(&self, job: F) where F: FnOnce() + Send + 'any; } use core::mem::transmute; use std::sync::{Mutex, Once}; use threadpool::ThreadPool; pub fn da_pool() -> ThreadPool { static INIT: Once = Once::new(); static mut POOL: *const Mutex<ThreadPool>...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/bgmw.rs
kzg/src/msm/bgmw.rs
use core::marker::PhantomData; use crate::{ msm::tiling_pippenger_ops::p1_integrate_buckets, Fr, G1Affine, G1Fp, G1GetFp, G1Mul, G1ProjAddAffine, Scalar256, G1, }; use super::pippenger_utils::{ booth_decode, booth_encode, get_wval_limb, is_zero, num_bits, P1XYZZ, }; #[derive(Debug, Clone)] pub struct Bgm...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/old_pippenger.rs
kzg/src/msm/old_pippenger.rs
// Leaving this here commented out as requested by lecturer // use std::sync::mpsc::channel; // use crate::{ // cfg_into_iter, common_utils::log2_u64, G1Affine, G1Fp, G1ProjAddAffine, Scalar256, G1, msm::batch_adder::{self, BatchAdder}, // }; // #[cfg(feature = "parallel")] // use rayon::prelude::*; // trait Thr...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/wbits.rs
kzg/src/msm/wbits.rs
/// This algorithm is taken from https://github.com/crate-crypto/rust-eth-kzg use core::{marker::PhantomData, ops::Neg}; use crate::{Fr, G1Affine, G1Fp, G1GetFp, G1Mul, G1ProjAddAffine, G1}; #[cfg(feature = "diskcache")] use crate::msm::diskcache::DiskCache; #[derive(Debug, Clone)] pub struct WbitsTable<TFr, TG1, TG...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/cell.rs
kzg/src/msm/cell.rs
// Minimalist core::cell::Cell stand-in, but with Sync marker, which // makes it possible to pass it to multiple threads. It works, because // *here* each Cell is written only once and by just one thread. #[repr(transparent)] pub struct Cell<T: ?Sized> { value: T, } unsafe impl<T: ?Sized + Sync> Sync for Cell<T> {}...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/msm_impls.rs
kzg/src/msm/msm_impls.rs
use crate::{Fr, G1Affine, G1Fp, G1GetFp, G1Mul, G1ProjAddAffine, G1}; use alloc::vec::Vec; #[cfg(all(feature = "arkmsm", not(feature = "parallel")))] use super::arkmsm::arkmsm_msm::VariableBaseMSM; use super::precompute::PrecomputationTable; use super::tiling_pippenger_ops::tiling_pippenger; #[cfg(feature = "paralle...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/arkmsm/mod.rs
kzg/src/msm/arkmsm/mod.rs
pub mod arkmsm_msm; pub mod batch_adder; pub mod bitmap; pub mod bucket_msm; pub mod glv;
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/arkmsm/bucket_msm.rs
kzg/src/msm/arkmsm/bucket_msm.rs
use core::marker::PhantomData; #[cfg(feature = "parallel")] use rayon::prelude::*; use alloc::vec; use alloc::vec::Vec; use crate::{ cfg_into_iter, msm::arkmsm::{batch_adder::BatchAdder, bitmap::Bitmap, glv::endomorphism}, msm::types::{GROUP_SIZE, GROUP_SIZE_IN_BITS}, G1Affine, G1Fp, G1ProjAddAffine,...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/arkmsm/arkmsm_msm.rs
kzg/src/msm/arkmsm/arkmsm_msm.rs
use crate::{ common_utils::log2_u64, msm::arkmsm::bucket_msm::BucketMSM, msm::arkmsm::glv::decompose, msm::types::{G1_SCALAR_SIZE, G1_SCALAR_SIZE_GLV}, Fr, G1Affine, G1Fp, G1ProjAddAffine, Scalar256, G1, }; use alloc::vec; pub struct VariableBaseMSM; impl VariableBaseMSM { /// WARNING: this f...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/arkmsm/batch_adder.rs
kzg/src/msm/arkmsm/batch_adder.rs
use crate::{G1Affine, G1Fp, G1}; use core::marker::PhantomData; use alloc::vec; use alloc::vec::Vec; pub struct BatchAdder<TG1: G1, TFp: G1Fp, TG1Affine: G1Affine<TG1, TFp>> { pub inverse_state: TFp, pub inverses: Vec<TFp>, // Zero sized fields so that batch adder doesn't complain about unused types /...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/arkmsm/bitmap.rs
kzg/src/msm/arkmsm/bitmap.rs
// Implementation of atomic bitmap // Modified from non-sync implementation use core::sync::atomic::{AtomicU32, Ordering}; use alloc::vec::Vec; pub struct Bitmap { size: usize, data: Vec<AtomicU32>, } impl Bitmap { pub fn new(size: usize) -> Bitmap { let mut data: Vec<AtomicU32> = Vec::with_capac...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/msm/arkmsm/glv.rs
kzg/src/msm/arkmsm/glv.rs
// Based on // Decompose scalar = q * lambda + r with barret reduction // Here we implement algorithm 2 example 1 described in // https://hackmd.io/@chaosma/SyAvcYFxh use crate::{Fr, G1Affine, G1Fp, G1}; const LMDA1: u128 = 0xac45a4010001a402; // lambda high 64 bit const LMDA0: u128 = 0x00000000ffffffff; // lambda lo...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/eth/eip_7594.rs
kzg/src/eth/eip_7594.rs
#[cfg(feature = "parallel")] use rayon::prelude::*; use alloc::{format, string::String, vec::Vec}; use crate::{ cfg_chunks, cfg_iter, das::{EcBackend, DAS}, eip_4844::bytes_to_blob, eth::{ BYTES_PER_BLOB, BYTES_PER_CELL, BYTES_PER_COMMITMENT, BYTES_PER_FIELD_ELEMENT, BYTES_PER_PROOF, C...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/eth/mod.rs
kzg/src/eth/mod.rs
pub mod c_bindings; pub mod eip_7594; pub const FIELD_ELEMENTS_PER_BLOB: usize = 4096; pub const BYTES_PER_G1: usize = 48; pub const BYTES_PER_G2: usize = 96; pub const BYTES_PER_BLOB: usize = BYTES_PER_FIELD_ELEMENT * FIELD_ELEMENTS_PER_BLOB; pub const BYTES_PER_FIELD_ELEMENT: usize = 32; pub const BYTES_PER_PROOF: u...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/src/eth/c_bindings.rs
kzg/src/eth/c_bindings.rs
use crate::{ eth::{CELLS_PER_EXT_BLOB, FIELD_ELEMENTS_PER_CELL}, EcBackend, Fr, DAS, G1, }; use super::{ BYTES_PER_BLOB, BYTES_PER_CELL, BYTES_PER_COMMITMENT, BYTES_PER_FIELD_ELEMENT, BYTES_PER_PROOF, }; use crate::alloc::{ string::{String, ToString}, vec, vec::Vec, }; #[repr(C)] #[derive(Deb...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/kzg/tests/common_utils.rs
kzg/tests/common_utils.rs
#[cfg(test)] pub mod tests { use kzg::common_utils::reverse_bit_order; #[test] fn reverse_bit_order_bad_arguments() { // empty array should fail assert!(reverse_bit_order(&mut [0u8; 0]).is_err()); // array with 1 element should be ignored assert!(reverse_bit_order(&mut [1u8]...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/consts.rs
blst/src/consts.rs
use blst::{blst_fp, blst_fp2, blst_p1, blst_p2}; use crate::types::g1::FsG1; use crate::types::g2::FsG2; pub const G1_IDENTITY: FsG1 = FsG1::from_xyz( blst_fp { l: [0; 6] }, blst_fp { l: [0; 6] }, blst_fp { l: [0; 6] }, ); pub const SCALE_FACTOR: u64 = 5; pub const NUM_ROOTS: usize = 32; /// The roots o...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/lib.rs
blst/src/lib.rs
#![cfg_attr(not(feature = "std"), no_std)] pub mod consts; pub mod data_availability_sampling; pub mod eip_4844; pub mod eip_7594; pub mod fft_fr; pub mod fft_g1; pub mod fk20_proofs; pub mod kzg_proofs; pub mod recovery; pub mod types; pub mod utils; pub mod zero_poly;
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/eip_4844.rs
blst/src/eip_4844.rs
extern crate alloc; #[cfg(feature = "c_bindings")] use alloc::{boxed::Box, vec::Vec}; #[cfg(feature = "c_bindings")] use blst::{blst_fr, blst_p1}; #[cfg(feature = "c_bindings")] use core::ptr; use kzg::eip_4844::load_trusted_setup_rust; #[cfg(feature = "c_bindings")] use kzg::{ eip_4844::{ BYTES_PER_G1, FI...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/kzg_proofs.rs
blst/src/kzg_proofs.rs
extern crate alloc; use crate::types::fp::FsFp; use crate::types::g1::FsG1; use crate::types::{fr::FsFr, g1::FsG1Affine}; use crate::types::g1::FsG1ProjAddAffine; use kzg::msm::{msm_impls::msm, precompute::PrecomputationTable}; use crate::types::g2::FsG2; use blst::{ blst_fp12_is_one, blst_p1_affine, blst_p1_cn...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/eip_7594.rs
blst/src/eip_7594.rs
extern crate alloc; use kzg::EcBackend; use crate::types::fft_settings::FsFFTSettings; use crate::types::fp::FsFp; use crate::types::g1::FsG1; use crate::types::g1::FsG1Affine; use crate::types::g1::FsG1ProjAddAffine; use crate::types::g2::FsG2; use crate::types::kzg_settings::FsKZGSettings; use crate::types::poly::F...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/zero_poly.rs
blst/src/zero_poly.rs
extern crate alloc; use alloc::string::String; use alloc::vec; use alloc::vec::Vec; use core::cmp::{min, Ordering}; use kzg::{common_utils::next_pow_of_2, FFTFr, Fr, ZeroPoly}; use crate::types::fft_settings::FsFFTSettings; use crate::types::fr::FsFr; use crate::types::poly::FsPoly; #[cfg(feature = "parallel")] use...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/data_availability_sampling.rs
blst/src/data_availability_sampling.rs
extern crate alloc; use alloc::string::String; use alloc::vec::Vec; use core::cmp::Ordering; use kzg::{DASExtension, Fr}; use crate::types::fft_settings::FsFFTSettings; use crate::types::fr::FsFr; // TODO: explain algo impl FsFFTSettings { pub fn das_fft_extension_stride(&self, evens: &mut [FsFr], stride: usize...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/fk20_proofs.rs
blst/src/fk20_proofs.rs
extern crate alloc; use alloc::vec; use alloc::vec::Vec; use kzg::{FFTFr, Fr, G1Mul, Poly, FFTG1, G1}; use crate::types::fft_settings::FsFFTSettings; use crate::types::fr::FsFr; use crate::types::g1::FsG1; use crate::types::poly::FsPoly; #[cfg(feature = "parallel")] use rayon::prelude::*; impl FsFFTSettings { ...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/utils.rs
blst/src/utils.rs
extern crate alloc; use alloc::vec::Vec; use kzg::common_utils::log2_pow2; use kzg::eip_4844::{hash_to_bls_field, PrecomputationTableManager}; use kzg::{FFTSettings, Fr, G1Mul, G2Mul, FFTG1}; use crate::consts::{G1_GENERATOR, G2_GENERATOR}; use crate::types::fft_settings::FsFFTSettings; use crate::types::fp::FsFp; u...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/fft_g1.rs
blst/src/fft_g1.rs
extern crate alloc; use alloc::string::String; use alloc::vec; use alloc::vec::Vec; use kzg::{Fr, G1Mul, FFTG1, G1}; use crate::types::fft_settings::FsFFTSettings; use crate::types::fr::FsFr; use crate::types::g1::FsG1; pub fn fft_g1_fast( ret: &mut [FsG1], data: &[FsG1], stride: usize, roots: &[FsF...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/fft_fr.rs
blst/src/fft_fr.rs
extern crate alloc; use alloc::format; use alloc::string::String; use alloc::vec; use alloc::vec::Vec; use kzg::{FFTFr, Fr}; use crate::types::fft_settings::FsFFTSettings; use crate::types::fr::FsFr; /// Fast Fourier Transform for finite field elements. Polynomial ret is operated on in reverse order: ret_i * x ^ (l...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/recovery.rs
blst/src/recovery.rs
extern crate alloc; use alloc::string::String; use alloc::vec::Vec; use kzg::{FFTFr, Fr, PolyRecover, ZeroPoly}; use crate::types::fft_settings::FsFFTSettings; use crate::types::fr::FsFr; use crate::types::poly::FsPoly; use once_cell::sync::OnceCell; #[cfg(feature = "parallel")] use rayon::prelude::*; const SCALE_...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/types/fr.rs
blst/src/types/fr.rs
extern crate alloc; use alloc::format; use alloc::string::String; use alloc::string::ToString; use arbitrary::Arbitrary; use blst::{ blst_bendian_from_scalar, blst_fr, blst_fr_add, blst_fr_cneg, blst_fr_eucl_inverse, blst_fr_from_scalar, blst_fr_from_uint64, blst_fr_inverse, blst_fr_mul, blst_fr_sqr, blst...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/types/fk20_single_settings.rs
blst/src/types/fk20_single_settings.rs
extern crate alloc; use alloc::string::String; use alloc::vec::Vec; use kzg::common_utils::reverse_bit_order; use kzg::{FK20SingleSettings, Poly, FFTG1, G1}; use crate::types::fft_settings::FsFFTSettings; use crate::types::fr::FsFr; use crate::types::g1::FsG1; use crate::types::g2::FsG2; use crate::types::kzg_settin...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/types/kzg_settings.rs
blst/src/types/kzg_settings.rs
extern crate alloc; use alloc::string::{String, ToString}; use alloc::sync::Arc; use alloc::{vec, vec::Vec}; use kzg::eth::c_bindings::CKZGSettings; use kzg::eth::{self, FIELD_ELEMENTS_PER_EXT_BLOB}; use kzg::msm::precompute::{precompute, PrecomputationTable}; use kzg::{FFTFr, FFTSettings, Fr, G1Mul, G2Mul, KZGSettin...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/types/g2.rs
blst/src/types/g2.rs
extern crate alloc; use alloc::format; use alloc::string::String; use alloc::string::ToString; use blst::{ blst_fp2, blst_p2, blst_p2_add_or_double, blst_p2_affine, blst_p2_cneg, blst_p2_compress, blst_p2_double, blst_p2_from_affine, blst_p2_is_equal, blst_p2_mult, blst_p2_uncompress, blst_scalar, blst_sc...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/types/poly.rs
blst/src/types/poly.rs
extern crate alloc; use alloc::string::String; use alloc::vec; use alloc::vec::Vec; use kzg::common_utils::{log2_pow2, log2_u64, next_pow_of_2}; use kzg::{FFTFr, FFTSettings, FFTSettingsPoly, Fr, Poly}; use crate::consts::SCALE_FACTOR; use crate::types::fft_settings::FsFFTSettings; use crate::types::fr::FsFr; #[der...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/types/fft_settings.rs
blst/src/types/fft_settings.rs
extern crate alloc; use alloc::string::String; use alloc::vec; use alloc::vec::Vec; use kzg::common_utils::reverse_bit_order; use kzg::{FFTSettings, Fr}; use crate::consts::SCALE2_ROOT_OF_UNITY; use crate::types::fr::FsFr; #[derive(Debug, Clone)] pub struct FsFFTSettings { pub max_width: usize, pub root_of_...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/types/g1.rs
blst/src/types/g1.rs
extern crate alloc; use alloc::{ borrow::ToOwned, format, string::{String, ToString}, vec::Vec, }; use arbitrary::Arbitrary; use blst::{ blst_fp, blst_fp_cneg, blst_p1, blst_p1_add, blst_p1_add_or_double, blst_p1_affine, blst_p1_affine_serialize, blst_p1_cneg, blst_p1_compress, blst_p1_double, ...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/types/fp.rs
blst/src/types/fp.rs
use blst::blst_fp; use kzg::G1Fp; #[repr(C)] #[derive(Debug, Default, Clone, Copy, Eq, PartialEq)] pub struct FsFp(pub blst_fp); impl G1Fp for FsFp { fn one() -> Self { Self(blst_fp { l: [ 8505329371266088957, 17002214543764226050, 686590513276147...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/types/mod.rs
blst/src/types/mod.rs
pub mod fft_settings; pub mod fk20_multi_settings; pub mod fk20_single_settings; pub mod fp; pub mod fr; pub mod g1; pub mod g2; pub mod kzg_settings; pub mod poly;
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/src/types/fk20_multi_settings.rs
blst/src/types/fk20_multi_settings.rs
extern crate alloc; use alloc::string::String; use alloc::vec; use alloc::vec::Vec; use kzg::common_utils::reverse_bit_order; use kzg::{FK20MultiSettings, Poly, FFTG1, G1}; use crate::types::fft_settings::FsFFTSettings; use crate::types::fr::FsFr; use crate::types::g1::FsG1; use crate::types::g2::FsG2; use crate::ty...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/tests/consts.rs
blst/tests/consts.rs
// #[path = "./local_tests/local_consts.rs"] // pub mod local_consts; #[cfg(test)] mod tests { use kzg_bench::tests::consts::{ expand_roots_is_plausible, new_fft_settings_is_plausible, roots_of_unity_are_plausible, roots_of_unity_is_the_expected_size, roots_of_unity_out_of_bounds_fails, }; ...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/tests/das.rs
blst/tests/das.rs
#[cfg(test)] mod tests { use kzg_bench::tests::das::{das_extension_test_known, das_extension_test_random}; use rust_kzg_blst::types::fft_settings::FsFFTSettings; use rust_kzg_blst::types::fr::FsFr; #[test] fn das_extension_test_known_() { das_extension_test_known::<FsFr, FsFFTSettings>(); ...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/tests/eip_4844.rs
blst/tests/eip_4844.rs
#[cfg(test)] mod tests { use kzg::eip_4844::{ blob_to_kzg_commitment_rust, blob_to_polynomial, bytes_to_blob, compute_blob_kzg_proof_rust, compute_challenge_rust, compute_kzg_proof_rust, compute_powers, evaluate_polynomial_in_evaluation_form, verify_blob_kzg_proof_batch_rust, verify_...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/tests/kzg_proofs.rs
blst/tests/kzg_proofs.rs
#[cfg(test)] mod tests { use blst::{ blst_final_exp, blst_fp12, blst_fp12_mul, blst_miller_loop, blst_p1_affine, blst_p1_cneg, blst_p1_to_affine, blst_p2_affine, blst_p2_to_affine, Pairing, }; use kzg::G1; use kzg_bench::tests::kzg_proofs::{ commit_to_nil_poly, commit_to_too_long...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/tests/eip_7594.rs
blst/tests/eip_7594.rs
#[cfg(test)] mod tests { use kzg::{ eip_4844::{blob_to_kzg_commitment_rust, bytes_to_blob}, eth, DAS, }; use kzg_bench::tests::{ eip_4844::generate_random_blob_bytes, eip_7594::{ test_vectors_compute_cells, test_vectors_compute_cells_and_kzg_proofs, te...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/tests/poly.rs
blst/tests/poly.rs
// #[path = "./local_tests/local_poly.rs"] // pub mod local_poly; #[cfg(test)] mod tests { use kzg_bench::tests::poly::{ create_poly_of_length_ten, poly_div_by_zero, poly_div_fast_test, poly_div_long_test, poly_div_random, poly_eval_0_check, poly_eval_check, poly_eval_nil_check, poly_invers...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/tests/zero_poly.rs
blst/tests/zero_poly.rs
#[cfg(test)] mod tests { use kzg_bench::tests::zero_poly::{ check_test_data, reduce_partials_random, test_reduce_partials, zero_poly_252, zero_poly_all_but_one, zero_poly_known, zero_poly_random, }; use rust_kzg_blst::types::fft_settings::FsFFTSettings; use rust_kzg_blst::types::fr::FsFr...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/tests/bls12_381.rs
blst/tests/bls12_381.rs
#[cfg(test)] mod tests { use kzg::common_utils::log_2_byte; use kzg_bench::tests::bls12_381::{ fr_div_by_zero, fr_div_works, fr_equal_works, fr_from_uint64_works, fr_is_null_works, fr_is_one_works, fr_is_zero_works, fr_negate_works, fr_pow_works, fr_uint64s_roundtrip, g1_identity_is_iden...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/tests/fk20_proofs.rs
blst/tests/fk20_proofs.rs
#[cfg(test)] mod tests { use kzg_bench::tests::fk20_proofs::*; use rust_kzg_blst::eip_7594::BlstBackend; use rust_kzg_blst::types::fk20_multi_settings::FsFK20MultiSettings; use rust_kzg_blst::types::fk20_single_settings::FsFK20SingleSettings; use rust_kzg_blst::utils::generate_trusted_setup; #[...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/tests/mod.rs
blst/tests/mod.rs
pub mod local_tests;
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/tests/c_bindings.rs
blst/tests/c_bindings.rs
#[cfg(all(test, feature = "c_bindings"))] mod tests { use kzg_bench::tests::c_bindings::{ blob_to_kzg_commitment_invalid_blob_test, compute_blob_kzg_proof_commitment_is_point_at_infinity_test, compute_blob_kzg_proof_invalid_blob_test, free_trusted_setup_null_ptr_test, free_trusted_se...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/tests/fft_g1.rs
blst/tests/fft_g1.rs
#[cfg(test)] mod tests { use kzg::G1; use kzg_bench::tests::fft_g1::{compare_ft_fft, roundtrip_fft, stride_fft}; use rust_kzg_blst::consts::G1_GENERATOR; use rust_kzg_blst::fft_g1::{fft_g1_fast, fft_g1_slow}; use rust_kzg_blst::types::fft_settings::FsFFTSettings; use rust_kzg_blst::types::fr::Fs...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/tests/fft_fr.rs
blst/tests/fft_fr.rs
#[cfg(test)] mod tests { use kzg_bench::tests::fft_fr::{compare_sft_fft, inverse_fft, roundtrip_fft, stride_fft}; use rust_kzg_blst::fft_fr::{fft_fr_fast, fft_fr_slow}; use rust_kzg_blst::types::fft_settings::FsFFTSettings; use rust_kzg_blst::types::fr::FsFr; #[test] fn compare_sft_fft_() { ...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/tests/recovery.rs
blst/tests/recovery.rs
// #[path = "./local_tests/local_recovery.rs"] // pub mod local_recovery; #[cfg(test)] mod tests { use kzg_bench::tests::recover::*; // uncomment to use the local tests //use crate::local_recovery::{recover_random, recover_simple}; use rust_kzg_blst::types::fft_settings::FsFFTSettings; use rust_kz...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/tests/batch_adder.rs
blst/tests/batch_adder.rs
#[cfg(test)] mod tests { use kzg_bench::tests::msm::batch_adder::{ test_batch_add, test_batch_add_indexed, test_batch_add_indexed_single_bucket, test_batch_add_step_n, test_phase_one_p_add_p, test_phase_one_p_add_q, test_phase_one_p_add_q_twice, test_phase_one_zero_or_neg, test_phase_two_p_a...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/tests/local_tests/local_recovery.rs
blst/tests/local_tests/local_recovery.rs
use kzg::{FFTFr, FFTSettings, Fr, Poly, PolyRecover}; use rand::rngs::StdRng; use rand::{RngCore, SeedableRng}; use std::convert::TryInto; fn shuffle(a: &mut [usize], n: usize) { let mut i: u64 = n as u64; let mut j: usize; let mut tmp: usize; let mut rng = StdRng::seed_from_u64(0); while i > 0 { ...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/tests/local_tests/local_poly.rs
blst/tests/local_tests/local_poly.rs
use kzg::{Fr, Poly}; use rand::rngs::StdRng; use rand::{RngCore, SeedableRng}; use rust_kzg_blst::types::fr::FsFr; use rust_kzg_blst::types::poly::FsPoly; pub fn create_poly_of_length_ten() { let poly = FsPoly::new(10); assert_eq!(poly.len(), 10); } pub fn poly_pad_works_rand() { let mut rng = StdRng::se...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/tests/local_tests/mod.rs
blst/tests/local_tests/mod.rs
pub mod local_consts; pub mod local_poly; pub mod local_recovery;
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/tests/local_tests/local_consts.rs
blst/tests/local_tests/local_consts.rs
use kzg::{FFTSettings, Fr}; pub fn roots_of_unity_repeat_at_stride<TFr: Fr, TFFTSettings: FFTSettings<TFr>>() { let fs1 = TFFTSettings::new(15).unwrap(); let fs2 = TFFTSettings::new(16).unwrap(); let fs3 = TFFTSettings::new(17).unwrap(); for i in 0..fs1.get_max_width() { assert!(fs1 ...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/benches/trusted_setup.rs
blst/benches/trusted_setup.rs
use criterion::{criterion_group, criterion_main, Criterion}; use kzg::eip_4844::load_trusted_setup_rust; use kzg_bench::benches::trusted_setup::bench_load_trusted_setup; use rust_kzg_blst::{ eip_4844::load_trusted_setup_filename_rust, types::{ fft_settings::FsFFTSettings, fp::FsFp, fr::F...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/benches/das.rs
blst/benches/das.rs
use criterion::{criterion_group, criterion_main, Criterion}; use kzg_bench::benches::das::bench_das_extension; use rust_kzg_blst::types::fft_settings::FsFFTSettings; use rust_kzg_blst::types::fr::FsFr; fn bench_das_extension_(c: &mut Criterion) { bench_das_extension::<FsFr, FsFFTSettings>(c) } criterion_group! { ...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/benches/eip_4844.rs
blst/benches/eip_4844.rs
use criterion::{criterion_group, criterion_main, Criterion}; use kzg::eip_4844::{ blob_to_kzg_commitment_rust, bytes_to_blob, compute_blob_kzg_proof_rust, compute_kzg_proof_rust, verify_blob_kzg_proof_batch_rust, verify_blob_kzg_proof_rust, verify_kzg_proof_rust, }; use kzg_bench::benches::eip_4844::bench_e...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/benches/eip_7594.rs
blst/benches/eip_7594.rs
use criterion::{criterion_group, criterion_main, Criterion}; use kzg::eip_4844::{blob_to_kzg_commitment_rust, bytes_to_blob}; use kzg_bench::benches::eip_7594::bench_eip_7594; use rust_kzg_blst::{eip_4844::load_trusted_setup_filename_rust, eip_7594::BlstBackend}; fn bench_eip_7594_(c: &mut Criterion) { bench_eip_7...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/benches/poly.rs
blst/benches/poly.rs
use criterion::{criterion_group, criterion_main, Criterion}; use kzg_bench::benches::poly::bench_new_poly_div; use rust_kzg_blst::types::fr::FsFr; use rust_kzg_blst::types::poly::FsPoly; fn bench_new_poly_div_(c: &mut Criterion) { bench_new_poly_div::<FsFr, FsPoly>(c); } criterion_group! { name = benches; ...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/benches/zero_poly.rs
blst/benches/zero_poly.rs
use criterion::{criterion_group, criterion_main, Criterion}; use kzg_bench::benches::zero_poly::bench_zero_poly; use rust_kzg_blst::types::{fft_settings::FsFFTSettings, fr::FsFr, poly::FsPoly}; fn bench_zero_poly_(c: &mut Criterion) { bench_zero_poly::<FsFr, FsFFTSettings, FsPoly>(c); } criterion_group! { nam...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/benches/kzg.rs
blst/benches/kzg.rs
use criterion::{criterion_group, criterion_main, Criterion}; use kzg_bench::benches::kzg::{bench_commit_to_poly, bench_compute_proof_single}; use rust_kzg_blst::eip_7594::BlstBackend; use rust_kzg_blst::utils::generate_trusted_setup; fn bench_commit_to_poly_(c: &mut Criterion) { bench_commit_to_poly::<BlstBackend>...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/benches/lincomb.rs
blst/benches/lincomb.rs
use criterion::{criterion_group, criterion_main, Criterion}; use kzg_bench::benches::lincomb::bench_g1_lincomb; use rust_kzg_blst::kzg_proofs::g1_linear_combination; use rust_kzg_blst::types::fp::FsFp; use rust_kzg_blst::types::fr::FsFr; use rust_kzg_blst::types::g1::{FsG1, FsG1Affine, FsG1ProjAddAffine}; fn bench_g1_...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/benches/fk_20.rs
blst/benches/fk_20.rs
use criterion::{criterion_group, criterion_main, Criterion}; use kzg_bench::benches::fk20::{bench_fk_multi_da, bench_fk_single_da}; use rust_kzg_blst::eip_7594::BlstBackend; use rust_kzg_blst::types::fk20_multi_settings::FsFK20MultiSettings; use rust_kzg_blst::types::fk20_single_settings::FsFK20SingleSettings; use rus...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/benches/recover.rs
blst/benches/recover.rs
use criterion::{criterion_group, criterion_main, Criterion}; use kzg_bench::benches::recover::bench_recover; use rust_kzg_blst::types::{fft_settings::FsFFTSettings, fr::FsFr, poly::FsPoly}; pub fn bench_recover_(c: &mut Criterion) { bench_recover::<FsFr, FsFFTSettings, FsPoly, FsPoly>(c) } criterion_group! { ...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/blst/benches/fft.rs
blst/benches/fft.rs
use criterion::{criterion_group, criterion_main, Criterion}; use kzg_bench::benches::fft::{bench_fft_fr, bench_fft_g1}; use rust_kzg_blst::types::fft_settings::FsFFTSettings; use rust_kzg_blst::types::fr::FsFr; use rust_kzg_blst::types::g1::FsG1; fn bench_fft_fr_(c: &mut Criterion) { bench_fft_fr::<FsFr, FsFFTSett...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/src/lib.rs
zkcrypto/bls12_381/src/lib.rs
//! # `bls12_381` //! //! This crate provides an implementation of the BLS12-381 pairing-friendly elliptic //! curve construction. //! //! * **This implementation has not been reviewed or audited. Use at your own risk.** //! * This implementation targets Rust `1.36` or later. //! * This implementation does not require ...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/src/fp12.rs
zkcrypto/bls12_381/src/fp12.rs
use crate::fp::*; use crate::fp2::*; use crate::fp6::*; use core::fmt; use core::ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign}; use subtle::{Choice, ConditionallySelectable, ConstantTimeEq, CtOption}; #[cfg(feature = "pairings")] use rand_core::RngCore; /// This represents an element $c_0 + c_1 w$ of $\...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/src/g2.rs
zkcrypto/bls12_381/src/g2.rs
//! This module provides an implementation of the $\mathbb{G}_2$ group of BLS12-381. #![allow(clippy::all)] use core::borrow::Borrow; use core::fmt; use core::iter::Sum; use core::ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign}; use group::{ prime::{PrimeCurve, PrimeCurveAffine, PrimeGroup}, Curve, ...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
true
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/src/fp6.rs
zkcrypto/bls12_381/src/fp6.rs
use crate::fp::*; use crate::fp2::*; use core::fmt; use core::ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign}; use subtle::{Choice, ConditionallySelectable, ConstantTimeEq, CtOption}; #[cfg(feature = "pairings")] use rand_core::RngCore; /// This represents an element $c_0 + c_1 v + c_2 v^2$ of $\mathbb{F}...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/src/pairings.rs
zkcrypto/bls12_381/src/pairings.rs
use crate::fp::Fp; use crate::fp12::Fp12; use crate::fp2::Fp2; use crate::fp6::Fp6; use crate::{G1Affine, G1Projective, G2Affine, G2Projective, Scalar, BLS_X, BLS_X_IS_NEGATIVE}; use core::borrow::Borrow; use core::fmt; use core::iter::Sum; use core::ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign}; use grou...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/src/g1.rs
zkcrypto/bls12_381/src/g1.rs
//! This module provides an implementation of the $\mathbb{G}_1$ group of BLS12-381. use core::borrow::Borrow; use core::fmt; use core::iter::Sum; use core::ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign}; use group::{ prime::{PrimeCurve, PrimeCurveAffine, PrimeGroup}, Curve, Group, GroupEncoding, U...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
true
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/src/util.rs
zkcrypto/bls12_381/src/util.rs
/// Compute a + b + carry, returning the result and the new carry over. #[inline(always)] pub const fn adc(a: u64, b: u64, carry: u64) -> (u64, u64) { let ret = (a as u128) + (b as u128) + (carry as u128); (ret as u64, (ret >> 64) as u64) } /// Compute a - (b + borrow), returning the result and the new borrow....
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/src/scalar.rs
zkcrypto/bls12_381/src/scalar.rs
//! This module provides an implementation of the BLS12-381 scalar field $\mathbb{F}_q$ //! where `q = 0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001` #![allow(clippy::all)] use core::fmt; use core::ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign}; use rand_core::RngCore; use ff::{Field,...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
true
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/src/fp.rs
zkcrypto/bls12_381/src/fp.rs
//! This module provides an implementation of the BLS12-381 base field `GF(p)` //! where `p = 0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaab` #![allow(clippy::all)] use core::fmt; use core::ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign}; use rand_core::Rn...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
true
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/src/fp2.rs
zkcrypto/bls12_381/src/fp2.rs
//! This module implements arithmetic over the quadratic extension field Fp2. #![allow(clippy::all)] use core::fmt; use core::ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign}; use rand_core::RngCore; use subtle::{Choice, ConditionallySelectable, ConstantTimeEq, CtOption}; use crate::fp::Fp; #[derive(Copy, ...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/src/tests/mod.rs
zkcrypto/bls12_381/src/tests/mod.rs
use super::*; macro_rules! test_vectors { ($projective:ident, $affine:ident, $serialize:ident, $deserialize:ident, $expected:ident) => { let mut e = $projective::identity(); let mut v = vec![]; { let mut expected = $expected; for _ in 0..1000 { let e...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/src/hash_to_curve/map_g2.rs
zkcrypto/bls12_381/src/hash_to_curve/map_g2.rs
//! Implementation of hash-to-curve for the G2 group use subtle::{Choice, ConditionallyNegatable, ConditionallySelectable, ConstantTimeEq}; use super::chain::chain_p2m9div16; use super::{HashToField, MapToCurve, Sgn0}; use crate::generic_array::{ typenum::{U128, U64}, GenericArray, }; use crate::{fp::Fp, fp2:...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/src/hash_to_curve/chain.rs
zkcrypto/bls12_381/src/hash_to_curve/chain.rs
//! Addition chains for computing square roots. //! chain_pm3div4: input x, output x^((p-3)//4). //! chain_p2m9div16: input x, output x^((p**2 - 9) // 16). use core::ops::MulAssign; use crate::{fp::Fp, fp2::Fp2}; macro_rules! square { ($var:expr, $n:expr) => { for _ in 0..$n { $var = $var.squ...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
true
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/src/hash_to_curve/mod.rs
zkcrypto/bls12_381/src/hash_to_curve/mod.rs
//! This module implements hash_to_curve, hash_to_field and related //! hashing primitives for use with BLS signatures. use core::ops::Add; use subtle::Choice; pub(crate) mod chain; mod expand_msg; pub use self::expand_msg::{ ExpandMessage, ExpandMessageState, ExpandMsgXmd, ExpandMsgXof, InitExpandMessage, }; ...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/src/hash_to_curve/map_scalar.rs
zkcrypto/bls12_381/src/hash_to_curve/map_scalar.rs
//! Implementation of hash-to-field for Scalar values use super::HashToField; use crate::generic_array::{typenum::U48, GenericArray}; use crate::scalar::Scalar; impl HashToField for Scalar { // ceil(log2(p)) = 255, m = 1, k = 128. type InputLength = U48; fn from_okm(okm: &GenericArray<u8, U48>) -> Scalar...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/src/hash_to_curve/map_g1.rs
zkcrypto/bls12_381/src/hash_to_curve/map_g1.rs
//! Implementation of hash-to-curve for the G1 group. use subtle::{Choice, ConditionallyNegatable, ConditionallySelectable, ConstantTimeEq}; use super::chain::chain_pm3div4; use super::{HashToField, MapToCurve, Sgn0}; use crate::fp::Fp; use crate::g1::G1Projective; use crate::generic_array::{typenum::U64, GenericArra...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/src/hash_to_curve/expand_msg.rs
zkcrypto/bls12_381/src/hash_to_curve/expand_msg.rs
//! This module implements message expansion consistent with the //! hash-to-curve RFC drafts 7 through 10 use core::{ fmt::{self, Debug, Formatter}, marker::PhantomData, }; use digest::{BlockInput, Digest, ExtendableOutputDirty, Update, XofReader}; use crate::generic_array::{ typenum::{Unsigned, U32}, ...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
true
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/src/notes/serialization.rs
zkcrypto/bls12_381/src/notes/serialization.rs
//! # BLS12-381 serialization //! //! * $\mathbb{F}\_p$ elements are encoded in big-endian form. They occupy 48 //! bytes in this form. //! * $\mathbb{F}\_{p^2}$ elements are encoded in big-endian form, meaning that //! the $\mathbb{F}\_{p^2}$ element $c\_0 + c\_1 \cdot u$ is represented by the //! $\mathbb{F}\_p...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/src/notes/design.rs
zkcrypto/bls12_381/src/notes/design.rs
//! # Design of BLS12-381 //! ## Fixed Generators //! //! Although any generator produced by hashing to $\mathbb{G}_1$ or $\mathbb{G}_2$ is //! safe to use in a cryptographic protocol, we specify some simple, fixed generators. //! //! In order to derive these generators, we select the lexicographically smallest //! val...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false
grandinetech/rust-kzg
https://github.com/grandinetech/rust-kzg/blob/d47acbdf587753f466a5e6842395e03930ae1f96/zkcrypto/bls12_381/benches/hash_to_curve.rs
zkcrypto/bls12_381/benches/hash_to_curve.rs
#[macro_use] extern crate criterion; extern crate bls12_381; use bls12_381::hash_to_curve::*; use bls12_381::*; use criterion::{black_box, Criterion}; fn criterion_benchmark(c: &mut Criterion) { // G1Projective { let name = "G1Projective"; let message: &[u8] = b"test message"; let ds...
rust
Apache-2.0
d47acbdf587753f466a5e6842395e03930ae1f96
2026-01-04T20:22:26.256259Z
false