51 lines
1.4 KiB
Rust
51 lines
1.4 KiB
Rust
|
use frost_secp256k1::*;
|
||
|
use lazy_static::lazy_static;
|
||
|
use rand::thread_rng;
|
||
|
use serde_json::Value;
|
||
|
|
||
|
#[test]
|
||
|
fn check_sign_with_dkg() {
|
||
|
let rng = thread_rng();
|
||
|
|
||
|
frost_core::tests::ciphersuite_generic::check_sign_with_dkg::<Secp256K1Sha256, _>(rng);
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn check_rts() {
|
||
|
let rng = thread_rng();
|
||
|
|
||
|
frost_core::tests::repairable::check_rts::<Secp256K1Sha256, _>(rng);
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn check_sign_with_dealer() {
|
||
|
let rng = thread_rng();
|
||
|
|
||
|
frost_core::tests::ciphersuite_generic::check_sign_with_dealer::<Secp256K1Sha256, _>(rng);
|
||
|
}
|
||
|
|
||
|
/// This is testing that Shamir's secret sharing to compute and arbitrary
|
||
|
/// value is working.
|
||
|
#[test]
|
||
|
fn check_share_generation_secp256k1_sha256() {
|
||
|
let rng = thread_rng();
|
||
|
frost_core::tests::ciphersuite_generic::check_share_generation::<Secp256K1Sha256, _>(rng);
|
||
|
}
|
||
|
|
||
|
lazy_static! {
|
||
|
pub static ref VECTORS: Value =
|
||
|
serde_json::from_str(include_str!("../tests/helpers/vectors.json").trim())
|
||
|
.expect("Test vector is valid JSON");
|
||
|
pub static ref VECTORS_BIG_IDENTIFIER: Value =
|
||
|
serde_json::from_str(include_str!("../tests/helpers/vectors-big-identifier.json").trim())
|
||
|
.expect("Test vector is valid JSON");
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn check_sign_with_test_vectors() {
|
||
|
frost_core::tests::vectors::check_sign_with_test_vectors::<Secp256K1Sha256>(&VECTORS);
|
||
|
frost_core::tests::vectors::check_sign_with_test_vectors::<Secp256K1Sha256>(
|
||
|
&VECTORS_BIG_IDENTIFIER,
|
||
|
);
|
||
|
}
|