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

[feat] add SEAL, SHA-256, and SM3 hash algorithm unit tests#12
h1s97x merged 1 commit into
mainfrom
feature/add-more-tests

Conversation

@h1s97x

Copy link
Copy Markdown
Owner

变更内容

新增测试文件

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

测试类内容
TestSEALConstantsK 函数范围测试
TestSEALFunctionsf 函数、overflow_add、circular_shift_right
TestSEALAlgorithmProperties数学性质和一致性测试

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

测试类内容
TestSHA256ConstantsIV 和 K 常量测试
TestSHA256FunctionsCh, Maj, Σ0, Σ1, σ0, σ1 函数
TestSHA256MathProperties一致性和对称性测试

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

测试类内容
TestSM3ConstantsIV 常量测试
TestSM3Functionssm3_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 mainMay 16, 2026
3 checks passed
@h1s97x
h1s97x deleted the feature/add-more-tests branch May 16, 2026 15:03
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