import { BBSSignatureParams } from './params'; import { VerifyResult } from 'crypto-wasm-new'; import { BBSPublicKey, BBSSecretKey } from './keys'; import { BytearrayWrapper } from '../bytearray-wrapper'; import { Encoder, MessageEncoder } from '../encoder'; import { MessageStructure, SignedMessages } from '../types'; /** * `BBS` signature. */ export declare class BBSSignature extends MessageEncoder { /** * Signer creates a new signature * @param messages - Ordered list of messages. Order and contents should be kept same for both signer and verifier * @param secretKey * @param params * @param encodeMessages - If true, the messages are encoded as field elements otherwise they are assumed to be already encoded. */ static generate(messages: Uint8Array[], secretKey: BBSSecretKey, params: BBSSignatureParams, encodeMessages: boolean): BBSSignature; /** * Verify the signature * @param messages - Ordered list of messages. Order and contents should be kept same for both signer and verifier * @param publicKey * @param params * @param encodeMessages - If true, the messages are encoded as field elements otherwise they are assumed to be already encoded. */ verify(messages: Uint8Array[], publicKey: BBSPublicKey, params: BBSSignatureParams, encodeMessages: boolean): VerifyResult; static signMessageObject(messages: Object, secretKey: BBSSecretKey, labelOrParams: Uint8Array | BBSSignatureParams, encoder: Encoder): SignedMessages; /** * Verifies the signature on the given messages. Takes the messages as a JS object, flattens it, encodes the values similar * to signing and then verifies the signature. * @param messages * @param publicKey * @param labelOrParams * @param encoder * @param useConstantTimeEncoding */ verifyMessageObject(messages: object, publicKey: BBSPublicKey, labelOrParams: Uint8Array | BBSSignatureParams, encoder: Encoder, useConstantTimeEncoding?: boolean): VerifyResult; } export declare class BBSBlindSignature extends BytearrayWrapper { /** * Generates a blind signature over the commitment of unrevealed messages and revealed messages * @param commitment - Commitment over unrevealed messages sent by the requester of the blind signature. Its assumed that * the signers has verified the knowledge of committed messages * @param revealedMessages * @param secretKey * @param params * @param encodeMessages */ static generate(commitment: Uint8Array, revealedMessages: Map, secretKey: BBSSecretKey, params: BBSSignatureParams, encodeMessages: boolean): BBSBlindSignature; /** * Verify the signature * @param messages - Ordered list of messages. Order and contents should be kept same for both signer and verifier * @param publicKey * @param params * @param encodeMessages - If true, the messages are encoded as field elements otherwise they are assumed to be already encoded. */ verify(messages: Uint8Array[], publicKey: BBSPublicKey, params: BBSSignatureParams, encodeMessages: boolean): VerifyResult; /** * Generate a request for a blind signature * @param messagesToBlind - messages the requester wants to hide from the signer. The key of the map is the index of the * message as per the params. * @param params * @param encodeMessages * @param revealedMessages - Any messages that the requester wishes to inform the signer about. This is for informational * purpose only and has no cryptographic use. */ static generateRequest(messagesToBlind: Map, params: BBSSignatureParams, encodeMessages: boolean, revealedMessages?: Map): BBSBlindSignatureRequest; /** * Used by the signer to create a blind signature * @param blindSigRequest - The blind sig request sent by user. * @param revealedMessages - The messages known to the signer * @param secretKey * @param msgStructure * @param labelOrParams * @param encoder */ static blindSignMessageObject(blindSigRequest: BBSBlindSignatureRequest, revealedMessages: object, secretKey: BBSSecretKey, msgStructure: MessageStructure, labelOrParams: Uint8Array | BBSSignatureParams, encoder: Encoder): SignedMessages; /** * Generate a blind signature from request * @param request * @param secretKey * @param params * @returns {BBSBlindSignature} */ static fromRequest({ commitment, revealedMessages }: BBSBlindSignatureRequest, secretKey: BBSSecretKey, params: BBSSignatureParams): BBSBlindSignature; } /** * Structure to send to the signer to request a blind signature for `BBS` scheme. */ export interface BBSBlindSignatureRequest { /** * The commitment to the blinded messages */ commitment: Uint8Array; /** * The messages at these indices were committed to in the commitment and are not revealed to the signer. This is expected * to be sorted in ascending order */ blindedIndices: number[]; /** * The messages which are known to the signer. Here the key is message index (as per the `SignatureParams`). This is not * mandatory as the signer might already know the messages to sign. This is used when the requester wants to inform the * signer of some or all of the message */ revealedMessages?: Map; } //# sourceMappingURL=signature.d.ts.map