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

@@ -1,9 +1,6 @@
use rand_core::{RngCore, CryptoRng};
use crate::{
Curve, MultisigKeys,
tests::{schnorr::{sign, verify, batch_verify}, key_gen}
};
use crate::{Curve, MultisigKeys, tests::key_gen};
// Test generation of FROST keys
fn key_generation<R: RngCore + CryptoRng, C: Curve>(rng: &mut R) {
@@ -21,13 +18,6 @@ fn keys_serialization<R: RngCore + CryptoRng, C: Curve>(rng: &mut R) {
pub fn test_curve<R: RngCore + CryptoRng, C: Curve>(rng: &mut R) {
// TODO: Test the Curve functions themselves
// Test Schnorr signatures work as expected
// This is a bit unnecessary, as they should for any valid curve, yet this provides tests with
// meaning, which the above tests won't have
sign::<_, C>(rng);
verify::<_, C>(rng);
batch_verify::<_, C>(rng);
// Test FROST key generation and serialization of MultisigKeys works as expected
key_generation::<_, C>(rng);
keys_serialization::<_, C>(rng);