diff --git a/pyaegis/aegis128l.py b/pyaegis/aegis128l.py index e3bc4e7..f02986b 100644 --- a/pyaegis/aegis128l.py +++ b/pyaegis/aegis128l.py @@ -1,11 +1,4 @@ -"""aegis128l Python submodule. - -Simplified API: single functions can return newly allocated buffers or write -into user-provided buffers via optional `into=` (and `mac_into=` for detached). - -Error return codes from the C library raise ValueError. -""" - +"""AEGIS-128L""" # All modules are generated from aegis128l.py by tools/gen_modules.py! # DO NOT EDIT OTHER ALGORITHM FILES MANUALLY! @@ -529,14 +522,14 @@ class Mac: raise RuntimeError(f"mac final failed: {err_name}") return out if into is None else memoryview(out)[:maclen] # type: ignore - def verify(self, mac: Buffer) -> bool: + def verify(self, mac: Buffer): """Verify a tag for the current MAC state. Args: mac: The tag to verify (16 or 32 bytes). Returns: - True if verification succeeds. + Only if verification succeeds. Raises: TypeError: If tag length is invalid. @@ -548,7 +541,6 @@ class Mac: rc = _lib.aegis128l_mac_verify(self._st, _ptr(mac), maclen) if rc != 0: raise ValueError("mac verification failed") - return True class Encryptor: diff --git a/pyaegis/aegis128x2.py b/pyaegis/aegis128x2.py index bdb9b75..4f1aa7c 100644 --- a/pyaegis/aegis128x2.py +++ b/pyaegis/aegis128x2.py @@ -1,11 +1,4 @@ -"""aegis128x2 Python submodule. - -Simplified API: single functions can return newly allocated buffers or write -into user-provided buffers via optional `into=` (and `mac_into=` for detached). - -Error return codes from the C library raise ValueError. -""" - +"""AEGIS-128X2""" # All modules are generated from aegis128x2.py by tools/gen_modules.py! # DO NOT EDIT OTHER ALGORITHM FILES MANUALLY! @@ -529,14 +522,14 @@ class Mac: raise RuntimeError(f"mac final failed: {err_name}") return out if into is None else memoryview(out)[:maclen] # type: ignore - def verify(self, mac: Buffer) -> bool: + def verify(self, mac: Buffer): """Verify a tag for the current MAC state. Args: mac: The tag to verify (16 or 32 bytes). Returns: - True if verification succeeds. + Only if verification succeeds. Raises: TypeError: If tag length is invalid. @@ -548,7 +541,6 @@ class Mac: rc = _lib.aegis128x2_mac_verify(self._st, _ptr(mac), maclen) if rc != 0: raise ValueError("mac verification failed") - return True class Encryptor: diff --git a/pyaegis/aegis128x4.py b/pyaegis/aegis128x4.py index 92a1839..d2a8b6c 100644 --- a/pyaegis/aegis128x4.py +++ b/pyaegis/aegis128x4.py @@ -1,11 +1,4 @@ -"""aegis128x4 Python submodule. - -Simplified API: single functions can return newly allocated buffers or write -into user-provided buffers via optional `into=` (and `mac_into=` for detached). - -Error return codes from the C library raise ValueError. -""" - +"""AEGIS-128X4""" # All modules are generated from aegis128x4.py by tools/gen_modules.py! # DO NOT EDIT OTHER ALGORITHM FILES MANUALLY! @@ -529,14 +522,14 @@ class Mac: raise RuntimeError(f"mac final failed: {err_name}") return out if into is None else memoryview(out)[:maclen] # type: ignore - def verify(self, mac: Buffer) -> bool: + def verify(self, mac: Buffer): """Verify a tag for the current MAC state. Args: mac: The tag to verify (16 or 32 bytes). Returns: - True if verification succeeds. + Only if verification succeeds. Raises: TypeError: If tag length is invalid. @@ -548,7 +541,6 @@ class Mac: rc = _lib.aegis128x4_mac_verify(self._st, _ptr(mac), maclen) if rc != 0: raise ValueError("mac verification failed") - return True class Encryptor: diff --git a/pyaegis/aegis256.py b/pyaegis/aegis256.py index f94821e..22675b7 100644 --- a/pyaegis/aegis256.py +++ b/pyaegis/aegis256.py @@ -1,11 +1,4 @@ -"""aegis256 Python submodule. - -Simplified API: single functions can return newly allocated buffers or write -into user-provided buffers via optional `into=` (and `mac_into=` for detached). - -Error return codes from the C library raise ValueError. -""" - +"""AEGIS-256""" # All modules are generated from aegis256.py by tools/gen_modules.py! # DO NOT EDIT OTHER ALGORITHM FILES MANUALLY! @@ -529,14 +522,14 @@ class Mac: raise RuntimeError(f"mac final failed: {err_name}") return out if into is None else memoryview(out)[:maclen] # type: ignore - def verify(self, mac: Buffer) -> bool: + def verify(self, mac: Buffer): """Verify a tag for the current MAC state. Args: mac: The tag to verify (16 or 32 bytes). Returns: - True if verification succeeds. + Only if verification succeeds. Raises: TypeError: If tag length is invalid. @@ -548,7 +541,6 @@ class Mac: rc = _lib.aegis256_mac_verify(self._st, _ptr(mac), maclen) if rc != 0: raise ValueError("mac verification failed") - return True class Encryptor: diff --git a/pyaegis/aegis256x2.py b/pyaegis/aegis256x2.py index 7271027..6e6ac9c 100644 --- a/pyaegis/aegis256x2.py +++ b/pyaegis/aegis256x2.py @@ -1,11 +1,4 @@ -"""aegis256x2 Python submodule. - -Simplified API: single functions can return newly allocated buffers or write -into user-provided buffers via optional `into=` (and `mac_into=` for detached). - -Error return codes from the C library raise ValueError. -""" - +"""AEGIS-256X2""" # All modules are generated from aegis256x2.py by tools/gen_modules.py! # DO NOT EDIT OTHER ALGORITHM FILES MANUALLY! @@ -529,14 +522,14 @@ class Mac: raise RuntimeError(f"mac final failed: {err_name}") return out if into is None else memoryview(out)[:maclen] # type: ignore - def verify(self, mac: Buffer) -> bool: + def verify(self, mac: Buffer): """Verify a tag for the current MAC state. Args: mac: The tag to verify (16 or 32 bytes). Returns: - True if verification succeeds. + Only if verification succeeds. Raises: TypeError: If tag length is invalid. @@ -548,7 +541,6 @@ class Mac: rc = _lib.aegis256x2_mac_verify(self._st, _ptr(mac), maclen) if rc != 0: raise ValueError("mac verification failed") - return True class Encryptor: diff --git a/pyaegis/aegis256x4.py b/pyaegis/aegis256x4.py index eb4ecf3..774db88 100644 --- a/pyaegis/aegis256x4.py +++ b/pyaegis/aegis256x4.py @@ -1,11 +1,4 @@ -"""aegis256x4 Python submodule. - -Simplified API: single functions can return newly allocated buffers or write -into user-provided buffers via optional `into=` (and `mac_into=` for detached). - -Error return codes from the C library raise ValueError. -""" - +"""AEGIS-256X4""" # All modules are generated from aegis256x4.py by tools/gen_modules.py! # DO NOT EDIT OTHER ALGORITHM FILES MANUALLY! @@ -529,14 +522,14 @@ class Mac: raise RuntimeError(f"mac final failed: {err_name}") return out if into is None else memoryview(out)[:maclen] # type: ignore - def verify(self, mac: Buffer) -> bool: + def verify(self, mac: Buffer): """Verify a tag for the current MAC state. Args: mac: The tag to verify (16 or 32 bytes). Returns: - True if verification succeeds. + Only if verification succeeds. Raises: TypeError: If tag length is invalid. @@ -548,7 +541,6 @@ class Mac: rc = _lib.aegis256x4_mac_verify(self._st, _ptr(mac), maclen) if rc != 0: raise ValueError("mac verification failed") - return True class Encryptor: