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

    Class VerifyingKey<C>

    A valid verifying key for Schnorr signatures over a FROST Ciphersuite Group.

    This class wraps a group element that serves as the public key for signature verification. The element must not be the identity element of the group.

    Type Parameters

    • C extends Ciphersuite

      The ciphersuite type that defines the cryptographic parameters

    Index

    Methods

    • Internal

      Create a new VerifyingKey from the given element.

      This is an internal constructor that does not validate the element. Use deserialize() for safe construction from untrusted input.

      Type Parameters

      Parameters

      • ciphersuite: C

        The ciphersuite to use

      • element: Element<C>

        The group element

      Returns VerifyingKey<C>

      A new VerifyingKey

    • Create a VerifyingKey from a SigningKey.

      Computes the public key as: verifying_key = generator * signing_key

      Type Parameters

      Parameters

      • ciphersuite: C

        The ciphersuite to use

      • signingKey: SigningKey<C>

        The signing key to derive the verifying key from

      Returns VerifyingKey<C>

      The corresponding verifying key

    • Internal

      Computes the group public key given the group commitment.

      The verifying key is the first coefficient (constant term) of the verifiable secret sharing commitment polynomial.

      Type Parameters

      Parameters

      • ciphersuite: C

        The ciphersuite to use

      • commitment: VerifiableSecretSharingCommitmentLike<C>

        The verifiable secret sharing commitment

      Returns VerifyingKey<C>

      The verifying key derived from the commitment

      If the commitment is empty (IncorrectCommitment)

    • Deserialize a VerifyingKey from bytes.

      Type Parameters

      Parameters

      • ciphersuite: C

        The ciphersuite to use for deserialization

      • bytes: Uint8Array

        The serialized verifying key bytes

      Returns VerifyingKey<C>

      The deserialized VerifyingKey

      If deserialization fails or the element is invalid

    • Deserialize a VerifyingKey from a hex string.

      Type Parameters

      Parameters

      • ciphersuite: C

        The ciphersuite to use for deserialization

      • hex: string

        The hex-encoded verifying key

      Returns VerifyingKey<C>

      The deserialized VerifyingKey

      If the hex is invalid or deserialization fails

    • Serialize the VerifyingKey to bytes.

      Returns Uint8Array

      The serialized verifying key as a byte array

      If the element is the identity (should not happen for valid keys)

    • Serialize the VerifyingKey to a hex string.

      Returns string

      The hex-encoded verifying key

    • Internal

      Verify a signature with a pre-hashed challenge.

      This verifies the equation: h * (z * G - c * A - R) == 0

      where:

      • h is the cofactor
      • z is the signature response
      • G is the generator
      • c is the challenge
      • A is the verifying key (this element)
      • R is the signature commitment

      Parameters

      • challenge: ChallengeLike<C>

        The pre-computed challenge

      • signature: Signature<C>

        The signature to verify

      Returns void

      If the signature is invalid (InvalidSignature)

    • Verify a purported signature over a message made by this verification key.

      Uses the ciphersuite's verifySignature method if available (for Ciphersuite), otherwise falls back to the default verification implementation.

      Parameters

      • message: Uint8Array

        The message that was signed

      • signature: Signature<C>

        The signature to verify

      Returns void

      If the signature is invalid

    • Internal

      Default signature verification implementation.

      Computes the challenge and delegates to verifyPrehashed.

      Parameters

      • message: Uint8Array

        The message that was signed

      • signature: Signature<C>

        The signature to verify

      Returns void

      If the signature is invalid

    • Get the ciphersuite associated with this verifying key.

      Returns C

      The ciphersuite

    • Check equality with another VerifyingKey.

      Parameters

      Returns boolean

      true if the verifying keys are equal

    • Returns a debug string representation.

      Returns string

      A debug string with the hex-encoded key