supercop.ts

cross-compiled javascript implementation of ed25519 based on supercop-ref10
git clone git://git.finwo.net/lib/supercop.ts
Log | Files | Refs | README | LICENSE

commit 5631e6628ec294254be7fcf0e94b7fc9db76d37c
parent 6405cfddaf4e7e016cb81d5a57053f2d947e2220
Author: finwo <finwo@pm.me>
Date:   Mon, 15 Jul 2019 18:39:59 +0200

keypair now contains .verify and .sign

Diffstat:
Mindex.js | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/index.js b/index.js @@ -67,10 +67,17 @@ exports.createKeyPair = async function(seed) { fn._free(publicKeyPtr); fn._free(secretKeyPtr); - return { + return Object.create({ + sign: async function( message ) { + return exports.sign( message, this.publicKey, this.secretKey ); + }, + verify: async function( signature, message ) { + return exports.verify( signature, message, this.publicKey ); + }, + }, { publicKey: Buffer.from(publicKey), secretKey: Buffer.from(secretKey), - }; + }); }; exports.sign = async function(message, publicKey, secretKey){