Wraps a bytearray, i.e. Uint8Array. Used to give distinct types to objects as most of them are bytearrays because that is what the WASM bindings accept and return.

Hierarchy (view full)

Constructors

Properties

value: Uint8Array

Accessors

  • get bytes(): Uint8Array
  • Return the wrapped bytearray

    Returns Uint8Array

  • get hex(): string
  • Return the hex representation of the wrapped bytearray

    Returns string

  • get length(): number
  • Return the length of the wrapped bytearray

    Returns number

Methods

  • Verify the signature

    Parameters

    • messages: Uint8Array[]

      Ordered list of messages. Order and contents should be kept same for both signer and verifier

    • publicKey: BBSPublicKey
    • params: BBSSignatureParams
    • encodeMessages: boolean

      If true, the messages are encoded as field elements otherwise they are assumed to be already encoded.

    Returns VerifyResult

  • Generates a blind signature over the commitment of unrevealed messages and revealed messages

    Parameters

    • commitment: Uint8Array

      Commitment over unrevealed messages sent by the requester of the blind signature. Its assumed that the signers has verified the knowledge of committed messages

    • revealedMessages: Map<number, Uint8Array>
    • secretKey: BBSSecretKey
    • params: BBSSignatureParams
    • encodeMessages: boolean

    Returns BBSBlindSignature

  • Generate a request for a blind signature

    Parameters

    • messagesToBlind: Map<number, Uint8Array>

      messages the requester wants to hide from the signer. The key of the map is the index of the message as per the params.

    • params: BBSSignatureParams
    • encodeMessages: boolean
    • OptionalrevealedMessages: Map<number, Uint8Array>

      Any messages that the requester wishes to inform the signer about. This is for informational purpose only and has no cryptographic use.

    Returns BBSBlindSignatureRequest