Skip to content
This repository was archived by the owner on Jun 17, 2021. It is now read-only.

Commit 6a6af8e

Browse files
committed
Remove secp256k1 native dependency.
1 parent da4827c commit 6a6af8e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@
9494
"create-hash": "^1.1.2",
9595
"ethereum-cryptography": "^0.1.3",
9696
"ethjs-util": "0.1.6",
97-
"rlp": "^2.2.4",
98-
"secp256k1": "^4.0.1"
97+
"rlp": "^2.2.4"
9998
},
10099
"devDependencies": {
101100
"@ethereumjs/config-prettier": "^1.1.0",

src/signature.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const { recover, sign, publicKeyConvert } = require('ethereum-cryptography/shims/hdkey-secp256k1v3')
2-
import * as secp256k1 from 'secp256k1'
1+
const { sign, publicKeyConvert } = require('ethereum-cryptography/shims/hdkey-secp256k1v3')
2+
const { ecdsaRecover } = require('ethereum-cryptography/secp256k1')
33
import * as BN from 'bn.js'
44
import { toBuffer, setLengthLeft, bufferToHex } from './bytes'
55
import { keccak } from './hash'
@@ -47,7 +47,7 @@ export const ecrecover = function(
4747
if (!isValidSigRecovery(recovery)) {
4848
throw new Error('Invalid signature v value')
4949
}
50-
const senderPubKey = secp256k1.ecdsaRecover(signature, recovery, msgHash)
50+
const senderPubKey = ecdsaRecover(signature, recovery, msgHash)
5151
return toBuffer(publicKeyConvert(senderPubKey, false).slice(1))
5252
}
5353

0 commit comments

Comments
 (0)