import BN from 'bn.js'; import ECSignature from './ecsignature'; import { ec as EC } from 'elliptic'; type ECInstance = EC; type ECPoint = ReturnType; export declare function sign(curve: ECInstance, hash: Buffer, d: BN, nonce?: number): ECSignature; export declare function verify(curve: ECInstance, hash: Buffer, signature: ECSignature, 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(curve: ECInstance, 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(curve: ECInstance, e: BN, signature: ECSignature, Q: ECPoint): number; export {};