From 4720b5ac21163936fb47f524037a6f12ce6e6ce2 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 22 Jul 2026 18:31:50 +0200 Subject: rewrite: the beginning This a giant fuck-you to myself while I have nothing (actually, tons of things) to do in a hospital. * The giant screens of preprocessor code are gone, they always sucked, fuck them. * Switched everything to the "boxes" interface as the only one remaining. * Restuctured things in aes/ so that the files they're in make at least a little bit of sense. * Removed a bunch of cruft and prematurely generic code. * This is half-baked at best: I just made sure that the tests pass. A lot of cleanup awaits. --- test/toolkit.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'test/toolkit.py') diff --git a/test/toolkit.py b/test/toolkit.py index b6c3cd3..d14ce23 100644 --- a/test/toolkit.py +++ b/test/toolkit.py @@ -135,32 +135,29 @@ class Tools: return args @staticmethod - def _block_settings_to_args(algorithm, mode, use_boxes=False): - args = [ + def _block_settings_to_args(algorithm, mode): + return [ "--algorithm", str(algorithm), "--mode", str(mode), ] - if use_boxes: - args.append("--use-boxes") - return args @staticmethod - def _build_block_args(algorithm, mode, inputs, use_boxes=False): - args = Tools._block_settings_to_args(algorithm, mode, use_boxes) + def _build_block_args(algorithm, mode, inputs): + args = Tools._block_settings_to_args(algorithm, mode) if isinstance(inputs, Iterable): args.extend(Tools._block_inputs_to_args(iter(inputs))) else: args.extend(inputs.to_args()) return args - def run_encrypt_block(self, algorithm, mode, inputs, use_boxes=False): - args = self._build_block_args(algorithm, mode, inputs, use_boxes) + def run_encrypt_block(self, algorithm, mode, inputs): + args = self._build_block_args(algorithm, mode, inputs) return self.run(self._ENCRYPT_BLOCK, args) - def run_decrypt_block(self, algorithm, mode, inputs, use_boxes=False): - args = self._build_block_args(algorithm, mode, inputs, use_boxes) + def run_decrypt_block(self, algorithm, mode, inputs): + args = self._build_block_args(algorithm, mode, inputs) return self.run(self._DECRYPT_BLOCK, args) @staticmethod -- cgit v1.3