-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: schnorrSign return type and type and signature #176
Conversation
3bc9ab5
to
de35100
Compare
de35100
to
287dba4
Compare
@@ -49,7 +49,7 @@ export const create = ({ getPrivateHDKey }) => { | |||
) | |||
const hdkey = getPrivateHDKey({ seedId, keyId }) | |||
const privateKey = tweak ? tweakPrivateKey({ hdkey, tweak }) : hdkey.privateKey | |||
return secp256k1.schnorrSign({ data, privateKey, extraEntropy }) | |||
return Buffer.from(await secp256k1.schnorrSign({ data, privateKey, extraEntropy })) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return Buffer.from(await secp256k1.schnorrSign({ data, privateKey, extraEntropy })) | |
return secp256k1.schnorrSign({ data, privateKey, extraEntropy, format: 'buffer' }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, i didn't know about that param
features/keychain/api/index.d.ts
Outdated
@@ -34,6 +34,7 @@ export interface KeychainApi { | |||
secp256k1: { | |||
signBuffer(params: { data: Buffer } & KeySource): Promise<Buffer> | |||
signBuffer(params: { data: Buffer; enc: 'der' } & KeySource): Promise<Buffer> | |||
signSchnorr(params: { data: Buffer; extraEntropy?: Buffer } & KeySource): Promise<Buffer> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this already in #174.
But, if we want to use this one, for consistency we should not add the extraEntropy param (or add for all), and we need the tweak?: Buffer
param.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your PR can land too, it adds other api types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I merged so you will have to rebase here. I think if we're adding extraEntropy?
we should add for the other signBuffer signatures too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rebased
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
3176f69
to
f9a05e1
Compare
This PR adds the missing schnorrSign ts type and fixes the return type to be
Buffer
rather than justUint8Array
for consistency