Skip to content

[feat] add SEAL, SHA-256, and SM3 hash algorithm unit tests - #12

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

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

Conversation

@h1s97x

@h1s97x h1s97x commented May 16, 2026

Copy link
Copy Markdown
Owner

变更内容

新增测试文件

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

测试类 内容
TestSEALConstants K 函数范围测试
TestSEALFunctions f 函数、overflow_add、circular_shift_right
TestSEALAlgorithmProperties 数学性质和一致性测试

tests/unit/test_sha256.py (25 测试用例)

测试类 内容
TestSHA256Constants IV 和 K 常量测试
TestSHA256Functions Ch, Maj, Σ0, Σ1, σ0, σ1 函数
TestSHA256MathProperties 一致性和对称性测试

tests/unit/test_sm3.py (23 测试用例)

测试类 内容
TestSM3Constants IV 常量测试
TestSM3Functions sm3_ff_j, sm3_gg_j, sm3_p_0, sm3_p_1
TestSM3MathProperties 一致性测试

验证结果

  • pytest: 127 passed (新增 62 个测试)

Add tests/unit/test_seal.py (14 test cases):
- SEAL constants and K function
- SEAL logical functions (f, overflow_add, circular_shift_right)
- Mathematical properties and consistency tests

Add tests/unit/test_sha256.py (25 test cases):
- SHA-256 constants (IV, K)
- SHA-256 logical functions (Ch, Maj, Σ0, Σ1, σ0, σ1)
- Function consistency tests

Add tests/unit/test_sm3.py (23 test cases):
- SM3 constants (IV)
- SM3 functions (sm3_ff_j, sm3_gg_j, sm3_p_0, sm3_p_1)
- Mathematical properties tests
@h1s97x
h1s97x merged commit debd294 into main May 16, 2026
3 checks passed
@h1s97x
h1s97x deleted the feature/add-more-tests branch May 16, 2026 15:03
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