mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 12:49:23 +00:00
Remove Monero as a dependency
Introduces missing CLSAG checks. The only difference now should be the additional rejection of torsioned points, which is relevant to https://github.com/serai-dex/serai/issues/25. Considering this is only currently used for FROST verification, this should be fine. Closes https://github.com/serai-dex/serai/issues/19 by making it irrelevant. Increases priority of https://github.com/serai-dex/serai/issues/68, as now it's used for the BP generators which are done at first-proof. Also merges BP's stricter hash_to_point with the library's, since CLSAG has the same bound.
This commit is contained in:
@@ -28,13 +28,7 @@ fn random_scalar<R: RngCore + CryptoRng>(rng: &mut R) -> Scalar {
|
||||
}
|
||||
|
||||
fn hash_to_scalar(data: &[u8]) -> Scalar {
|
||||
let scalar = Scalar(dalek_hash(data));
|
||||
// Monero will explicitly retry on these cases, as them occurring breaks the proof
|
||||
// This library acknowledges their practical impossibility of them occurring, and doesn't bother
|
||||
// to code in logic to handle it. That said, if they ever occur, something must happen in order
|
||||
// to not generate a proof we believe to be valid when it isn't
|
||||
assert!(!bool::from(scalar.is_zero()), "ZERO HASH: {:?}", data);
|
||||
scalar
|
||||
Scalar(dalek_hash(data))
|
||||
}
|
||||
|
||||
fn generator(i: usize) -> EdwardsPoint {
|
||||
|
||||
Reference in New Issue
Block a user