/**
 * bitflags used in secp256k1's public API (translated from secp256k1.h)
 */ /** All flags' lower 8 bits indicate what they're for. Do not use directly. */ const SECP256K1_FLAGS_TYPE_CONTEXT = 1 << 0 ; const SECP256K1_FLAGS_TYPE_COMPRESSION = 1 << 1 ; /** The higher bits contain the actual data. Do not use directly. */ const SECP256K1_FLAGS_BIT_CONTEXT_VERIFY = 1 << 8 ; const SECP256K1_FLAGS_BIT_CONTEXT_SIGN = 1 << 9 ; const SECP256K1_FLAGS_BIT_COMPRESSION = 1 << 8 ; /** Flags to pass to secp256k1_context_create. */ const SECP256K1_CONTEXT_VERIFY = SECP256K1_FLAGS_TYPE_CONTEXT | SECP256K1_FLAGS_BIT_CONTEXT_VERIFY ; const SECP256K1_CONTEXT_SIGN = SECP256K1_FLAGS_TYPE_CONTEXT | SECP256K1_FLAGS_BIT_CONTEXT_SIGN ; const SECP256K1_CONTEXT_NONE = SECP256K1_FLAGS_TYPE_CONTEXT ; /** Flag to pass to secp256k1_ec_pubkey_serialize and secp256k1_ec_privkey_export. */ const SECP256K1_EC_COMPRESSED = SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION ; const SECP256K1_EC_UNCOMPRESSED = SECP256K1_FLAGS_TYPE_COMPRESSION ; /**
 * Flag to pass to a Secp256k1.contextCreate method.
 *
 * The purpose of context structures is to cache large precomputed data tables
 * that are expensive to construct, and also to maintain the randomization data
 * for blinding.
 *
 * You can create a context with only VERIFY or only SIGN capabilities, or you
 * can use BOTH. (NONE can be used for conversion/serialization.)
 */ export enum ContextFlag { NONE = SECP256K1_CONTEXT_NONE as 1 , VERIFY = SECP256K1_CONTEXT_VERIFY as 257 , SIGN = SECP256K1_CONTEXT_SIGN as 513 , BOTH = SECP256K1_CONTEXT_SIGN | ( SECP256K1_CONTEXT_VERIFY as 769 ) } /**
 * Flag to pass a Secp256k1 public key serialization method.
 *
 * You can indicate COMPRESSED (33 bytes, header byte 0x02 or 0x03) or
 * UNCOMPRESSED (65 bytes, header byte 0x04) format.
 */ export enum CompressionFlag { COMPRESSED = SECP256K1_EC_COMPRESSED as 258 , UNCOMPRESSED = SECP256K1_EC_UNCOMPRESSED as 2 } /**
 * An object which wraps the WebAssembly implementation of `libsecp256k1`.
 *
 * Because WebAssembly modules are dynamically-instantiated at runtime, this
 * object must be created and awaited from `instantiateSecp256k1Wasm` or
 * `instantiateSecp256k1WasmBytes`.
 *
 * **It's very unlikely that consumers will need to use this interface directly.
 * See [[Secp256k1]] for a more purely-functional API.**
 */ export interface Secp256k1Wasm { param context readonly contextCreate : ( context : ContextFlag ) => number ; param contextPtr param seedPtr readonly contextRandomize : ( contextPtr : number , seedPtr : number ) => 1 | 0 ; param pointer readonly free : ( pointer : number ) => number ; readonly heapU32 : Uint32Array ; readonly heapU8 : Uint8Array ; readonly instance : WebAssembly . Instance ; param malloc readonly malloc : ( bytes : number ) => number ; param value readonly mallocSizeT : ( value : number ) => number ; param array readonly mallocUint8Array : ( array : Uint8Array ) => number ; param contextPtr param secretKeyPtr param tweakNum256Ptr readonly privkeyTweakAdd : ( contextPtr : number , secretKeyPtr : number , tweakNum256Ptr : number ) => 1 | 0 ; param contextPtr param secretKeyPtr param tweakNum256Ptr readonly privkeyTweakMul : ( contextPtr : number , secretKeyPtr : number , tweakNum256Ptr : number ) => 1 | 0 ; param contextPtr param publicKeyPtr param secretKeyPtr readonly pubkeyCreate : ( contextPtr : number , publicKeyPtr : number , secretKeyPtr : number ) => 1 | 0 ; param contextPtr param publicKeyOutPtr param publicKeyInPtr param publicKeyInLength readonly pubkeyParse : ( contextPtr : number , publicKeyOutPtr : number , publicKeyInPtr : number , publicKeyInLength : 33 | 65 ) => 1 | 0 ; param contextPtr param outputPtr param outputLengthPtr param publicKeyPtr param compression readonly pubkeySerialize : ( contextPtr : number , outputPtr : number , outputLengthPtr : number , publicKeyPtr : number , compression : CompressionFlag ) => 1 ; param contextPtr param publicKeyPtr param tweakNum256Ptr readonly pubkeyTweakAdd : ( contextPtr : number , publicKeyPtr : number , tweakNum256Ptr : number ) => 1 | 0 ; param contextPtr param publicKeyPtr param tweakNum256Ptr readonly pubkeyTweakMul : ( contextPtr : number , publicKeyPtr : number , tweakNum256Ptr : number ) => 1 | 0 ; param pointer param bytes readonly readHeapU8 : ( pointer : number , bytes : number ) => Uint8Array ; param pointer readonly readSizeT : ( pointer : number ) => number ; param contextPtr param publicKeyPtr param rSigPtr param msg32Ptr readonly recover : ( contextPtr : number , publicKeyPtr : number , rSigPtr : number , msg32Ptr : number ) => 1 | 0 ; param contextPtr param outputRSigPtr param inputSigPtr param rid readonly recoverableSignatureParse : ( contextPtr : number , outputRSigPtr : number , inputSigPtr : number , rid : number ) => 1 | 0 ; param contextPtr param sigOutPtr param recIDOutPtr param rSigPtr readonly recoverableSignatureSerialize : ( contextPtr : number , sigOutPtr : number , recIDOutPtr : number , rSigPtr : number ) => 1 ; param contextPtr param outputSigPtr param msg32Ptr param secretKeyPtr readonly schnorrSign : ( contextPtr : number , outputSigPtr : number , msg32Ptr : number , secretKeyPtr : number ) => 1 | 0 ; param contextPtr param sigPtr param msg32Ptr param pubkeyPtr readonly schnorrVerify : ( contextPtr : number , sigPtr : number , msg32Ptr : number , publicKeyPtr : number ) => 1 | 0 ; param contextPtr param secretKeyPtr readonly seckeyVerify : ( contextPtr : number , secretKeyPtr : number ) => 1 | 0 ; param contextPtr param outputSigPtr param msg32Ptr param secretKeyPtr readonly sign : ( contextPtr : number , outputSigPtr : number , msg32Ptr : number , secretKeyPtr : number ) => 1 | 0 ; param contextPtr param outputSigPtr param inputSigPtr readonly signatureMalleate : ( contextPtr : number , outputSigPtr : number , inputSigPtr : number ) => 1 ; param contextPtr param outputSigPtr param inputSigPtr readonly signatureNormalize : ( contextPtr : number , outputSigPtr : number , inputSigPtr : number ) => 1 | 0 ; param contextPtr param sigOutPtr param compactSigInPtr readonly signatureParseCompact : ( contextPtr : number , sigOutPtr : number , compactSigInPtr : number ) => 1 | 0 ; param contextPtr param sigOutPtr param sigDERInPtr param sigDERInLength readonly signatureParseDER : ( contextPtr : number , sigOutPtr : number , sigDERInPtr : number , sigDERInLength : number ) => 1 | 0 ; param contextPtr param outputCompactSigPtr param inputSigPtr readonly signatureSerializeCompact : ( contextPtr : number , outputCompactSigPtr : number , inputSigPtr : number ) => 1 ; param contextPtr param outputDERSigPtr param outputDERSigLengthPtr param inputSigPtr readonly signatureSerializeDER : ( contextPtr : number , outputDERSigPtr : number , outputDERSigLengthPtr : number , inputSigPtr : number ) => 1 | 0 ; param contextPtr param outputRSigPtr param msg32Ptr param secretKeyPtr readonly signRecoverable : ( contextPtr : number , outputRSigPtr : number , msg32Ptr : number , secretKeyPtr : number ) => 1 | 0 ; param contextPtr param sigPtr param msg32Ptr param pubkeyPtr readonly verify : ( contextPtr : number , sigPtr : number , msg32Ptr : number , pubkeyPtr : number ) => 1 | 0 ; }