mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 20:59:23 +00:00
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:
@@ -12,7 +12,7 @@ use p256::{elliptic_curve::bigint::{Encoding, U384}, Scalar, ProjectivePoint};
|
||||
use crate::{
|
||||
CurveError, Curve,
|
||||
algorithm::Hram,
|
||||
tests::{curve::test_curve, vectors::{Vectors, vectors}}
|
||||
tests::{curve::test_curve, schnorr::test_schnorr, vectors::{Vectors, vectors}}
|
||||
};
|
||||
|
||||
const CONTEXT_STRING: &[u8] = b"FROST-P256-SHA256-v5";
|
||||
@@ -179,8 +179,13 @@ fn p256_curve() {
|
||||
test_curve::<_, P256>(&mut OsRng);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn p256_schnorr() {
|
||||
test_schnorr::<_, P256>(&mut OsRng);
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct IetfP256Hram {}
|
||||
pub struct IetfP256Hram;
|
||||
impl Hram<P256> for IetfP256Hram {
|
||||
#[allow(non_snake_case)]
|
||||
fn hram(R: &ProjectivePoint, A: &ProjectivePoint, m: &[u8]) -> Scalar {
|
||||
|
||||
Reference in New Issue
Block a user