From 8a5e342905d12de9906d039a23266e9c31ac2007 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Sun, 4 Jan 2026 14:25:39 +0000 Subject: [PATCH] Allow the cipher() function also work without prefix aegis --- src/aeg/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/aeg/__init__.py b/src/aeg/__init__.py index 4c918f7..12b52c1 100644 --- a/src/aeg/__init__.py +++ b/src/aeg/__init__.py @@ -11,6 +11,8 @@ def cipher(alg: CipherName) -> Cipher: name = alg.lower().replace("-", "") if name == "aegis128": name = "aegis128l" # AEGIS-128 is dead, the user meant AEGIS-128L + if not name.startswith("aegis"): + name = "aegis" + name if name in CIPHERS.values(): return importlib.import_module(f".{name}", __package__) # type: ignore[return-value] raise ValueError(f"Unknown algorithm {alg!r}. Valid options: {', '.join(CIPHERS)}")