import BN from 'bn.js'; import ECSignature from './ecsignature'; import { type ECPoint } from './curve'; export declare function sign(hash: Buffer, d: BN, nonce?: number): ECSignature; export declare function verify(signature: ECSignature, hash: Buffer, Q: ECPoint): boolean; /** * Recover a public key from a signature. * * See SEC 1: Elliptic Curve Cryptography, section 4.1.6, "Public * Key Recovery Operation". * * http://www.secg.org/download/aid-780/sec1-v2.pdf */ export declare function recoverPubKey(e: BN, signature: ECSignature, i: number): ECPoint; /** * Calculate pubkey extraction parameter. * * When extracting a pubkey from a signature, we have to * distinguish four different cases. Rather than putting this * burden on the verifier, Bitcoin includes a 2-bit value with the * signature. * * This function simply tries all four cases and returns the value * that resulted in a successful pubkey recovery. */ export declare function calcPubKeyRecoveryParam(e: BN, signature: ECSignature, Q: ECPoint): number;