mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 12:49:23 +00:00
Generate Bulletproofs(+) generators at compile time
Creates a new monero-generators crate so the monero crate can run the code in question at build time. Saves several seconds from running the tests. Closes https://github.com/serai-dex/serai/issues/101.
This commit is contained in:
@@ -6,11 +6,13 @@ use zeroize::{Zeroize, ZeroizeOnDrop};
|
||||
use tiny_keccak::{Hasher, Keccak};
|
||||
|
||||
use curve25519_dalek::{
|
||||
constants::{ED25519_BASEPOINT_POINT, ED25519_BASEPOINT_TABLE},
|
||||
constants::ED25519_BASEPOINT_TABLE,
|
||||
scalar::Scalar,
|
||||
edwards::{EdwardsPoint, EdwardsBasepointTable, CompressedEdwardsY},
|
||||
edwards::{EdwardsPoint, EdwardsBasepointTable},
|
||||
};
|
||||
|
||||
pub use monero_generators::H;
|
||||
|
||||
#[cfg(feature = "multisig")]
|
||||
pub mod frost;
|
||||
|
||||
@@ -54,11 +56,6 @@ impl Protocol {
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
static ref H: EdwardsPoint =
|
||||
CompressedEdwardsY(hash(&ED25519_BASEPOINT_POINT.compress().to_bytes()))
|
||||
.decompress()
|
||||
.unwrap()
|
||||
.mul_by_cofactor();
|
||||
static ref H_TABLE: EdwardsBasepointTable = EdwardsBasepointTable::create(&H);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user