remove @noble/curves. people are not ready for it, causes BigInt issues.

This commit is contained in:
fiatjaf
2023-04-18 15:07:10 -03:00
parent 56fe3dd5dd
commit ef3184a6e0
10 changed files with 125 additions and 121 deletions

View File

@@ -17,3 +17,12 @@ export * as nip57 from './nip57'
export * as fj from './fakejson'
export * as utils from './utils'
// monkey patch secp256k1
import * as secp256k1 from '@noble/secp256k1'
import {hmac} from '@noble/hashes/hmac'
import {sha256} from '@noble/hashes/sha256'
secp256k1.utils.hmacSha256Sync = (key, ...msgs) =>
hmac(sha256, key, secp256k1.utils.concatBytes(...msgs))
secp256k1.utils.sha256Sync = (...msgs) =>
sha256(secp256k1.utils.concatBytes(...msgs))