Clean up code, correct a few bugs, add leader based one-time-key/BP gen

This commit is contained in:
Luke Parker
2022-04-28 20:09:31 -04:00
parent c4b7cb71d7
commit 1d0a0c7c16
6 changed files with 253 additions and 114 deletions

View File

@@ -1,6 +1,4 @@
use rand_core::{RngCore, CryptoRng};
use ff::Field;
use thiserror::Error;
use curve25519_dalek::{
@@ -171,7 +169,7 @@ pub(crate) fn sign_core<R: RngCore + CryptoRng>(
let mut s = vec![];
s.resize(n, Scalar::zero());
while i != r {
s[i] = dalek_ff_group::Scalar::random(&mut *rng).0;
s[i] = random_scalar(&mut *rng);
let c_p = mu_P * c;
let c_c = mu_C * c;

View File

@@ -9,7 +9,6 @@ use curve25519_dalek::{
edwards::EdwardsPoint
};
use ff::Field;
use group::Group;
use dalek_ff_group as dfg;
use frost::{Curve, FrostError, algorithm::Algorithm, sign::ParamsView};
@@ -17,6 +16,7 @@ use frost::{Curve, FrostError, algorithm::Algorithm, sign::ParamsView};
use monero::util::ringct::{Key, Clsag};
use crate::{
random_scalar,
hash_to_point,
frost::{MultisigError, Ed25519, DLEqProof},
clsag::{Input, sign_core, verify}
@@ -154,7 +154,7 @@ impl Algorithm<Ed25519> for Multisig {
seed.extend(&self.context());
seed.extend(&self.b);
let mut rng = ChaCha12Rng::from_seed(Blake2b512::digest(seed)[0 .. 32].try_into().unwrap());
let mask = dfg::Scalar::random(&mut rng).0;
let mask = random_scalar(&mut rng);
#[allow(non_snake_case)]
let (clsag, c, mu_C, z, mu_P, C_out) = sign_core(