seckit/docs/sm3hmac-testcases.md
2026-04-15 18:02:28 +08:00

28 lines
1.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# SM3 HMAC 测试用例
## 测试用例列表
### sm3hmac-001
- **输入**:
- 密钥: "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20"
- 消息: "6162636462636465636465666465666765666768666768696768696a68696a6b696a6b6c6a6b6c6d6b6c6d6e6c6d6e6f6d6e6f706e6f70716162636462636465636465666465666765666768666768696768696a68696a6b696a6b6c6a6b6c6d6b6c6d6e6c6d6e6f6d6e6f706e6f7071" "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopqabcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" 的 hex 表示)
- **预期输出**: "ca05e144ed05d1857840d1f318a4a8669e559fc8391f414485bfdf7bb408963a"
### sm3hmac-002
- **输入**:
- 密钥: "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425"
- 消息: "cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd"
- **预期输出**: "220bf579ded555393f0159f66c99877822a3ecf610d1552154b41d44b94db3ae"
### sm3hmac-003
- **输入**:
- 密钥: "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"
- 消息: "4869205468657265" "Hi There" 的 hex 表示)
- **预期输出**: "c0ba18c68b90c88bc07de794bfc7d2c8d19ec31ed8773bc2b390c9604e0be11e"
### sm3hmac-004
- **输入**:
- 密钥: "4a656665" "Jefe" 的 hex 表示)
- 消息: "7768617420646f2079612077616e7420666f72206e6f7468696e673f" "what do ya want for nothing?" 的 hex 表示)
- **预期输出**: "2e87f1d16862e6d964b50a5200bf2b10b764faa9680a296a2405f24bec39f882"