Skip to content

Add legacy symmetric ciphers (TEA, RedPike, AveMaria), export them, fix selftest import, and make Hypothesis optional in fuzz tests#1

Merged
SWORDIntel merged 1 commit into
mainfrom
codex/test-and-upgrade-cryptographic-functions
May 8, 2026
Merged

Add legacy symmetric ciphers (TEA, RedPike, AveMaria), export them, fix selftest import, and make Hypothesis optional in fuzz tests#1
SWORDIntel merged 1 commit into
mainfrom
codex/test-and-upgrade-cryptographic-functions

Conversation

@SWORDIntel
Copy link
Copy Markdown
Owner

Motivation

  • Provide interoperability/testing support for legacy block ciphers and a simple token substitution cipher used by historical tooling.
  • Ensure local selftest.py can import the repository src package when run directly.
  • Prevent test discovery failures on systems without hypothesis by adding a lightweight fallback so the test runner can still import the fuzz test module.

Description

  • Added src/crypto_standalone/symmetric/legacy_ciphers.py implementing TEA, RedPike, and AveMariaCipher with block encrypt/decrypt and simple substitution encode/decode.
  • Exported the new ciphers from src/crypto_standalone/symmetric/__init__.py and exposed them at the package top level in src/crypto_standalone/__init__.py.
  • Added unit tests tests/unit/test_legacy_ciphers.py and tests/unit/test_ave_maria_cipher.py exercising known vectors, round-trip properties, validation errors, and simple token-preservation behavior.
  • Made tests/adversarial/test_fuzz_hypothesis.py robust to missing hypothesis by adding a minimal stub implementation so the module can be imported when hypothesis is not installed.
  • Updated selftest.py to insert the repository src directory into sys.path so local package imports work when running the script directly.

Testing

  • Ran unit tests with pytest tests/unit -q and the new unit tests for TEA, RedPike, and AveMariaCipher completed successfully.
  • Ran the adversarial fuzz test module import under CI-like environment and import succeeds both with and without hypothesis installed due to the added stub; pytest tests/adversarial/test_fuzz_hypothesis.py is skipped when hypothesis is not present.
  • Executed selftest.py in a local dev environment and it successfully imported the crypto_standalone package using the injected src path.

Codex Task

@SWORDIntel SWORDIntel merged commit 379c8ad into main May 8, 2026
0 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant