mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 12:49:23 +00:00
Add support for Ristretto
Replaces P-256 as the curve used for testing FROST.
This commit is contained in:
@@ -1,26 +1,27 @@
|
||||
use rand::rngs::OsRng;
|
||||
|
||||
use crate::{
|
||||
curves::kp256::{P256, IetfP256Hram},
|
||||
tests::{curve::test_curve, schnorr::test_schnorr, vectors::{Vectors, vectors}}
|
||||
};
|
||||
|
||||
#[cfg(feature = "k256")]
|
||||
use crate::tests::{curve::test_curve, schnorr::test_schnorr};
|
||||
#[cfg(feature = "k256")]
|
||||
use crate::curves::kp256::K256;
|
||||
|
||||
#[cfg(feature = "p256")]
|
||||
use crate::tests::vectors::{Vectors, test_with_vectors};
|
||||
#[cfg(feature = "p256")]
|
||||
use crate::curves::kp256::{P256, IetfP256Hram};
|
||||
|
||||
#[cfg(feature = "k256")]
|
||||
#[test]
|
||||
fn p256_curve() {
|
||||
test_curve::<_, P256>(&mut OsRng);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn p256_schnorr() {
|
||||
test_schnorr::<_, P256>(&mut OsRng);
|
||||
fn k256_not_ietf() {
|
||||
test_curve::<_, K256>(&mut OsRng);
|
||||
test_schnorr::<_, K256>(&mut OsRng);
|
||||
}
|
||||
|
||||
#[cfg(feature = "p256")]
|
||||
#[test]
|
||||
fn p256_vectors() {
|
||||
vectors::<P256, IetfP256Hram>(
|
||||
test_with_vectors::<_, P256, IetfP256Hram>(
|
||||
&mut OsRng,
|
||||
Vectors {
|
||||
threshold: 2,
|
||||
shares: &[
|
||||
@@ -52,15 +53,3 @@ fn p256_vectors() {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(feature = "k256")]
|
||||
#[test]
|
||||
fn k256_curve() {
|
||||
test_curve::<_, K256>(&mut OsRng);
|
||||
}
|
||||
|
||||
#[cfg(feature = "k256")]
|
||||
#[test]
|
||||
fn k256_schnorr() {
|
||||
test_schnorr::<_, K256>(&mut OsRng);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user