Generalize out the FROST test for signing/signing with an offset

Moves Schnorr signature tests from test_curve to the new test_schnorr, 
which is more a test_frost.

Relevant to https://github.com/serai-dex/serai/issues/9.
This commit is contained in:
Luke Parker
2022-06-03 19:08:25 -04:00
parent 33241a5bb6
commit 9b52cf4d20
7 changed files with 83 additions and 66 deletions

View File

@@ -3,15 +3,24 @@ use rand::rngs::OsRng;
use sha2::Sha512;
use dalek_ff_group as dfg;
use frost::{Curve, algorithm::Hram, tests::{curve::test_curve, vectors::{Vectors, vectors}}};
use frost::{
Curve,
algorithm::Hram,
tests::{curve::test_curve, schnorr::test_schnorr, vectors::{Vectors, vectors}}
};
use crate::frost::{Ed25519, Ed25519Internal};
#[test]
fn frost_ed25519() {
fn frost_ed25519_curve() {
test_curve::<_, Ed25519>(&mut OsRng);
}
#[test]
fn frost_ed25519_schnorr() {
test_schnorr::<_, Ed25519>(&mut OsRng);
}
// Not spec-compliant, as this shouldn't use wide reduction
// Is vectors compliant, which is why the below tests pass
// See https://github.com/cfrg/draft-irtf-cfrg-frost/issues/204