Skip to content
This repository has been archived by the owner on Feb 24, 2023. It is now read-only.

Commit

Permalink
Merge fb014df into 0876c05
Browse files Browse the repository at this point in the history
  • Loading branch information
aricart committed Oct 25, 2018
2 parents 0876c05 + fb014df commit 03f82b1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ts-nkeys",
"version": "1.0.0",
"version": "1.0.2",
"description": "A public-key signature system based on Ed25519 for the NATS ecosystem in typescript for ts-nats and node-nats",
"main": "lib/nkeys.js",
"types": "lib/nkeys.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/kp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export class KP implements KeyPair {

sign(input: Buffer): Buffer {
let kp = this.getKeys();
// @ts-ignore
return ed25519.sign.detached(input, kp.secretKey);
let a = ed25519.sign.detached(input, kp.secretKey);
return Buffer.from(a.buffer);
}

verify(input: Buffer, sig: Buffer): boolean {
Expand Down
2 changes: 1 addition & 1 deletion src/nkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {KP} from "./kp";
import {PublicKey} from "./public";
import {Codec} from "./codec";

export const VERSION = "1.0.0";
export const VERSION = "1.0.2";

export function createPair(prefix: Prefix, seed?: Buffer): KeyPair {
if (!seed) {
Expand Down
1 change: 1 addition & 0 deletions test/basics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ test('Account', (t) => {
let sig = account.sign(data);
t.is(sig.length, ed25519.sign.signatureLength);
t.true(account.verify(data, sig));
t.true(Buffer.isBuffer(sig));

let pk = fromPublic(publicKey);
t.true(pk.verify(data, sig));
Expand Down

0 comments on commit 03f82b1

Please sign in to comment.