FROST Rerandomized TypeScript Library - v0.2.2-alpha.3
    Preparing search index...

    Class Randomizer<C>

    A randomizer. A random scalar which is used to randomize the key.

    Type Parameters

    Index

    Methods

    • Create a new Randomizer from the given scalar.

      The scalar MUST be randomly generated. It is not recommended to use this method unless for compatibility reasons with specifications on how the randomizer must be generated. Use newFromCommitments() instead.

      Type Parameters

      Parameters

      • ciphersuite: C

        The ciphersuite to use

      • scalar: Scalar<C>

        The scalar value (must be randomly generated)

      Returns Randomizer<C>

      A new Randomizer

    • Create a new random Randomizer using SigningCommitments for randomness.

      The SigningCommitments map must be the one being used in the current FROST signing run (built by the Coordinator after receiving from Participants). It is hashed into the randomizer calculation, which binds it to that specific commitments.

      Returns the Randomizer and the generated randomizer seed. Both can be used to regenerate the Randomizer with regenerateFromSeedAndCommitments().

      Type Parameters

      Parameters

      • ciphersuite: C

        The ciphersuite to use (must support rerandomization)

      • rng: { fill(array: Uint8Array): void }

        A cryptographically secure random number generator

      • signingCommitments: Map<Identifier<C>, SigningCommitments<C>>

        Map of identifier to signing commitments

      Returns [Randomizer<C>, Uint8Array<ArrayBufferLike>]

      A tuple of [Randomizer, randomizer seed bytes]

      If randomizer generation fails

    • Regenerates a Randomizer generated with newFromCommitments().

      This can be used by Participants after receiving the randomizer seed and commitments in Round 2. This is better than the Coordinator simply generating a Randomizer and sending it to Participants, because in this approach the participants don't need to fully trust the Coordinator's random number generator (i.e. even if the randomizer seed was not randomly generated the randomizer will still be).

      This should be used exclusively with the output of newFromCommitments(); it is strongly suggested to not attempt generating the randomizer seed yourself (even if the point of this approach is to hedge against issues in the randomizer seed generation).

      Type Parameters

      Parameters

      • ciphersuite: C

        The ciphersuite to use (must support rerandomization)

      • randomizerSeed: Uint8Array

        The randomizer seed bytes from newFromCommitments()

      • signingCommitments: Map<Identifier<C>, SigningCommitments<C>>

        Map of identifier to signing commitments

      Returns Randomizer<C>

      The regenerated Randomizer

      If regeneration fails

    • Serialize the randomizer using the ciphersuite encoding.

      Returns Uint8Array

      The serialized randomizer bytes

    • Deserialize a Randomizer from a serialized buffer.

      Type Parameters

      Parameters

      • ciphersuite: C

        The ciphersuite to use

      • buf: Uint8Array

        The bytes to deserialize

      Returns Randomizer<C>

      The deserialized Randomizer

      If deserialization fails or attempts to deserialize zero