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:
Luke Parker
2022-07-26 03:25:57 -04:00
parent ee29f6d6d8
commit 696da8228e
14 changed files with 33 additions and 403 deletions

View File

@@ -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()
);
}