mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-05 23:33:07 +00:00
addressed comments
This commit is contained in:
parent
e8805a126a
commit
b5fea8d1bb
@ -46,9 +46,9 @@ impl Secp256K1Base {
|
|||||||
val.to_u64_digits()
|
val.to_u64_digits()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.pad_using(4, |_| 0)
|
.pad_using(4, |_| 0)
|
||||||
.collect::<Vec<_>>()[..4]
|
.collect::<Vec<_>>()[..]
|
||||||
.try_into()
|
.try_into()
|
||||||
.expect("error converting to u64 array; should never happen"),
|
.expect("error converting to u64 array"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -69,9 +69,7 @@ impl Eq for Secp256K1Base {}
|
|||||||
|
|
||||||
impl Hash for Secp256K1Base {
|
impl Hash for Secp256K1Base {
|
||||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||||
self.to_canonical_biguint()
|
self.to_canonical_biguint().hash(state)
|
||||||
.iter_u64_digits()
|
|
||||||
.for_each(|digit| state.write_u64(digit))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,7 +106,7 @@ impl Field for Secp256K1Base {
|
|||||||
// Sage: `g = GF(p).multiplicative_generator()`
|
// Sage: `g = GF(p).multiplicative_generator()`
|
||||||
const MULTIPLICATIVE_GROUP_GENERATOR: Self = Self([5, 0, 0, 0]);
|
const MULTIPLICATIVE_GROUP_GENERATOR: Self = Self([5, 0, 0, 0]);
|
||||||
|
|
||||||
// Sage: `g_2 = g^((p - 1) / 2^32)`
|
// Sage: `g_2 = g^((p - 1) / 2)`
|
||||||
const POWER_OF_TWO_GENERATOR: Self = Self::NEG_ONE;
|
const POWER_OF_TWO_GENERATOR: Self = Self::NEG_ONE;
|
||||||
|
|
||||||
fn order() -> BigUint {
|
fn order() -> BigUint {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user