-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
The _reset_key method calculates both self._keys and self._keys_inv. The _keys_inv is generated by applying self._mix_cols_inv to all round keys except the first and last. However, in the _keys_inv assignment, the last key in the list doesn't get the _mix_cols_inv applied to it.
self._keys_inv = [self._mix_cols_inv(keys[i]) if (0<i<len(keys)-1) else keys[i] for i in range(len(keys))]This means the last decryption key is equivalent to the last encryption key. This might lead to incorrect decryption. Specifically, it doesn't align with the inverse operations required in the decryption process, potentially weakening the security of the algorithm. Consider applying the correct inverse operation or ensuring consistency in key generation and usage for both encryption and decryption.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels