Commit c080a569 authored by Roman Mkrtchian's avatar Roman Mkrtchian Committed by Rémi Huguet
Browse files

fix: optimization of AES and DES ciphers performance

parent 98bd4bcc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -608,7 +608,7 @@ def _parametric_cipher(state, key, operations, after_step, at_round=None, mode='
    if state.ndim == 1:
        out_state = _np.array([_np.copy(state) for i in range(round_keys.shape[0])], dtype='uint8')
    else:
        out_state = _np.array([_np.copy(s) for s in state], dtype='uint8')
        out_state = _np.array(state, dtype='uint8', copy=True)

    for i, _round_operations in enumerate(rounds):
        for step, operation in enumerate(_round_operations):
+1 −1
Original line number Diff line number Diff line
@@ -800,7 +800,7 @@ class _ParametricCipher():
        if state.ndim == 1:
            out_state = _np.array([_np.copy(state) for i in range(des_keys.shape[1])], dtype='uint8').reshape(-1, 8)
        else:
            out_state = _np.array([_np.copy(s) for s in state], dtype='uint8')
            out_state = _np.array(state, dtype='uint8', copy=True)

        self.total_words = _np.max([out_state.shape[0], des_keys.shape[1]])
        for des_number, des_rounds in enumerate(des_iterations):