mirror of
https://github.com/serai-dex/serai.git
synced 2025-01-03 17:40:34 +00:00
Lint FROST
Corrects ertrors introduced a couple commits ago as well.
This commit is contained in:
parent
454b73aec3
commit
280fc441a7
4 changed files with 6 additions and 6 deletions
|
@ -28,6 +28,7 @@ macro_rules! dalek_curve {
|
|||
type G = $Point;
|
||||
|
||||
const ID: &'static [u8] = $ID;
|
||||
|
||||
fn generator() -> Self::G {
|
||||
$POINT
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ macro_rules! kp_curve {
|
|||
type G = $lib::ProjectivePoint;
|
||||
|
||||
const ID: &'static [u8] = $ID;
|
||||
|
||||
fn generator() -> Self::G {
|
||||
$lib::ProjectivePoint::GENERATOR
|
||||
}
|
||||
|
|
|
@ -27,8 +27,6 @@ pub use kp256::{P256, IetfP256Hram};
|
|||
/// Set of errors for curve-related operations, namely encoding and decoding
|
||||
#[derive(Clone, Error, Debug)]
|
||||
pub enum CurveError {
|
||||
#[error("invalid length for data (expected {0}, got {0})")]
|
||||
InvalidLength(usize, usize),
|
||||
#[error("invalid scalar")]
|
||||
InvalidScalar,
|
||||
#[error("invalid point")]
|
||||
|
@ -59,8 +57,8 @@ pub trait Curve: Clone + Copy + PartialEq + Eq + Debug + Zeroize {
|
|||
// This doesn't actually need to be part of Curve as it does nothing with the curve
|
||||
// This also solely relates to FROST and with a proper Algorithm/HRAM, all projects using
|
||||
// aggregatable signatures over this curve will work without issue
|
||||
// It is kept here as Curve + H{1, 2, 3} is effectively a ciphersuite according to the IETF draft
|
||||
// and moving it to Schnorr would force all of them into being ciphersuite-specific
|
||||
// It is kept here as Curve + H{1, 2, 3, 4} is effectively a ciphersuite according to the IETF
|
||||
// draft and moving it to Schnorr would force all of them into being ciphersuite-specific
|
||||
// H2 is left to the Schnorr Algorithm as H2 is the H used in HRAM, which Schnorr further
|
||||
// modularizes
|
||||
fn hash_msg(msg: &[u8]) -> Vec<u8>;
|
||||
|
|
|
@ -2,7 +2,7 @@ use std::{marker::PhantomData, collections::HashMap};
|
|||
|
||||
use rand_core::{RngCore, CryptoRng};
|
||||
|
||||
use group::{ff::Field, GroupEncoding};
|
||||
use group::{ff::Field, Group, GroupEncoding};
|
||||
|
||||
use crate::{
|
||||
Curve, FrostKeys,
|
||||
|
@ -29,7 +29,7 @@ pub(crate) fn core_verify<R: RngCore + CryptoRng, C: Curve>(rng: &mut R) {
|
|||
assert!(!schnorr::verify::<C>(
|
||||
C::generator() * C::F::random(&mut *rng),
|
||||
C::F::random(rng),
|
||||
&SchnorrSignature { R: C::identity(), s: C::F::zero() }
|
||||
&SchnorrSignature { R: C::G::identity(), s: C::F::zero() }
|
||||
));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue