From d29f6efad875f86ad83aed6e87b7534edae2c969 Mon Sep 17 00:00:00 2001 From: n1073645 Date: Wed, 11 Dec 2019 10:03:31 +0000 Subject: [PATCH] If the entropy of the output is higher than the entropy of the input then the branch will return --- src/core/lib/Magic.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/lib/Magic.mjs b/src/core/lib/Magic.mjs index c791976e..b94f9c36 100644 --- a/src/core/lib/Magic.mjs +++ b/src/core/lib/Magic.mjs @@ -308,8 +308,8 @@ class Magic { let outputEntropy = 0; if (entropyTests) { outputEntropy = this.calcEntropy(new Uint8Array(output)); - console.log(entropyTests.output); - console.log(outputEntropy); + if (inputEntropy < outputEntropy) + return; } const outputRegexes = OperationConfig[op.op].outputRegexes;