From 21fcbcff6dbf09f68540922c28f62ab1f62b69ee Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Wed, 3 Dec 2025 14:46:10 -0800 Subject: [PATCH] Remove unused utilities that we do not need for this specific implementation. --- src/lib/crypto/secp256k1.ts | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/lib/crypto/secp256k1.ts b/src/lib/crypto/secp256k1.ts index e1e2bda..dd4e244 100644 --- a/src/lib/crypto/secp256k1.ts +++ b/src/lib/crypto/secp256k1.ts @@ -895,26 +895,6 @@ export class Secp256k1 { } static keygen: KeygenFn = this.createKeygen(this.getPublicKey) - /** Math, hex, byte helpers. Not in `utils` because utils share API with noble-curves. */ - static etc = { - hexToBytes: this.hexToBytes as (hex: string) => Bytes, - bytesToHex: this.bytesToHex as (bytes: Bytes) => string, - concatBytes: this.concatBytes as (...arrs: Bytes[]) => Bytes, - bytesToNumberBE: this.bytesToBigint as (a: Bytes) => bigint, - numberToBytesBE: this.bigintTo32Bytes as (n: bigint) => Bytes, - mod: this.M as (a: bigint, md?: bigint) => bigint, - invert: this.invert as (num: bigint, md?: bigint) => bigint, // math utilities - secretKeyToScalar: this.secretKeyToScalar as typeof this.secretKeyToScalar, - abytes: this.abytes as typeof this.abytes, - } - - /** Curve-specific utilities for private keys. */ - static utils = { - isValidSecretKey: this.isValidSecretKey as typeof this.isValidSecretKey, - isValidPublicKey: this.isValidPublicKey as typeof this.isValidPublicKey, - randomSecretKey: this.randomSecretKey as () => Bytes, - } - // Schnorr signatures are superior to ECDSA from above. Below is Schnorr-specific BIP0340 code. // https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki static getTag = (tag: string) => Uint8Array.from('BIP0340/' + tag, (c) => c.charCodeAt(0)) -- 2.47.3