UNPKG

@nikkolasg/noble-bls12-381

Version:

Noble BLS12-381 pairing-friendly curve. High-security, easily auditable, 0-dep aggregated signatures & pubkey.

24 lines (23 loc) 1.31 kB
import { Point } from "./point"; import { Group } from "./group"; import { BigintTuple } from "./fp2"; import { BigintTwelve } from "./fp12"; import { Hash, Bytes } from "./utils"; export { Fp } from "./fp"; export { Fp2 } from "./fp2"; export { Fp12 } from "./fp12"; export { Point } from "./point"; export { P, PRIME_ORDER } from "./utils"; declare type PrivateKey = Bytes | bigint | number; declare type Domain = PrivateKey; declare type PublicKey = Bytes; declare type Signature = Bytes; export declare const G1: Point<bigint>; export declare const G2: Point<BigintTuple>; export declare function pairing(Q: Point<BigintTuple>, P: Point<bigint>, withFinalExponent?: boolean): Group<BigintTwelve>; export declare function getPublicKey(privateKey: PrivateKey): Uint8Array; export declare function sign(message: Hash, privateKey: PrivateKey, domain: Domain): Promise<Uint8Array>; export declare function verify(message: Hash, publicKey: PublicKey, signature: Signature, domain: Domain): Promise<boolean>; export declare function aggregatePublicKeys(publicKeys: PublicKey[]): Uint8Array; export declare function aggregateSignatures(signatures: Signature[]): Uint8Array; export declare function verifyMultiple(messages: Hash[], publicKeys: PublicKey[], signature: Signature, domain: Domain): Promise<boolean>;