diff --git a/src/core/config/OperationConfig.js b/src/core/config/OperationConfig.js index 9c33d3d0..efed68e0 100644 --- a/src/core/config/OperationConfig.js +++ b/src/core/config/OperationConfig.js @@ -377,7 +377,7 @@ const OperationConfig = { }, "XOR": { module: "Default", - description: "XOR the input with the given key.
e.g. fe023da5

Options
Null preserving: If the current byte is 0x00 or the same as the key, skip it.

Scheme:", + description: "XOR the input with the given key.
e.g. fe023da5

Options
Null preserving: If the current byte is 0x00 or the same as the key, skip it.

Scheme:", highlight: true, highlightReverse: true, inputType: "byteArray", diff --git a/src/core/operations/BitwiseOp.js b/src/core/operations/BitwiseOp.js index f2551cba..84816581 100755 --- a/src/core/operations/BitwiseOp.js +++ b/src/core/operations/BitwiseOp.js @@ -34,7 +34,6 @@ const BitwiseOp = { k = key[i % key.length]; o = input[i]; x = nullPreserving && (o === 0 || o === k) ? o : func(o, k); - result.push(x); if (scheme && scheme !== "Standard" && !(nullPreserving && (o === 0 || o === k))) { @@ -45,8 +44,13 @@ const BitwiseOp = { case "Output differential": key[i % key.length] = o; break; + case "Cascade": + k ^= input[i + 1]; + x = nullPreserving && (o === 0 || o === k) ? o : func(o, k); + break; } } + result.push(x); } return result; @@ -62,7 +66,7 @@ const BitwiseOp = { * @constant * @default */ - XOR_SCHEME: ["Standard", "Input differential", "Output differential"], + XOR_SCHEME: ["Standard", "Input differential", "Output differential", "Cascade"], /** * @constant * @default