Skip to content

[feat] add AES and RSA algorithm unit tests - #14

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

[feat] add AES and RSA algorithm unit tests#14
h1s97x merged 1 commit into
mainfrom
feature/complete-tests

Conversation

@h1s97x

Copy link
Copy Markdown
Owner

变更内容

新增测试文件

tests/unit/test_aes.py (18 测试用例)

测试类内容
TestAESSBoxS-Box 常量、长度、值范围
TestAESInvSBox逆 S-Box 常量
TestAESRconRcon 常量、2倍关系
TestAESXTimex_time 函数测试
TestAESMatrixConvert矩阵转换函数
TestAESMathPropertiesS-Box 排列、一致性

tests/unit/test_rsa.py (18 测试用例)

测试类内容
TestRSAKeyGeneration1024/2048 位密钥生成
TestRSAEncryption加解密往返、不同消息/密钥
TestRSAMathProperties公钥指数、模数大小
TestRSAErrorHandling错误密钥解密、空消息

验证结果

  • pytest: 165 passed (新增 36 个测试)

Add tests/unit/test_aes.py (18 test cases):
- AES constants: S-Box, Inv S-Box, Rcon
- AES x_time function
- Matrix conversion functions
- Mathematical properties (S-Box permutation, consistency)
Add tests/unit/test_rsa.py (18 test cases):
- RSA key generation (1024-bit, 2048-bit)
- RSA encryption/decryption roundtrip
- Mathematical properties (public exponent, modulus size)
- Error handling (wrong key, empty message)
@h1s97xh1s97x self-assigned this May 16, 2026
@h1s97x
h1s97x merged commit e2161b3 into mainMay 16, 2026
3 checks passed
@h1s97x
h1s97x deleted the feature/complete-tests branch May 16, 2026 15:10
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