2022-12-13 20:25:32 -05:00
|
|
|
use rand_core::OsRng;
|
2022-06-05 16:08:51 -04:00
|
|
|
|
2022-07-12 03:20:50 -04:00
|
|
|
use crate::tests::vectors::{Vectors, test_with_vectors};
|
|
|
|
|
|
2022-06-24 08:44:12 -04:00
|
|
|
#[cfg(feature = "secp256k1")]
|
2022-08-26 05:59:43 -04:00
|
|
|
use crate::curve::{Secp256k1, IetfSecp256k1Hram};
|
2022-06-05 16:08:51 -04:00
|
|
|
|
2022-06-06 04:22:49 -04:00
|
|
|
#[cfg(feature = "p256")]
|
2022-06-24 19:47:19 -04:00
|
|
|
use crate::curve::{P256, IetfP256Hram};
|
2022-06-05 16:08:51 -04:00
|
|
|
|
2022-06-24 08:44:12 -04:00
|
|
|
#[cfg(feature = "secp256k1")]
|
2022-06-05 16:08:51 -04:00
|
|
|
#[test]
|
2022-08-29 02:32:59 -05:00
|
|
|
fn secp256k1_vectors() {
|
2022-08-26 05:59:43 -04:00
|
|
|
test_with_vectors::<_, Secp256k1, IetfSecp256k1Hram>(
|
2022-07-12 03:20:50 -04:00
|
|
|
&mut OsRng,
|
2023-12-17 00:01:41 -05:00
|
|
|
&Vectors::from(
|
2022-10-13 00:38:36 -04:00
|
|
|
serde_json::from_str::<serde_json::Value>(include_str!(
|
|
|
|
|
"vectors/frost-secp256k1-sha256.json"
|
|
|
|
|
))
|
|
|
|
|
.unwrap(),
|
|
|
|
|
),
|
2022-07-12 03:20:50 -04:00
|
|
|
);
|
2022-06-05 16:08:51 -04:00
|
|
|
}
|
|
|
|
|
|
2022-06-06 04:22:49 -04:00
|
|
|
#[cfg(feature = "p256")]
|
2022-06-05 16:08:51 -04:00
|
|
|
#[test]
|
|
|
|
|
fn p256_vectors() {
|
2022-06-06 04:22:49 -04:00
|
|
|
test_with_vectors::<_, P256, IetfP256Hram>(
|
|
|
|
|
&mut OsRng,
|
2023-12-17 00:01:41 -05:00
|
|
|
&Vectors::from(
|
2022-10-13 00:38:36 -04:00
|
|
|
serde_json::from_str::<serde_json::Value>(include_str!("vectors/frost-p256-sha256.json"))
|
|
|
|
|
.unwrap(),
|
|
|
|
|
),
|
2022-06-05 16:08:51 -04:00
|
|
|
);
|
|
|
|
|
}
|