Use a non-constant generator in FROST

This commit is contained in:
Luke Parker
2022-08-13 05:07:07 -04:00
parent 6f776ff004
commit 885d816309
12 changed files with 29 additions and 24 deletions

View File

@@ -28,7 +28,9 @@ macro_rules! dalek_curve {
type G = $Point;
const ID: &'static [u8] = $ID;
const GENERATOR: Self::G = $POINT;
fn generator() -> Self::G {
$POINT
}
fn hash_msg(msg: &[u8]) -> Vec<u8> {
Sha512::new()

View File

@@ -31,7 +31,9 @@ macro_rules! kp_curve {
type G = $lib::ProjectivePoint;
const ID: &'static [u8] = $ID;
const GENERATOR: Self::G = $lib::ProjectivePoint::GENERATOR;
fn generator() -> Self::G {
$lib::ProjectivePoint::GENERATOR
}
fn hash_msg(msg: &[u8]) -> Vec<u8> {
(&Sha256::new().chain($CONTEXT).chain(b"digest").chain(msg).finalize()).to_vec()

View File

@@ -53,7 +53,7 @@ pub trait Curve: Clone + Copy + PartialEq + Eq + Debug + Zeroize {
/// Generator for the group
// While group does provide this in its API, privacy coins may want to use a custom basepoint
const GENERATOR: Self::G;
fn generator() -> Self::G;
/// Hash the message for the binding factor. H3 from the IETF draft
// This doesn't actually need to be part of Curve as it does nothing with the curve