Lint FROST

Corrects ertrors introduced a couple commits ago as well.
This commit is contained in:
Luke Parker 2022-08-13 08:50:30 -04:00
parent 454b73aec3
commit 280fc441a7
No known key found for this signature in database
GPG key ID: F9F1386DB1E119B6
4 changed files with 6 additions and 6 deletions

View file

@ -28,6 +28,7 @@ macro_rules! dalek_curve {
type G = $Point;
const ID: &'static [u8] = $ID;
fn generator() -> Self::G {
$POINT
}

View file

@ -31,6 +31,7 @@ macro_rules! kp_curve {
type G = $lib::ProjectivePoint;
const ID: &'static [u8] = $ID;
fn generator() -> Self::G {
$lib::ProjectivePoint::GENERATOR
}

View file

@ -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>;

View file

@ -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() }
));
}