Add support for Ristretto

Replaces P-256 as the curve used for testing FROST.
This commit is contained in:
Luke Parker
2022-06-06 04:22:49 -04:00
parent e0ce6e5c12
commit 301634dd8e
12 changed files with 477 additions and 412 deletions

View File

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