Update to FROST v10

Further expands documentation to near-completion.
This commit is contained in:
Luke Parker
2022-09-29 07:08:20 -04:00
parent 7870084b9e
commit 2b7c9378c0
16 changed files with 95 additions and 65 deletions

View File

@@ -60,6 +60,7 @@ fn transcript<G: GroupEncoding>(key: G, i: u16) -> RecommendedTranscript {
transcript
}
/// Proof of valid promotion to another generator.
#[derive(Clone, Copy)]
pub struct GeneratorProof<C: Curve> {
share: C::G,
@@ -80,18 +81,21 @@ impl<C: Curve> GeneratorProof<C> {
}
}
/// Promote a set of keys from one curve to another, where the elliptic curve is the same.
/// Since the Curve trait additionally specifies a generator, this provides an O(n) way to update
/// the generator used with keys. The key generation protocol itself is exponential.
pub struct GeneratorPromotion<C1: Curve, C2: Curve> {
base: FrostKeys<C1>,
proof: GeneratorProof<C1>,
_c2: PhantomData<C2>,
}
/// Promote a set of keys from one generator to another.
// The linear DLEq proofs are much more efficient than an exponential key gen
impl<C1: Curve, C2: Curve> GeneratorPromotion<C1, C2>
where
C2: Curve<F = C1::F, G = C1::G>,
{
/// Begin promoting keys from one curve to another. Returns a proof this share was properly
/// promoted.
pub fn promote<R: RngCore + CryptoRng>(
rng: &mut R,
base: FrostKeys<C1>,
@@ -110,6 +114,7 @@ where
(GeneratorPromotion { base, proof, _c2: PhantomData::<C2> }, proof)
}
/// Complete promotion by taking in the proofs from all other participants.
pub fn complete(
self,
proofs: &HashMap<u16, GeneratorProof<C1>>,