Updated Cascade XOR

This commit is contained in:
George J 2018-05-01 17:01:55 +01:00
parent f7729c0fd2
commit ecb62c20ec
3 changed files with 2094 additions and 2093 deletions

4182
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -377,7 +377,7 @@ const OperationConfig = {
},
"XOR": {
module: "Default",
description: "XOR the input with the given key.<br>e.g. <code>fe023da5</code><br><br><strong>Options</strong><br><u>Null preserving:</u> If the current byte is 0x00 or the same as the key, skip it.<br><br><u>Scheme:</u><ul><li>Standard - key is unchanged after each round</li><li>Input differential - key is set to the value of the previous unprocessed byte</li><li>Output differential - key is set to the value of the previous processed byte</li></ul>",
description: "XOR the input with the given key.<br>e.g. <code>fe023da5</code><br><br><strong>Options</strong><br><u>Null preserving:</u> If the current byte is 0x00 or the same as the key, skip it.<br><br><u>Scheme:</u><ul><li>Standard - key is unchanged after each round</li><li>Input differential - key is set to the value of the previous unprocessed byte</li><li>Output differential - key is set to the value of the previous processed byte</li><li>Cascade - key is set to the input byte shifted by one</li></ul>",
highlight: true,
highlightReverse: true,
inputType: "byteArray",

View file

@ -32,6 +32,7 @@ const BitwiseOp = {
for (let i = 0; i < input.length; i++) {
k = key[i % key.length];
if (scheme === "Cascade") k = input[i + 1] || 0;
o = input[i];
x = nullPreserving && (o === 0 || o === k) ? o : func(o, k);
result.push(x);
@ -62,7 +63,7 @@ const BitwiseOp = {
* @constant
* @default
*/
XOR_SCHEME: ["Standard", "Input differential", "Output differential"],
XOR_SCHEME: ["Standard", "Input differential", "Output differential", "Cascade"],
/**
* @constant
* @default