mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 04:39:24 +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:
@@ -1,21 +0,0 @@
|
||||
use rand::rngs::OsRng;
|
||||
|
||||
use crate::{Commitment, random_scalar, ringct::bulletproofs::Bulletproofs};
|
||||
|
||||
#[test]
|
||||
fn bulletproofs() {
|
||||
// Create Bulletproofs for all possible output quantities
|
||||
for i in 1 .. 17 {
|
||||
let commitments =
|
||||
(1 ..= i).map(|i| Commitment::new(random_scalar(&mut OsRng), i)).collect::<Vec<_>>();
|
||||
|
||||
assert!(Bulletproofs::new(&mut OsRng, &commitments)
|
||||
.unwrap()
|
||||
.verify(&mut OsRng, &commitments.iter().map(Commitment::calculate).collect::<Vec<_>>()));
|
||||
}
|
||||
|
||||
// Check it errors if we try to create too many
|
||||
assert!(
|
||||
Bulletproofs::new(&mut OsRng, &[Commitment::new(random_scalar(&mut OsRng), 1); 17]).is_err()
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user