From 4fe3ddcd28a3c0546468294a3acfa6732b825364 Mon Sep 17 00:00:00 2001 From: Brian Turek Date: Wed, 15 Apr 2020 14:23:10 +0100 Subject: [PATCH] Remove last few incorrect shakeLen --- dist/sha3.d.ts | 2 +- src/sha3.ts | 2 +- test/src/test_common.ts | 10 +++++----- test/src/test_converters.ts | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/sha3.d.ts b/dist/sha3.d.ts index f7a1365..2b441a5 100644 --- a/dist/sha3.d.ts +++ b/dist/sha3.d.ts @@ -218,7 +218,7 @@ declare class jsSHA extends jsSHABase { * Returns the the KMAC in the specified format. * * @param format The desired output formatting. - * @param options Hashmap of extra outputs options. `shakeLen` must be specified. + * @param options Hashmap of extra outputs options. `outputLen` must be specified. * @returns The KMAC in the format specified. */ protected _getKMAC(options: { diff --git a/src/sha3.ts b/src/sha3.ts index 40693dc..2d0f6a6 100644 --- a/src/sha3.ts +++ b/src/sha3.ts @@ -574,7 +574,7 @@ export default class jsSHA extends jsSHABase { * Returns the the KMAC in the specified format. * * @param format The desired output formatting. - * @param options Hashmap of extra outputs options. `shakeLen` must be specified. + * @param options Hashmap of extra outputs options. `outputLen` must be specified. * @returns The KMAC in the format specified. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/test/src/test_common.ts b/test/src/test_common.ts index 7710f6d..1daf5a5 100644 --- a/test/src/test_common.ts +++ b/test/src/test_common.ts @@ -269,7 +269,7 @@ describe("Test jsSHABase", () => { assert.equal(stubbedJsSHA.getter("processedLen"), 64); }); - it("Test getHash Without Needed shakeLen ", () => { + it("Test getHash Without Needed outputLen ", () => { const stubbedJsSHA = new jsSHAATest("SHA-TEST", "HEX"); stubbedJsSHA.setter("isVariableLen", true); @@ -319,7 +319,7 @@ describe("Test jsSHABase", () => { it("Test getHash for SHAKE", () => { /* * Check a few basic things: - * 1. The output of getHash should equal the first shakeLen bits of the output of finalizeFunc + * 1. The output of getHash should equal the first outputLen bits of the output of finalizeFunc * 2. finalize should be called once with the correct inputs */ const stubbedJsSHA = new jsSHAATest("SHA-TEST", "HEX"); @@ -334,7 +334,7 @@ describe("Test jsSHABase", () => { stubbedJsSHA.setter("processedLen", 64); // Check #1 - assert.equal(stubbedJsSHA.getHash("HEX", { shakeLen: 32 }), dummyVals[0].toString(16)); + assert.equal(stubbedJsSHA.getHash("HEX", { outputLen: 32 }), dummyVals[0].toString(16)); // Check #2 assert.isTrue(stubbedFinalize.calledOnceWith([dummyVals[5]], 32, 64, [dummyVals[2], dummyVals[3]], 32)); @@ -362,7 +362,7 @@ describe("Test jsSHABase", () => { * Check a few basic things: * 1. The output of getHash should equal the output of last finalizeFunc call * 2. finalizeFunc should be called numRound times - * 3. The last numRound-1 calls of finalizeFunc should have the last 32-shakeLen bits 0ed out + * 3. The last numRound-1 calls of finalizeFunc should have the last 32-outputLen bits 0ed out */ const stubbedJsSHA = new jsSHAATest("SHA-TEST", "HEX", { numRounds: 3 }); stubbedJsSHA.setter("isVariableLen", true); @@ -370,7 +370,7 @@ describe("Test jsSHABase", () => { stubbedFinalize.returns([dummyVals[0], dummyVals[1]]).onCall(2).returns([dummyVals[2], dummyVals[3]]); // Check #1 - assert.equal(stubbedJsSHA.getHash("HEX", { shakeLen: 24 }), dummyVals[2].toString(16).substr(0, 6)); + assert.equal(stubbedJsSHA.getHash("HEX", { outputLen: 24 }), dummyVals[2].toString(16).substr(0, 6)); // Check #2 assert.equal(stubbedFinalize.callCount, 3); diff --git a/test/src/test_converters.ts b/test/src/test_converters.ts index ab16371..c42ae3d 100644 --- a/test/src/test_converters.ts +++ b/test/src/test_converters.ts @@ -586,7 +586,7 @@ describe("Test getOutputConverter", () => { { inputValue: "ARRAYBUFFER", funcName: "packed2arraybuffer", needsOptions: false }, { inputValue: "UINT8ARRAY", funcName: "packed2uint8array", needsOptions: false }, ], - options = { outputUpper: false, b64Pad: "", shakeLen: -1 }; + options = { outputUpper: false, b64Pad: "", outputLen: -1 }; funcNameToInputValueMappings.forEach((mapping) => { it(`${mapping.funcName} Mapping`, () => {