Skip to content

Commit a885a8d

Browse files
committed
Reject MODE_CTR in Des3 init
1 parent d74420f commit a885a8d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

wolfcrypt/ciphers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,11 @@ class Des3(_Cipher):
628628
key_size = 24
629629
_native_type = "Des3 *"
630630

631+
def __init__(self, key, mode, IV=None):
632+
if mode != MODE_CBC:
633+
raise ValueError("Des3 only supports MODE_CBC")
634+
super().__init__(key, mode, IV)
635+
631636
def _set_key(self, direction):
632637
if direction == _ENCRYPTION:
633638
return _lib.wc_Des3_SetKey(self._enc, self._key,

0 commit comments

Comments
 (0)