mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-06-27 15:43:42 +08:00
Update tests
This commit is contained in:
20
cmake/tool_sm3.cmake
Normal file
20
cmake/tool_sm3.cmake
Normal file
@@ -0,0 +1,20 @@
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/tool_helpers.cmake")
|
||||
|
||||
gmssl_expect_stdout("66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0\n"
|
||||
sm3 -in_str abc)
|
||||
|
||||
file(WRITE tool_sm3_input.txt "abc")
|
||||
gmssl_expect_stdout("66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0\n"
|
||||
sm3 -hex -in tool_sm3_input.txt)
|
||||
gmssl_run(sm3 -bin -in tool_sm3_input.txt -out tool_sm3.bin)
|
||||
gmssl_expect_file_hex(tool_sm3.bin "66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0")
|
||||
|
||||
gmssl_expect_stdout("28d8a61be67d8bf7652c4eda7092b612f88be62184f55005c57ddf076e764199\n"
|
||||
sm3hmac -key 0123456789abcdeffedcba9876543210 -in_str abc)
|
||||
gmssl_run(sm3hmac -key 0123456789abcdeffedcba9876543210 -bin -in tool_sm3_input.txt -out tool_sm3hmac.bin)
|
||||
gmssl_expect_file_hex(tool_sm3hmac.bin "28d8a61be67d8bf7652c4eda7092b612f88be62184f55005c57ddf076e764199")
|
||||
|
||||
gmssl_expect_stdout("df6b713d38d5a35df6861959e529ed22\n"
|
||||
sm3_pbkdf2 -pass password -salt 0011223344556677 -iter 10000 -outlen 16 -hex)
|
||||
gmssl_run(sm3_pbkdf2 -pass password -salt 0011223344556677 -iter 10000 -outlen 16 -bin -out tool_sm3_pbkdf2.bin)
|
||||
gmssl_expect_file_hex(tool_sm3_pbkdf2.bin "df6b713d38d5a35df6861959e529ed22")
|
||||
Reference in New Issue
Block a user