Skip to content

[feat] add Crypto-1 and ECC algorithm unit tests - #10

Merged
h1s97x merged 1 commit into
mainfrom
feature/add-crypto-tests
May 16, 2026
Merged

[feat] add Crypto-1 and ECC algorithm unit tests#10
h1s97x merged 1 commit into
mainfrom
feature/add-crypto-tests

Conversation

@h1s97x

Copy link
Copy Markdown
Owner

变更内容

新增测试文件

tests/unit/test_crypto1.py (14 测试用例)

测试类测试项
TestCrypto1Toolsint_to_bit_str, bit_str_to_int, list转换
TestCrypto1FilterFunctionsfa, fb, fc 滤波函数
TestCrypto1LFSRleft_one移位, 反馈计算, 初始化
TestCrypto1KeyStream密钥流长度, 确定性
TestCrypto1EncryptDecryptXOR对称性, 加解密一致性

tests/unit/test_ecc.py (13 测试用例)

测试类测试项
TestECCUtilsstr_add_space 工具函数
TestECCKeyGeneration密钥生成, 唯一性
TestECCEncryption密文生成, 不同明文/密钥
TestECCDecryption明文恢复, 各种长度, 结构验证

验证结果

  • pytest: 77 passed
  • Crypto-1: 14 passed
  • ECC: 13 passed

Add tests/unit/test_crypto1.py (14 test cases):
- Crypto-1 tools: int_to_bit_str, bit_str_to_int, bit_str_to_int_list, int_list_to_bit_str
- Filter functions: fa, fb, fc
- LFSR operations: left_one shift, feedback calculation, initialization
- Keystream generation: length, determinism
- Encrypt/decrypt symmetry
Add tests/unit/test_ecc.py (13 test cases):
- Utils: str_add_space function
- Key generation: valid keys, uniqueness
- Encryption: ciphertext production, different plaintexts/keys
- Decryption: original plaintext recovery, various lengths, structure validation
@h1s97xh1s97x self-assigned this May 16, 2026
@h1s97x
h1s97x merged commit fe81bb0 into mainMay 16, 2026
3 checks passed
@h1s97x
h1s97x deleted the feature/add-crypto-tests branch May 16, 2026 14:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@h1s97x