]> git.codecow.com Git - libnemo.git/commitdiff
Remove unused utilities that we do not need for this specific implementation.
authorChris Duncan <chris@zoso.dev>
Wed, 3 Dec 2025 22:46:10 +0000 (14:46 -0800)
committerChris Duncan <chris@zoso.dev>
Wed, 3 Dec 2025 22:46:10 +0000 (14:46 -0800)
src/lib/crypto/secp256k1.ts

index e1e2bda76ad041a3783c01c16d2e3976cfa1526d..dd4e2447a75474e76255b1d9640708ab3362c927 100644 (file)
@@ -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))