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

h1s97x merged 1 commit into
mainfrom
feature/add-crypto-tests

Conversation

@h1s97x

@h1s97x h1s97x commented May 16, 2026

Copy link
Copy Markdown
Owner

变更内容

新增测试文件

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

测试类 测试项
TestCrypto1Tools int_to_bit_str, bit_str_to_int, list转换
TestCrypto1FilterFunctions fa, fb, fc 滤波函数
TestCrypto1LFSR left_one移位, 反馈计算, 初始化
TestCrypto1KeyStream 密钥流长度, 确定性
TestCrypto1EncryptDecrypt XOR对称性, 加解密一致性

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

测试类 测试项
TestECCUtils str_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
@h1s97x h1s97x self-assigned this May 16, 2026
@h1s97x
h1s97x merged commit fe81bb0 into main May 16, 2026
3 checks passed
@h1s97x
h1s97x deleted the feature/add-crypto-tests branch May 16, 2026 14:43
Sign up for free to 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