UNPKG

bitcoinpqc

Version:

NodeJS TypeScript bindings for Bitcoin PQC library

76 lines (75 loc) 2.09 kB
/** * Bitcoin PQC algorithm identifiers */ export declare enum Algorithm { /** BIP-340 Schnorr + X-Only - Elliptic Curve Digital Signature Algorithm */ SECP256K1_SCHNORR = 0, /** FN-DSA-512 (FALCON) - Fast Fourier lattice-based signature scheme */ FN_DSA_512 = 1, /** ML-DSA-44 (CRYSTALS-Dilithium) - Lattice-based signature scheme */ ML_DSA_44 = 2, /** SLH-DSA-Shake-128s (SPHINCS+) - Hash-based signature scheme */ SLH_DSA_SHAKE_128S = 3 } /** * Error types for PQC operations */ export declare enum ErrorCode { /** Operation completed successfully */ OK = 0, /** Invalid arguments provided */ BAD_ARGUMENT = -1, /** Invalid key provided */ BAD_KEY = -2, /** Invalid signature provided */ BAD_SIGNATURE = -3, /** Algorithm not implemented */ NOT_IMPLEMENTED = -4 } /** * Error class for PQC operations */ export declare class PqcError extends Error { readonly code: ErrorCode; constructor(code: ErrorCode, message?: string); } /** * Public key wrapper */ export declare class PublicKey { /** The algorithm this key belongs to */ readonly algorithm: Algorithm; /** The raw key bytes */ readonly bytes: Uint8Array; constructor(algorithm: Algorithm, bytes: Uint8Array); } /** * Secret key wrapper */ export declare class SecretKey { /** The algorithm this key belongs to */ readonly algorithm: Algorithm; /** The raw key bytes */ readonly bytes: Uint8Array; constructor(algorithm: Algorithm, bytes: Uint8Array); } /** * Signature wrapper */ export declare class Signature { /** The algorithm this signature belongs to */ readonly algorithm: Algorithm; /** The raw signature bytes */ readonly bytes: Uint8Array; constructor(algorithm: Algorithm, bytes: Uint8Array); } /** * Key pair containing both public and secret keys */ export declare class KeyPair { /** The public key */ readonly publicKey: PublicKey; /** The secret key */ readonly secretKey: SecretKey; constructor(publicKey: PublicKey, secretKey: SecretKey); }