@dedis/kyber
Version:
A typescript implementation of Kyber interfaces
47 lines (46 loc) • 1.56 kB
TypeScript
/// <reference types="node" />
import BN from "bn.js";
import { Point } from "../..";
import BN256Scalar from "../../pairing/scalar";
import Mask from "../mask";
export declare type BdnSignature = Buffer;
/**
* Generate the list of coefficients for the list of public keys
*
* @param pubkeys The list of public keys
* @return The list of coefficients as BigNumber
*/
export declare function hashPointToR(pubkeys: Point[]): BN[];
/**
* Aggregate the public keys of the mask
*
* @param mask The mask with the participation and the list of points
* @return The new point representing the aggregation
*/
export declare function aggregatePublicKeys(mask: Mask): Point;
/**
* Aggregate a list of signatures according to the given mask
*
* @param mask The mask with the participation
* @param sigs The signatures as bytes
* @return The new point representing the aggregation
*/
export declare function aggregateSignatures(mask: Mask, sigs: Buffer[]): Point;
/**
* Sign the message using the given secret
*
* @param msg The Message to sign
* @param secret The secret key
* @return The BDN signature
*/
export declare function sign(msg: Buffer, secret: BN256Scalar): BdnSignature;
/**
* Verify the given signature against the message using the mask
* to aggregate the public keys
*
* @param msg The message
* @param mask The mask with the public keys
* @param sig The signature as bytes
* @return true if the signature matches, false otherwise
*/
export declare function verify(msg: Buffer, mask: Mask, sig: Buffer): boolean;