diff --git a/features/keychain/api/index.d.ts b/features/keychain/api/index.d.ts index ede00d3..44cb031 100644 --- a/features/keychain/api/index.d.ts +++ b/features/keychain/api/index.d.ts @@ -34,7 +34,9 @@ export interface KeychainApi { secp256k1: { signBuffer(params: { data: Buffer } & KeySource): Promise signBuffer(params: { data: Buffer; enc: 'der' } & KeySource): Promise - signSchnorr(params: { data: Buffer; extraEntropy?: Buffer } & KeySource): Promise + signSchnorr( + params: { data: Buffer; extraEntropy?: Buffer; tweak?: Buffer } & KeySource + ): Promise } } diff --git a/features/keychain/module/crypto/secp256k1.js b/features/keychain/module/crypto/secp256k1.js index 36c53ad..060108f 100644 --- a/features/keychain/module/crypto/secp256k1.js +++ b/features/keychain/module/crypto/secp256k1.js @@ -49,7 +49,7 @@ export const create = ({ getPrivateHDKey }) => { ) const hdkey = getPrivateHDKey({ seedId, keyId }) const privateKey = tweak ? tweakPrivateKey({ hdkey, tweak }) : hdkey.privateKey - return Buffer.from(await secp256k1.schnorrSign({ data, privateKey, extraEntropy })) + return secp256k1.schnorrSign({ data, privateKey, extraEntropy, format: 'buffer' }) }, })