diff --git a/src/core/lib/BitwiseOp.mjs b/src/core/lib/BitwiseOp.mjs index b7cf7c97..dbac3c5a 100644 --- a/src/core/lib/BitwiseOp.mjs +++ b/src/core/lib/BitwiseOp.mjs @@ -25,6 +25,7 @@ export function bitOp (input, key, func, nullPreserving, scheme) { 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); diff --git a/src/core/operations/XOR.mjs b/src/core/operations/XOR.mjs index 584ec306..ae1c2154 100644 --- a/src/core/operations/XOR.mjs +++ b/src/core/operations/XOR.mjs @@ -21,7 +21,7 @@ class XOR extends Operation { this.name = "XOR"; this.module = "Default"; - this.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:"; + this.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:"; this.infoURL = "https://wikipedia.org/wiki/XOR"; this.inputType = "byteArray"; this.outputType = "byteArray"; @@ -35,7 +35,7 @@ class XOR extends Operation { { "name": "Scheme", "type": "option", - "value": ["Standard", "Input differential", "Output differential"] + "value": ["Standard", "Input differential", "Output differential", "Cascade"] }, { "name": "Null preserving",