Prefer secp256k1 lib over ecies

This commit is contained in:
Franck Royer 2021-07-09 15:41:03 +10:00
parent 2b1a6dafea
commit 1f6ed9b525
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ export function clearEncode(
envelope = Buffer.concat([envelope, s.signature, Buffer.from([s.recid])]);
sig = {
signature: Buffer.from(s.signature),
publicKey: secp256k1.publicKeyCreate(sigPrivKey, false),
publicKey: getPublicKey(sigPrivKey),
};
}
@ -134,7 +134,7 @@ export function generatePrivateKey(): Uint8Array {
* Return the public key for the given private key
*/
export function getPublicKey(privateKey: Uint8Array | Buffer): Uint8Array {
return ecies.getPublic(Buffer.from(privateKey));
return secp256k1.publicKeyCreate(privateKey, false);
}
/**