39 lines
1.0 KiB
Rust
39 lines
1.0 KiB
Rust
use frost_core::{Ciphersuite, Group};
|
|
use frost_p256::*;
|
|
use rand::thread_rng;
|
|
|
|
#[test]
|
|
fn check_sign_with_dealer() {
|
|
let rng = thread_rng();
|
|
|
|
frost_core::tests::check_sign_with_dealer::<P256Sha256, _>(rng);
|
|
}
|
|
|
|
// TODO: re-enable after batch is changed to work with big-endian scalars
|
|
// #[test]
|
|
#[allow(unused)]
|
|
fn check_batch_verify() {
|
|
let rng = thread_rng();
|
|
|
|
frost_core::tests::batch::batch_verify::<P256Sha256, _>(rng);
|
|
}
|
|
|
|
// TODO: re-enable after batch is changed to work with big-endian scalars
|
|
// #[test]
|
|
#[allow(unused)]
|
|
fn check_bad_batch_verify() {
|
|
let rng = thread_rng();
|
|
|
|
frost_core::tests::batch::bad_batch_verify::<P256Sha256, _>(rng);
|
|
}
|
|
|
|
#[test]
|
|
fn check_deserialize_identity() {
|
|
// The identity is actually encoded as a single byte; but the API does not
|
|
// allow us to change that. Try to send something similar.
|
|
let encoded_identity = [0u8; 33];
|
|
|
|
let r = <<P256Sha256 as Ciphersuite>::Group as Group>::deserialize(&encoded_identity);
|
|
assert_eq!(r, Err(Error::MalformedElement));
|
|
}
|