bring back @noble/curves instead of @noble/secp256k1.

fixes https://github.com/nbd-wtf/nostr-tools/issues/196#issuecomment-1537549606
This commit is contained in:
Paul Miller
2023-04-14 16:26:33 +00:00
committed by fiatjaf
parent ac7598b5e3
commit 03cc18d53b
11 changed files with 268 additions and 253 deletions

View File

@@ -22,12 +22,3 @@ 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))