import { type Secp256k1 } from "https://deno.land/x/libauth@v2.0.0-alpha.9/src/lib/crypto/secp256k1-types.ts";
An object that exposes a set of purely-functional Secp256k1 methods.
Example
import { secp256k1 } from '@bitauth/libauth';
import { msgHash, pubkey, sig } from './somewhere';
secp256k1.verifySignatureDERLowS(sig, pubkey, msgHash)
? console.log('🚀 Signature valid')
: console.log('❌ Signature invalid');
definition: { addTweakPrivateKey: (privateKey: Uint8Array, tweakValue: Uint8Array) => Uint8Array | string; addTweakPublicKeyCompressed: (publicKey: Uint8Array, tweakValue: Uint8Array) => Uint8Array | string; addTweakPublicKeyUncompressed: (publicKey: Uint8Array, tweakValue: Uint8Array) => Uint8Array | string; compressPublicKey: (publicKey: Uint8Array) => Uint8Array | string; derivePublicKeyCompressed: (privateKey: Uint8Array) => Uint8Array | string; derivePublicKeyUncompressed: (privateKey: Uint8Array) => Uint8Array | string; malleateSignatureCompact: (signature: Uint8Array) => Uint8Array | string; malleateSignatureDER: (signature: Uint8Array) => Uint8Array | string; mulTweakPrivateKey: (privateKey: Uint8Array, tweakValue: Uint8Array) => Uint8Array | string; mulTweakPublicKeyCompressed: (publicKey: Uint8Array, tweakValue: Uint8Array) => Uint8Array | string; mulTweakPublicKeyUncompressed: (publicKey: Uint8Array, tweakValue: Uint8Array) => Uint8Array | string; normalizeSignatureCompact: (signature: Uint8Array) => Uint8Array | string; normalizeSignatureDER: (signature: Uint8Array) => Uint8Array | string; recoverPublicKeyCompressed: () => Uint8Array | string; recoverPublicKeyUncompressed: () => Uint8Array | string; signatureCompactToDER: (signature: Uint8Array) => Uint8Array | string; signatureDERToCompact: (signature: Uint8Array) => Uint8Array | string; signMessageHashCompact: (privateKey: Uint8Array, messageHash: Uint8Array) => Uint8Array | string; signMessageHashDER: (privateKey: Uint8Array, messageHash: Uint8Array) => Uint8Array | string; signMessageHashRecoverableCompact: (privateKey: Uint8Array, messageHash: Uint8Array) => RecoverableSignature | string; signMessageHashSchnorr: (privateKey: Uint8Array, messageHash: Uint8Array) => Uint8Array | string; uncompressPublicKey: (publicKey: Uint8Array) => Uint8Array | string; validatePrivateKey: (privateKey: Uint8Array) => boolean; validatePublicKey: (publicKey: Uint8Array) => boolean; verifySignatureCompact: () => boolean; verifySignatureCompactLowS: () => boolean; verifySignatureDER: () => boolean; verifySignatureDERLowS: () => boolean; verifySignatureSchnorr: () => boolean; }
signature: Uint8Array,
publicKey: Uint8Array,
messageHash: Uint8Array,
signature: Uint8Array,
publicKey: Uint8Array,
messageHash: Uint8Array,
signature: Uint8Array,
publicKey: Uint8Array,
messageHash: Uint8Array,
signature: Uint8Array,
publicKey: Uint8Array,
messageHash: Uint8Array,
signature: Uint8Array,
publicKey: Uint8Array,
messageHash: Uint8Array,