Skip to content

Commit

Permalink
fix: add signSchnorr to keychain api (#171)
Browse files Browse the repository at this point in the history
(cherry picked from commit 2da2b05)
  • Loading branch information
fboucquez committed Nov 13, 2024
1 parent 55df4ff commit ca9adb0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions features/keychain/api/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,5 +221,21 @@ describe('keychain api', () => {
'3045022100f3aab0f6b44f62ef387050c86fb79bacabb36b254d3017d83dc801b8e72ad58602202339bf7576cb07eadd82c9ce97d5c117ceeaa3d0b990695ae9f6e7659f535fac'
)
})

test('signSchnorr signs binary data', async () => {
const data = await hash('sha256', "Batman's identity was revealed as Harvey Dent")
const signature = await api.secp256k1.signSchnorr({
seedId,
keyId,
data,
extraEntropy: Buffer.from(
'1230000000000000000000000000000000000000000000000000000000000000',
'hex'
),
})
expect(Buffer.from(signature).toString('hex')).toBe(
'd8a41b022fab008d1d8bc32ce99dd16a4edae37da691047b3729d626c47d6e0850f78245656bc0edccf6002936b96fe04bb4553be5334cf425ac94ca2da33a2e'
)
})
})
})
1 change: 1 addition & 0 deletions features/keychain/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const createKeychainApi = ({ keychain }) => {
},
secp256k1: {
signBuffer: keychain.secp256k1.signBuffer,
signSchnorr: keychain.secp256k1.signSchnorr,
},
},
}
Expand Down

0 comments on commit ca9adb0

Please sign in to comment.