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

@@ -16,7 +16,6 @@ pub trait Algorithm<C: Curve>: Clone {
/// Generate an addendum to FROST"s preprocessing stage
fn preprocess_addendum<R: RngCore + CryptoRng>(
&mut self,
rng: &mut R,
params: &sign::ParamsView<C>,
nonces: &[C::F; 2],
@@ -100,7 +99,6 @@ impl<C: Curve, H: Hram<C>> Algorithm<C> for Schnorr<C, H> {
}
fn preprocess_addendum<R: RngCore + CryptoRng>(
&mut self,
_: &mut R,
_: &sign::ParamsView<C>,
_: &[C::F; 2],

View File

@@ -70,7 +70,7 @@ impl<C: Curve, A: Algorithm<C>> Params<C, A> {
algorithm: A,
keys: Rc<MultisigKeys<C>>,
included: &[usize],
) -> Result<Params<C, A>, FrostError> {
) -> Result<Params<C, A>, FrostError> {
let mut included = included.to_vec();
(&mut included).sort_unstable();
@@ -126,6 +126,10 @@ impl<C: Curve, A: Algorithm<C>> Params<C, A> {
pub fn multisig_params(&self) -> MultisigParams {
self.keys.params
}
pub fn view(&self) -> ParamsView<C> {
self.view.clone()
}
}
struct PreprocessPackage<C: Curve> {
@@ -146,7 +150,7 @@ fn preprocess<R: RngCore + CryptoRng, C: Curve, A: Algorithm<C>>(
serialized.extend(&C::G_to_bytes(&commitments[1]));
serialized.extend(
&params.algorithm.preprocess_addendum(
&A::preprocess_addendum(
rng,
&params.view,
&nonces