diff --git a/features/keychain/api/index.d.ts b/features/keychain/api/index.d.ts index 31ed482..52f5523 100644 --- a/features/keychain/api/index.d.ts +++ b/features/keychain/api/index.d.ts @@ -36,7 +36,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' }) }, })