follow secp256k1@4.0.0 api change (#41642)

This commit is contained in:
microcai
2020-01-27 14:15:03 -08:00
committed by Wesley Wigham
parent 74f2abd00a
commit 2a97ad4ba8
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ export function signatureImportLax(signature: Buffer): Buffer;
* - Compose 32-byte scalar `s = k^-1 * (r * d + m)`. Reject nonce if `s` is zero.
* - The signature is `(r, s)`.
*/
export function sign(message: Buffer, privateKey: Buffer, options?: SignOptions): {signature: Buffer, recovery: number};
export function ecdsaSign(message: Buffer, privateKey: Buffer, options?: SignOptions): {signature: Uint8Array, recovery: number};
/**
* Verify an ECDSA signature.
+2 -2
View File
@@ -1,4 +1,4 @@
import { SignOptions, sign } from "secp256k1";
import { SignOptions, ecdsaSign } from "secp256k1";
const opts: SignOptions = {
data: Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72])
@@ -8,4 +8,4 @@ const message = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
const prvKey = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
sign(message, prvKey, opts);
ecdsaSign(message, prvKey, opts);