From f46d9414cfc87a7679dae79bac02faf9705bf536 Mon Sep 17 00:00:00 2001 From: n1073645 Date: Thu, 30 Jan 2020 09:57:14 +0000 Subject: [PATCH] Spelling corrections. --- src/core/lib/HillCipher.mjs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/lib/HillCipher.mjs b/src/core/lib/HillCipher.mjs index 65564d28..0bc41eb8 100644 --- a/src/core/lib/HillCipher.mjs +++ b/src/core/lib/HillCipher.mjs @@ -14,7 +14,7 @@ let N = 0; * @param {boolean} keyflag * @returns {object} */ -function genMatix(theString, keyflag=false) { +function genMatrix(theString, keyflag=false) { const matrix = new Array(N).fill(0).map(() => new Array(N).fill(-1)); let count = 0; @@ -198,10 +198,10 @@ export function encode(plaintext, key) { N = Math.ceil(Math.sqrt(key.length)); // Generate matrix representation of the key. - const keyMatrix = genMatix(key, true); + const keyMatrix = genMatrix(key, true); // Generate matrix representation of the plaintext. - const plaintextMatrix = genMatix(plaintext); + const plaintextMatrix = genMatrix(plaintext); return join(multiply(keyMatrix, plaintextMatrix)); } @@ -219,10 +219,10 @@ export function decode(ciphertext, key) { N = Math.ceil(Math.sqrt(key.length)); // Generate matrix representation of the key. - const keyMatrix = inverse(genMatix(key, true)); + const keyMatrix = inverse(genMatrix(key, true)); // Generate matrix representation of the plaintext. - const ciphertextMatrix = genMatix(ciphertext); + const ciphertextMatrix = genMatrix(ciphertext); return join(multiply(keyMatrix, ciphertextMatrix));