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

    Class SignatureCase<C>

    A signature test-case, containing signature data and expected validity. Ported from SignatureCase struct in proptests.rs

    This class encapsulates a message, signature, and verifying key, along with methods to apply "tweaks" that should invalidate the signature. The check() method verifies that the signature verification result matches expectations.

    Type Parameters

    Index

    Accessors

    • get isValid(): boolean

      Get the current validity expectation.

      Returns boolean

    • get message(): Uint8Array

      Get the message.

      Returns Uint8Array

    • get signature(): Signature<C>

      Get the signature.

      Returns Signature<C>

    • get ciphersuite(): C

      Get the ciphersuite.

      Returns C

    Methods

    • Create a new SignatureCase. Generates a random signing key, signs the message, and creates an invalid verifying key for testing the ChangePubkey tweak.

      Type Parameters

      Parameters

      • ciphersuite: C

        The ciphersuite to use

      • rng: CryptoRng

        A cryptographically secure random number generator

      • msg: Uint8Array

        The message to sign

      Returns SignatureCase<C>

      A new SignatureCase

    • Check that signature verification succeeds or fails, as expected.

      This method exercises the round-trip serialization/deserialization code paths for both signatures and verifying keys.

      Returns boolean

      true if the verification result matches the expected validity

    • Apply the given tweak to the signature test case.

      Parameters

      • tweak: Tweak

        The modification to apply

      Returns void