Various corrections to multisig API

This commit is contained in:
Luke Parker
2022-04-29 15:28:04 -04:00
parent 3a4971f28b
commit 45559e14ee
10 changed files with 169 additions and 134 deletions

View File

@@ -2,13 +2,14 @@
use std::rc::Rc;
use rand_core::{RngCore, CryptoRng};
use rand::rngs::OsRng;
use ff::Field;
use dalek_ff_group::{ED25519_BASEPOINT_TABLE, Scalar};
use dalek_ff_group::{ED25519_BASEPOINT_TABLE, Scalar, EdwardsPoint};
use frost::{
MultisigParams, MultisigKeys,
FrostError, MultisigParams, MultisigKeys,
key_gen, algorithm::Algorithm, sign::{self, lagrange}
};
@@ -17,6 +18,49 @@ use monero_serai::frost::Ed25519;
pub const THRESHOLD: usize = 5;
pub const PARTICIPANTS: usize = 8;
#[derive(Clone)]
pub struct DummyAlgorithm;
impl Algorithm<Ed25519> for DummyAlgorithm {
type Signature = ();
fn addendum_commit_len() -> usize { unimplemented!() }
fn preprocess_addendum<R: RngCore + CryptoRng>(
_: &mut R,
_: &sign::ParamsView<Ed25519>,
_: &[Scalar; 2],
) -> Vec<u8> { unimplemented!() }
fn process_addendum(
&mut self,
_: &sign::ParamsView<Ed25519>,
_: usize,
_: &[EdwardsPoint; 2],
_: &[u8],
) -> Result<(), FrostError> { unimplemented!() }
fn context(&self) -> Vec<u8> { unimplemented!() }
fn process_binding(&mut self, _: &Scalar) { unimplemented!() }
fn sign_share(
&mut self,
_: &sign::ParamsView<Ed25519>,
_: EdwardsPoint,
_: Scalar,
_: &[u8],
) -> Scalar { unimplemented!() }
fn verify(&self, _: EdwardsPoint, _: EdwardsPoint, _: Scalar) -> Option<Self::Signature> { unimplemented!() }
fn verify_share(
&self,
_: EdwardsPoint,
_: EdwardsPoint,
_: Scalar,
) -> bool { unimplemented!() }
}
pub fn generate_keys() -> (Vec<Rc<MultisigKeys<Ed25519>>>, Scalar) {
let mut params = vec![];
let mut machines = vec![];