From 70d4e3394ce089f137d507ad86be52137ceee83e Mon Sep 17 00:00:00 2001 From: George J Date: Fri, 24 Aug 2018 22:33:24 +0100 Subject: [PATCH 1/2] Updated XOR to include Cascade scheme --- src/core/lib/BitwiseOp.mjs | 1 + src/core/operations/XOR.mjs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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", From c7b2095bb47ec46bfb71f465c3648eaba92e4d9f Mon Sep 17 00:00:00 2001 From: n1474335 Date: Wed, 29 Aug 2018 17:34:47 +0000 Subject: [PATCH 2/2] Updated package-lock.json --- package-lock.json | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index f984408b..cc15da50 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4197,12 +4197,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -4217,17 +4219,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -4344,7 +4349,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -4356,6 +4362,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -4370,6 +4377,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -4481,7 +4489,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -4614,6 +4623,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",