mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Fixed spelling of recid in secp256k1 (#43838)
* Update index.d.ts * secp256k1: fixed spelling and added test * secp256k1: fixed missing semicolon in test * Empty commit to retrigger CI
This commit is contained in:
parent
22e6c701e7
commit
3ce60aa3be
4
types/secp256k1/index.d.ts
vendored
4
types/secp256k1/index.d.ts
vendored
@ -115,7 +115,7 @@ export function signatureImport(signature: Uint8Array): Uint8Array;
|
||||
* - Compose 32-byte scalar `s = k^-1 * (r * d + m)`. Reject nonce if `s` is zero.
|
||||
* - The signature is `(r, s)`.
|
||||
*/
|
||||
export function ecdsaSign(message: Uint8Array, privateKey: Uint8Array, options?: SignOptions): {signature: Uint8Array, recId: number};
|
||||
export function ecdsaSign(message: Uint8Array, privateKey: Uint8Array, options?: SignOptions): {signature: Uint8Array, recid: number};
|
||||
|
||||
/**
|
||||
* Verify an ECDSA signature.
|
||||
@ -133,7 +133,7 @@ export function ecdsaVerify(signature: Uint8Array, message: Uint8Array, publicKe
|
||||
/**
|
||||
* Recover an ECDSA public key from a signature.
|
||||
*/
|
||||
export function ecdsaRecover(signature: Uint8Array, recId: number, message: Uint8Array, compressed?: boolean): Uint8Array;
|
||||
export function ecdsaRecover(signature: Uint8Array, recid: number, message: Uint8Array, compressed?: boolean): Uint8Array;
|
||||
|
||||
/**
|
||||
* Compute an EC Diffie-Hellman secret and applied sha256 to compressed public key.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { SignOptions, ecdsaSign } from "secp256k1";
|
||||
import { SignOptions, ecdsaSign, ecdsaRecover } from "secp256k1";
|
||||
|
||||
const opts: SignOptions = {
|
||||
data: Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72])
|
||||
@ -8,4 +8,6 @@ const message = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
|
||||
|
||||
const prvKey = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
|
||||
|
||||
ecdsaSign(message, prvKey, opts);
|
||||
const ret = ecdsaSign(message, prvKey, opts);
|
||||
|
||||
const recovered = ecdsaRecover(ret.signature, ret.recid, message);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user