-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing g2 tau points as Consts (#40)
* removing reading g2, fixing g2 tau points. clean up * fixing mainnet points * removing unwated files * style+perf: clean-up and optimize remove_empty_byte_from_padded_bytes_unchecked fn (#41) * style+perf: clean-up and optimize remove_empty_byte_from_padded_bytes_unchecked function * ci: make cargo fmt use nightly There were a bunch of warnings that some of our set fmt properties were not being run: Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel. Warning: can't set `normalize_comments = true`, unstable features are only available in nightly channel. * style: cargo fmt * Revert "ci: make cargo fmt use nightly" Getting "error: toolchain 'nightly-x86_64-unknown-linux-gnu' is not installed" on github, and don't feel like debugging. Not even sure how cargo/rust are installed. Do they come preloaded by default? This reverts commit 6e87e0a. * Revert "style: cargo fmt" This reverts commit ae70bf5. * style: cargo fmt * Cleanup/roots of unities setup functions (#37) * adding bare changes for batch verification * adding some comments * adding more comments * moving back to sha2 * removing a test which is no longer needed. Removing methods no longer needed * updates to method visibility, updating tests * fmt fixes * clean up * cleanup, optimization, inline docs * removing unwanted const * more docs and cleanup * formatting * removing unwanted comments * cargo fmt and clippy * adding test for point at infinity * cleaner errors, cleanup * adding another test case * removing unwanted errors * adding fixes per comments * adding 4844 spec references * comment fixes * formatting, adding index out of bound check, removing print statement * removing unwanted test, adding test for evaluate_polynomial_in_evaluation_form * moving test to bottom section * Update src/polynomial.rs Co-authored-by: Samuel Laferriere <[email protected]> * Update src/kzg.rs Co-authored-by: Samuel Laferriere <[email protected]> * Update src/kzg.rs Co-authored-by: Samuel Laferriere <[email protected]> * Update src/kzg.rs Co-authored-by: Samuel Laferriere <[email protected]> * Update src/helpers.rs Co-authored-by: Samuel Laferriere <[email protected]> * updating deps, and toolchain to 1.84 * removing errors test, no longer useful * adding to_byte_array arg explanation * fmt fixes * fmt and clippy fixes * fixing function names and fmt * clippy fixes * removing unwanted setup functions * removing vars from struct * fixing function name and comments * fixing naming for tests * fixing naming in benches * formatting * removing is_zero --------- Co-authored-by: anupsv <[email protected]> Co-authored-by: Samuel Laferriere * fixing endianess to big across functions (#39) * fixing endianess to big across functions * removing todo's * storing g2 tau as consts * cargo fmt * moving checker to test, adding explanation, cargo fmt * more cargo fmt --------- Co-authored-by: anupsv <[email protected]> Co-authored-by: Samuel Laferriere <[email protected]>
- Loading branch information
1 parent
94f57a1
commit 089e1ac
Showing
17 changed files
with
62 additions
and
3,376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,36 @@ | ||
use ark_bn254::{Fq2, G2Affine}; | ||
use ark_ff::MontFp; | ||
|
||
pub const BYTES_PER_FIELD_ELEMENT: usize = 32; | ||
pub const SIZE_OF_G1_AFFINE_COMPRESSED: usize = 32; // in bytes | ||
pub const SIZE_OF_G2_AFFINE_COMPRESSED: usize = 64; // in bytes | ||
|
||
/// Ref: https://github.com/ethereum/consensus-specs/blob/master/specs/deneb/polynomial-commitments.md#blob | ||
pub const FIAT_SHAMIR_PROTOCOL_DOMAIN: &[u8] = b"EIGENDA_FSBLOBVERIFY_V1_"; // Adapted from 4844 | ||
|
||
/// Ref: https://github.com/ethereum/consensus-specs/blob/master/specs/deneb/polynomial-commitments.md#blob | ||
pub const RANDOM_CHALLENGE_KZG_BATCH_DOMAIN: &[u8] = b"EIGENDA_RCKZGBATCH___V1_"; // Adapted from 4844 | ||
|
||
pub const G2_TAU_FOR_TEST_SRS_3000: G2Affine = G2Affine::new_unchecked( | ||
Fq2::new( | ||
MontFp!("7912312892787135728292535536655271843828059318189722219035249994421084560563"), | ||
MontFp!("21039730876973405969844107393779063362038454413254731404052240341412356318284"), | ||
), | ||
Fq2::new( | ||
MontFp!("18697407556011630376420900106252341752488547575648825575049647403852275261247"), | ||
MontFp!("7586489485579523767759120334904353546627445333297951253230866312564920951171"), | ||
), | ||
); | ||
|
||
pub const G2_TAU_FOR_MAINNET_SRS: G2Affine = G2Affine::new_unchecked( | ||
Fq2::new( | ||
MontFp!("19394299006376106554626551996044114846855237028623244664226757033024550999552"), | ||
MontFp!("10478571113809844268398751534081669357808742555529167819607714577862447855483"), | ||
), | ||
Fq2::new( | ||
MontFp!("9205262336805673656533560220225620941045451042642528799409071118332922267006"), | ||
MontFp!("10552783866161062341197740743287753408530108186218052255509661543860392060676"), | ||
), | ||
); | ||
|
||
// This is the G2 Tau for the MAINNET SRS points. | ||
pub const MAINNET_SRS_G1_SIZE: usize = 131072; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.