mirror of
https://github.com/serai-dex/serai.git
synced 2025-01-11 05:14:41 +00:00
Don't use a constant for H yet re-calculate it
This commit is contained in:
parent
1362764b2b
commit
10ab467160
1 changed files with 5 additions and 8 deletions
|
@ -8,7 +8,7 @@ use subtle::ConstantTimeEq;
|
||||||
use tiny_keccak::{Hasher, Keccak};
|
use tiny_keccak::{Hasher, Keccak};
|
||||||
|
|
||||||
use curve25519_dalek::{
|
use curve25519_dalek::{
|
||||||
constants::ED25519_BASEPOINT_TABLE,
|
constants::{ED25519_BASEPOINT_POINT, ED25519_BASEPOINT_TABLE},
|
||||||
scalar::Scalar,
|
scalar::Scalar,
|
||||||
edwards::{EdwardsPoint, EdwardsBasepointTable, CompressedEdwardsY},
|
edwards::{EdwardsPoint, EdwardsBasepointTable, CompressedEdwardsY},
|
||||||
};
|
};
|
||||||
|
@ -30,14 +30,11 @@ pub mod wallet;
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
static ref H: EdwardsPoint = CompressedEdwardsY(
|
static ref H: EdwardsPoint =
|
||||||
hex::decode("8b655970153799af2aeadc9ff1add0ea6c7251d54154cfa92c173a0dd39c1f94")
|
CompressedEdwardsY(hash(&ED25519_BASEPOINT_POINT.compress().to_bytes()))
|
||||||
.unwrap()
|
|
||||||
.try_into()
|
|
||||||
.unwrap()
|
|
||||||
)
|
|
||||||
.decompress()
|
.decompress()
|
||||||
.unwrap();
|
.unwrap()
|
||||||
|
.mul_by_cofactor();
|
||||||
static ref H_TABLE: EdwardsBasepointTable = EdwardsBasepointTable::create(&H);
|
static ref H_TABLE: EdwardsBasepointTable = EdwardsBasepointTable::create(&H);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue