import { PSSignatureParams } from './params'; import { VerifyResult, PSCommitmentOrMessage } from 'crypto-wasm-new'; import { PSPublicKey, PSSecretKey } from './keys'; import { BytearrayWrapper } from '../bytearray-wrapper'; import { Encoder, MessageEncoder } from '../encoder'; import { MessageStructure, SignedMessages } from '../types'; /** * Modified Pointcheval-Sanders signature used in `Coconut`. */ export declare class PSSignature 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 */ static generate(messages: Uint8Array[], secretKey: PSSecretKey, params: PSSignatureParams): PSSignature; /** * 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 */ verify(messages: Uint8Array[], publicKey: PSPublicKey, params: PSSignatureParams): VerifyResult; /** * Aggregates signatures received from participants. * @param signatures * @param h * @returns */ static aggregate(signatures: Map, h: Uint8Array): PSSignature; static signMessageObject(messages: Object, secretKey: PSSecretKey, labelOrParams: Uint8Array | PSSignatureParams, 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: PSPublicKey, labelOrParams: Uint8Array | PSSignatureParams, encoder: Encoder, useConstantTimeEncoding?: boolean): VerifyResult; } /** * Modified Pointcheval-Sanders blind signature used in `Coconut`. */ export declare class PSBlindSignature extends BytearrayWrapper { /** * Generate blinding for creating the commitment used in the request for blind signature * @param seed - Optional seed to serve as entropy for the blinding. */ static generateBlinding(seed?: Uint8Array): Uint8Array; /** * Generates a blind signature over the commitment of unrevealed messages and revealed messages * @param messages - Iterator producing blinded messages (commitments) or revealed messages * @param secretKey * @param h */ static generate(messages: Iterable, secretKey: PSSecretKey, h: Uint8Array): PSBlindSignature; /** * Unblind the blind signature to get a regular signature that can be verified * @param indexedBlindings * @param pk */ unblind(indexedBlindings: Map, pk: PSPublicKey, h: Uint8Array): PSSignature; /** * 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 h * @param blindings - If no blinding is provided for a message, a random blinding will be generated for each message and written to this map * @param blinding * @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: PSSignatureParams, h: Uint8Array, blindings: Map, blinding?: Uint8Array, revealedMessages?: Map): [Uint8Array, PSBlindSignatureRequest]; /** * Generate a blind signature from request * @param request * @param secretKey * @param h * @returns {PSBlindSignature} */ static fromRequest({ commitments, revealedMessages }: PSBlindSignatureRequest, secretKey: PSSecretKey, h: Uint8Array): PSBlindSignature; /** * 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 h * @param encoder */ static blindSignMessageObject(blindSigRequest: PSBlindSignatureRequest, revealedMessages: object, secretKey: PSSecretKey, msgStructure: MessageStructure, h: Uint8Array, encoder: Encoder): SignedMessages; private static combineRevealedAndBlindedMessages; } /** * Structure to send to the signer to request a blind signature for `Pointcheval-Sanders` scheme. */ export interface PSBlindSignatureRequest { /** * The commitment for the blinded messages */ commitment: Uint8Array; /** * The commitments for the blinded messages */ commitments: Map; /** * 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 messages */ revealedMessages: Map; } //# sourceMappingURL=signature.d.ts.map