From 15d6e76217fab195e70a8f94a068f95819e9fc7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Andr=C3=A9s=20Garc=C3=ADa=20Hern=C3=A1ndez?= Date: Fri, 8 May 2020 13:49:55 +0100 Subject: [PATCH 1/3] fix: optional parameter set as required --- supersphincs.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/supersphincs.d.ts b/supersphincs.d.ts index 9cbdf93..e1c32ba 100755 --- a/supersphincs.d.ts +++ b/supersphincs.d.ts @@ -102,7 +102,7 @@ declare module 'supersphincs' { }, additionalData?: Uint8Array|string, knownGoodHash?: Uint8Array|string, - includeHash: true + includeHash?: true ) : Promise<{ hash: Uint8Array; message: Uint8Array; @@ -126,7 +126,7 @@ declare module 'supersphincs' { }, additionalData?: Uint8Array|string, knownGoodHash?: Uint8Array|string, - includeHash: true + includeHash?: true ) : Promise<{ hash: string; message: Uint8Array; @@ -182,7 +182,7 @@ declare module 'supersphincs' { }, additionalData?: Uint8Array|string, knownGoodHash?: Uint8Array|string, - includeHash: true + includeHash?: true ) : Promise<{ hash: Uint8Array; valid: boolean; From 2769bbf7ed75ec01154f0c9ca8ea76c84c8b1cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Andr=C3=A9s=20Garc=C3=ADa=20Hern=C3=A1ndez?= Date: Fri, 8 May 2020 14:30:17 +0100 Subject: [PATCH 2/3] fix: typings --- supersphincs.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/supersphincs.d.ts b/supersphincs.d.ts index e1c32ba..0c38ac7 100755 --- a/supersphincs.d.ts +++ b/supersphincs.d.ts @@ -100,9 +100,9 @@ declare module 'supersphincs' { publicKey: Uint8Array|{ public: {rsa: string; sphincs: string}|{superSphincs: string} }, + includeHash: true, additionalData?: Uint8Array|string, - knownGoodHash?: Uint8Array|string, - includeHash?: true + knownGoodHash?: Uint8Array|string ) : Promise<{ hash: Uint8Array; message: Uint8Array; @@ -124,9 +124,9 @@ declare module 'supersphincs' { publicKey: Uint8Array|{ public: {rsa: string; sphincs: string}|{superSphincs: string} }, + includeHash: true, additionalData?: Uint8Array|string, - knownGoodHash?: Uint8Array|string, - includeHash?: true + knownGoodHash?: Uint8Array|string ) : Promise<{ hash: string; message: Uint8Array; @@ -180,9 +180,9 @@ declare module 'supersphincs' { publicKey: Uint8Array|{ public: {rsa: string; sphincs: string}|{superSphincs: string} }, + includeHash: true, additionalData?: Uint8Array|string, - knownGoodHash?: Uint8Array|string, - includeHash?: true + knownGoodHash?: Uint8Array|string ) : Promise<{ hash: Uint8Array; valid: boolean; From 9f1a74b5bed035bd39a4a5644ae4a06c0e642278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Andr=C3=A9s=20Garc=C3=ADa=20Hern=C3=A1ndez?= Date: Fri, 8 May 2020 14:39:13 +0100 Subject: [PATCH 3/3] Update supersphincs function signatures --- supersphincs.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/supersphincs.js b/supersphincs.js index e90373a..b8202e1 100755 --- a/supersphincs.js +++ b/supersphincs.js @@ -484,9 +484,9 @@ var superSphincs = { open: function ( signed, publicKey, + includeHash, additionalData, knownGoodHash, - includeHash ) { return initiated.then(function () { var shouldClearSigned = typeof signed === 'string'; @@ -508,9 +508,9 @@ var superSphincs = { signature, message, publicKey, + includeHash, additionalData, - knownGoodHash, - includeHash + knownGoodHash )]); }).then(function (results) { var message = new Uint8Array(results[0]); @@ -539,16 +539,16 @@ var superSphincs = { openString: function ( signed, publicKey, + includeHash, additionalData, - knownGoodHash, - includeHash + knownGoodHash ) { return initiated.then(function () { return superSphincs.open( signed, publicKey, + includeHash, additionalData, - knownGoodHash, - includeHash + knownGoodHash ).then(function (message) { var hash = undefined; @@ -569,9 +569,9 @@ var superSphincs = { signature, message, publicKey, + includeHash, additionalData, - knownGoodHash, - includeHash + knownGoodHash ) { return initiated.then(function () { var shouldClearSignature = typeof signature === 'string';