Update QUIC/SM9/ZUC

This commit is contained in:
Zhi Guan
2026-06-24 18:21:27 +08:00
parent e5d318d1a7
commit 09c96fa2e0
21 changed files with 7702 additions and 45 deletions

View File

@@ -64,6 +64,216 @@ if(NOT "${TEST_STDOUT}" STREQUAL "${SECRET_MESSAGE}")
message(FATAL_ERROR "stdout: ${TEST_STDOUT}")
endif()
execute_process(
COMMAND bin/gmssl sm2keygen -pass P@ssw0rd -out sm2_peer.pem -pubout sm2_peer_pub.pem
RESULT_VARIABLE TEST_RESULT
ERROR_VARIABLE TEST_STDERR
)
if(NOT ${TEST_RESULT} EQUAL 0)
message(FATAL_ERROR "stderr: ${TEST_STDERR}")
endif()
execute_process(
COMMAND bin/gmssl sm2exch -stage init
-exch_keyout sm2exch_alice_ra.pem -exch_pass P@ssw0rd
-out sm2exch_ra.bin
RESULT_VARIABLE TEST_RESULT
ERROR_VARIABLE TEST_STDERR
)
if(NOT ${TEST_RESULT} EQUAL 0)
message(FATAL_ERROR "stderr: ${TEST_STDERR}")
endif()
execute_process(
COMMAND bin/gmssl sm2exch -stage respond
-key sm2_peer.pem -pass P@ssw0rd -id Bob
-peer_pubkey sm2pub.pem -peer_id Alice -in sm2exch_ra.bin
-exch_keyout sm2exch_bob_rb.pem -exch_pass P@ssw0rd
-secret_state_out sm2exch_bob_secret_state.bin
-out sm2exch_rb_sb.bin
RESULT_VARIABLE TEST_RESULT
ERROR_VARIABLE TEST_STDERR
)
if(NOT ${TEST_RESULT} EQUAL 0)
message(FATAL_ERROR "stderr: ${TEST_STDERR}")
endif()
execute_process(
COMMAND bin/gmssl sm2exch -stage confirm
-key sm2.pem -pass P@ssw0rd -id Alice
-peer_pubkey sm2_peer_pub.pem -peer_id Bob
-exch_key sm2exch_alice_ra.pem -exch_pass P@ssw0rd
-in sm2exch_rb_sb.bin
-keylen 48 -keyout sm2exch_alice_key.bin
-secret_state_out sm2exch_alice_secret_state.bin
-out sm2exch_sa.bin
RESULT_VARIABLE TEST_RESULT
ERROR_VARIABLE TEST_STDERR
)
if(NOT ${TEST_RESULT} EQUAL 0)
message(FATAL_ERROR "stderr: ${TEST_STDERR}")
endif()
execute_process(
COMMAND bin/gmssl sm2exch -stage finish
-key sm2_peer.pem -pass P@ssw0rd -id Bob
-peer_pubkey sm2pub.pem -peer_id Alice
-exch_key sm2exch_bob_rb.pem -exch_pass P@ssw0rd
-secret_state sm2exch_bob_secret_state.bin
-in sm2exch_sa.bin
-keylen 48 -keyout sm2exch_bob_key.bin
RESULT_VARIABLE TEST_RESULT
ERROR_VARIABLE TEST_STDERR
)
if(NOT ${TEST_RESULT} EQUAL 0)
message(FATAL_ERROR "stderr: ${TEST_STDERR}")
endif()
execute_process(
COMMAND ${CMAKE_COMMAND} -E compare_files sm2exch_alice_key.bin sm2exch_bob_key.bin
RESULT_VARIABLE TEST_RESULT
)
if(NOT ${TEST_RESULT} EQUAL 0)
message(FATAL_ERROR "SM2 key exchange output mismatch")
endif()
execute_process(
COMMAND ${CMAKE_COMMAND} -E compare_files sm2exch_alice_secret_state.bin sm2exch_bob_secret_state.bin
RESULT_VARIABLE TEST_RESULT
)
if(NOT ${TEST_RESULT} EQUAL 0)
message(FATAL_ERROR "SM2 key exchange secret_state mismatch")
endif()
execute_process(
COMMAND bin/gmssl sm2exch -stage init -bin
-exch_keyout sm2exch_bin_alice_ra.pem -exch_pass P@ssw0rd
-out sm2exch_bin_ra.bin
RESULT_VARIABLE TEST_RESULT
ERROR_VARIABLE TEST_STDERR
)
if(NOT ${TEST_RESULT} EQUAL 0)
message(FATAL_ERROR "stderr: ${TEST_STDERR}")
endif()
execute_process(
COMMAND bin/gmssl sm2exch -stage respond -bin
-key sm2_peer.pem -pass P@ssw0rd -id Bob
-peer_pubkey sm2pub.pem -peer_id Alice -in sm2exch_bin_ra.bin
-exch_keyout sm2exch_bin_bob_rb.pem -exch_pass P@ssw0rd
-secret_state_out sm2exch_bin_bob_secret_state.bin
-out sm2exch_bin_rb_sb.bin
RESULT_VARIABLE TEST_RESULT
ERROR_VARIABLE TEST_STDERR
)
if(NOT ${TEST_RESULT} EQUAL 0)
message(FATAL_ERROR "stderr: ${TEST_STDERR}")
endif()
execute_process(
COMMAND bin/gmssl sm2exch -stage confirm -bin
-key sm2.pem -pass P@ssw0rd -id Alice
-peer_pubkey sm2_peer_pub.pem -peer_id Bob
-exch_key sm2exch_bin_alice_ra.pem -exch_pass P@ssw0rd
-in sm2exch_bin_rb_sb.bin
-keylen 48 -keyout sm2exch_bin_alice_key.bin
-secret_state_out sm2exch_bin_alice_secret_state.bin
-out sm2exch_bin_sa.bin
RESULT_VARIABLE TEST_RESULT
ERROR_VARIABLE TEST_STDERR
)
if(NOT ${TEST_RESULT} EQUAL 0)
message(FATAL_ERROR "stderr: ${TEST_STDERR}")
endif()
execute_process(
COMMAND bin/gmssl sm2exch -stage finish -bin
-key sm2_peer.pem -pass P@ssw0rd -id Bob
-peer_pubkey sm2pub.pem -peer_id Alice
-exch_key sm2exch_bin_bob_rb.pem -exch_pass P@ssw0rd
-secret_state sm2exch_bin_bob_secret_state.bin
-in sm2exch_bin_sa.bin
-keylen 48 -keyout sm2exch_bin_bob_key.bin
RESULT_VARIABLE TEST_RESULT
ERROR_VARIABLE TEST_STDERR
)
if(NOT ${TEST_RESULT} EQUAL 0)
message(FATAL_ERROR "stderr: ${TEST_STDERR}")
endif()
execute_process(
COMMAND ${CMAKE_COMMAND} -E compare_files sm2exch_bin_alice_key.bin sm2exch_bin_bob_key.bin
RESULT_VARIABLE TEST_RESULT
)
if(NOT ${TEST_RESULT} EQUAL 0)
message(FATAL_ERROR "SM2 binary key exchange output mismatch")
endif()
execute_process(
COMMAND bin/gmssl sm2exch -stage init
-exch_keyout sm2exch_stdio_alice_ra.pem -exch_pass P@ssw0rd
OUTPUT_FILE sm2exch_stdio_ra.hex
RESULT_VARIABLE TEST_RESULT
ERROR_VARIABLE TEST_STDERR
)
if(NOT ${TEST_RESULT} EQUAL 0)
message(FATAL_ERROR "stderr: ${TEST_STDERR}")
endif()
execute_process(
COMMAND bin/gmssl sm2exch -stage respond
-key sm2_peer.pem -pass P@ssw0rd -id Bob
-peer_pubkey sm2pub.pem -peer_id Alice
-exch_keyout sm2exch_stdio_bob_rb.pem -exch_pass P@ssw0rd
-secret_state_out sm2exch_stdio_bob_secret_state.hex
INPUT_FILE sm2exch_stdio_ra.hex
OUTPUT_FILE sm2exch_stdio_rb_sb.hex
RESULT_VARIABLE TEST_RESULT
ERROR_VARIABLE TEST_STDERR
)
if(NOT ${TEST_RESULT} EQUAL 0)
message(FATAL_ERROR "stderr: ${TEST_STDERR}")
endif()
execute_process(
COMMAND bin/gmssl sm2exch -stage confirm
-key sm2.pem -pass P@ssw0rd -id Alice
-peer_pubkey sm2_peer_pub.pem -peer_id Bob
-exch_key sm2exch_stdio_alice_ra.pem -exch_pass P@ssw0rd
-keylen 48 -keyout sm2exch_stdio_alice_key.hex
-secret_state_out sm2exch_stdio_alice_secret_state.hex
INPUT_FILE sm2exch_stdio_rb_sb.hex
OUTPUT_FILE sm2exch_stdio_sa.hex
RESULT_VARIABLE TEST_RESULT
ERROR_VARIABLE TEST_STDERR
)
if(NOT ${TEST_RESULT} EQUAL 0)
message(FATAL_ERROR "stderr: ${TEST_STDERR}")
endif()
execute_process(
COMMAND bin/gmssl sm2exch -stage finish
-key sm2_peer.pem -pass P@ssw0rd -id Bob
-peer_pubkey sm2pub.pem -peer_id Alice
-exch_key sm2exch_stdio_bob_rb.pem -exch_pass P@ssw0rd
-secret_state sm2exch_stdio_bob_secret_state.hex
-keylen 48 -keyout sm2exch_stdio_bob_key.hex
INPUT_FILE sm2exch_stdio_sa.hex
RESULT_VARIABLE TEST_RESULT
ERROR_VARIABLE TEST_STDERR
)
if(NOT ${TEST_RESULT} EQUAL 0)
message(FATAL_ERROR "stderr: ${TEST_STDERR}")
endif()
execute_process(
COMMAND ${CMAKE_COMMAND} -E compare_files sm2exch_stdio_alice_key.hex sm2exch_stdio_bob_key.hex
RESULT_VARIABLE TEST_RESULT
)
if(NOT ${TEST_RESULT} EQUAL 0)
message(FATAL_ERROR "SM2 stdio key exchange output mismatch")
endif()
execute_process(
COMMAND bin/gmssl sm2sign -key sm2.pem -pass P@ssw0rd -id Alice -in message.txt -out sm2_id.sig
RESULT_VARIABLE TEST_RESULT

View File

@@ -2,7 +2,6 @@ include("${CMAKE_CURRENT_LIST_DIR}/tool_helpers.cmake")
set(SM4_KEY 0123456789abcdeffedcba9876543210)
set(SM4_IV 00000000000000000000000000000000)
set(SM4_HMAC_KEY 0123456789abcdeffedcba98765432100123456789abcdeffedcba98765432100123456789abcdeffedcba9876543210)
set(SM4_XTS_KEY 0123456789abcdeffedcba987654321000112233445566778899aabbccddeeff)
set(SM4_FF1_KEY 2b7e151628aed2a6abf7158809cf4f3c)
set(SM4_TEXT "0123456789abcdef0123456789abcdef")
@@ -23,23 +22,39 @@ gmssl_run(sm4_cbc -decrypt -key ${SM4_KEY} -iv ${SM4_IV}
-in tool_sm4_cbc_kat.cipher -out tool_sm4_cbc_kat.decrypt)
gmssl_files_equal(tool_sm4_cbc_kat.plain tool_sm4_cbc_kat.decrypt)
file(WRITE tool_sm4_unified_cbc_kat.plain "0123456789abcdef")
gmssl_run(sm4 -cbc -encrypt -key ${SM4_KEY} -iv ${SM4_IV}
-in tool_sm4_unified_cbc_kat.plain -out tool_sm4_unified_cbc_kat.cipher)
gmssl_expect_file_hex(tool_sm4_unified_cbc_kat.cipher
"e6887b77dbabb572ffa07fed7548b192ceaace11f2b90b94c2b7a4d9382e471e")
gmssl_run(sm4 -cbc -decrypt -key ${SM4_KEY} -iv ${SM4_IV}
-in tool_sm4_unified_cbc_kat.cipher -out tool_sm4_unified_cbc_kat.decrypt)
gmssl_files_equal(tool_sm4_unified_cbc_kat.plain tool_sm4_unified_cbc_kat.decrypt)
gmssl_symmetric_roundtrip(tool_sm4_cbc sm4_cbc -key ${SM4_KEY} -iv ${SM4_IV})
gmssl_symmetric_roundtrip(tool_sm4_ctr sm4_ctr -key ${SM4_KEY} -iv ${SM4_IV})
gmssl_symmetric_roundtrip(tool_sm4_gcm sm4_gcm -key ${SM4_KEY} -iv 000000000000000000000000 -aad_hex 001122 -taglen 16)
gmssl_symmetric_roundtrip(tool_sm4_cbc_sm3_hmac sm4_cbc_sm3_hmac -key ${SM4_HMAC_KEY} -iv ${SM4_IV} -aad_hex 001122)
gmssl_symmetric_roundtrip(tool_sm4_ctr_sm3_hmac sm4_ctr_sm3_hmac -key ${SM4_HMAC_KEY} -iv ${SM4_IV} -aad_hex 001122)
gmssl_symmetric_roundtrip(tool_sm4_unified_cbc sm4 -cbc -key ${SM4_KEY} -iv ${SM4_IV})
gmssl_symmetric_roundtrip(tool_sm4_unified_ctr sm4 -ctr -key ${SM4_KEY} -iv ${SM4_IV})
gmssl_symmetric_roundtrip(tool_sm4_unified_gcm sm4 -gcm -key ${SM4_KEY} -iv 000000000000000000000000 -aad_hex 001122 -taglen 16)
if(ENABLE_SM4_ECB)
gmssl_symmetric_roundtrip(tool_sm4_ecb sm4_ecb -key ${SM4_KEY})
gmssl_symmetric_roundtrip(tool_sm4_unified_ecb sm4 -ecb -key ${SM4_KEY})
endif()
if(ENABLE_SM4_CFB)
gmssl_symmetric_roundtrip(tool_sm4_cfb sm4_cfb -sbytes 16 -key ${SM4_KEY} -iv ${SM4_IV})
gmssl_symmetric_roundtrip(tool_sm4_unified_cfb sm4 -cfb -sbytes 16 -key ${SM4_KEY} -iv ${SM4_IV})
gmssl_symmetric_roundtrip(tool_sm4_unified_cfb8 sm4 -cfb -sbytes 1 -key ${SM4_KEY} -iv ${SM4_IV})
endif()
if(ENABLE_SM4_OFB)
gmssl_symmetric_roundtrip(tool_sm4_ofb sm4_ofb -key ${SM4_KEY} -iv ${SM4_IV})
gmssl_symmetric_roundtrip(tool_sm4_unified_ofb sm4 -ofb -key ${SM4_KEY} -iv ${SM4_IV})
endif()
if(ENABLE_SM4_CCM)
gmssl_symmetric_roundtrip(tool_sm4_ccm sm4_ccm -key ${SM4_KEY} -iv 000000000000000000000000 -aad_hex 001122 -taglen 16)
gmssl_symmetric_roundtrip(tool_sm4_unified_ccm sm4 -ccm -key ${SM4_KEY} -iv 000000000000000000000000 -aad_hex 001122 -taglen 16)
endif()
if(ENABLE_SM4_XTS)
file(WRITE tool_sm4_xts.plain "0123456789abcdef0123456789abcdef")
@@ -48,6 +63,12 @@ if(ENABLE_SM4_XTS)
gmssl_run(sm4_xts -decrypt -key ${SM4_XTS_KEY} -iv ${SM4_IV} -data_unit_size 32
-in tool_sm4_xts.cipher -out tool_sm4_xts.decrypt)
gmssl_files_equal(tool_sm4_xts.plain tool_sm4_xts.decrypt)
file(WRITE tool_sm4_unified_xts.plain "0123456789abcdef0123456789abcdef")
gmssl_run(sm4 -xts -encrypt -key ${SM4_XTS_KEY} -iv ${SM4_IV} -data_unit_size 32
-in tool_sm4_unified_xts.plain -out tool_sm4_unified_xts.cipher)
gmssl_run(sm4 -xts -decrypt -key ${SM4_XTS_KEY} -iv ${SM4_IV} -data_unit_size 32
-in tool_sm4_unified_xts.cipher -out tool_sm4_unified_xts.decrypt)
gmssl_files_equal(tool_sm4_unified_xts.plain tool_sm4_unified_xts.decrypt)
endif()
if(ENABLE_SM4_FF1)
gmssl_expect_stdout("2326982895499381\n"

View File

@@ -24,8 +24,119 @@ gmssl_run(sm9keygen -alg sm9encrypt
-in tool_sm9_enc_msk.pem -inpass ${SM9_PASS}
-id ${SM9_ID}
-out tool_sm9_enc_key.pem -outpass ${SM9_USER_PASS})
gmssl_run(sm9keygen -alg sm9keyagreement
-in tool_sm9_enc_msk.pem -inpass ${SM9_PASS}
-id Bob
-out tool_sm9_bob_exch_key.pem -outpass ${SM9_USER_PASS})
gmssl_run(sm9encrypt -pubmaster tool_sm9_enc_mpk.pem -id ${SM9_ID}
-in tool_sm9_message.txt -out tool_sm9_cipher.der)
gmssl_run(sm9decrypt -key tool_sm9_enc_key.pem -pass ${SM9_USER_PASS} -id ${SM9_ID}
-in tool_sm9_cipher.der -out tool_sm9_plain.txt)
gmssl_expect_file_text(tool_sm9_plain.txt "${SM9_TEXT}")
gmssl_run(sm9keygen -alg sm9keyagreement
-in tool_sm9_enc_msk.pem -inpass ${SM9_PASS}
-id ${SM9_ID}
-out tool_sm9_alice_exch_key.pem -outpass ${SM9_USER_PASS})
gmssl_run(sm9exch -stage init
-pubmaster tool_sm9_enc_mpk.pem -peer_id Bob
-exch_keyout tool_sm9_alice_ra.pem -out tool_sm9_ra.bin)
gmssl_run(sm9exch -stage respond
-pubmaster tool_sm9_enc_mpk.pem
-key tool_sm9_bob_exch_key.pem -pass ${SM9_USER_PASS} -id Bob
-peer_id ${SM9_ID} -in tool_sm9_ra.bin
-exch_keyout tool_sm9_bob_rb.pem -out tool_sm9_rb_sb.bin)
gmssl_run(sm9exch -stage confirm
-pubmaster tool_sm9_enc_mpk.pem
-key tool_sm9_alice_exch_key.pem -pass ${SM9_USER_PASS} -id ${SM9_ID}
-peer_id Bob -exch_key tool_sm9_alice_ra.pem
-in tool_sm9_rb_sb.bin
-keylen 48 -keyout tool_sm9_alice_shared_key.bin
-out tool_sm9_sa.bin)
gmssl_run(sm9exch -stage finish
-pubmaster tool_sm9_enc_mpk.pem
-key tool_sm9_bob_exch_key.pem -pass ${SM9_USER_PASS} -id Bob
-peer_id ${SM9_ID}
-exch_key tool_sm9_bob_rb.pem
-in tool_sm9_sa.bin
-keylen 48 -keyout tool_sm9_bob_shared_key.bin)
gmssl_files_equal(tool_sm9_alice_shared_key.bin tool_sm9_bob_shared_key.bin)
gmssl_run(sm9exch -stage init -bin
-pubmaster tool_sm9_enc_mpk.pem -peer_id Bob
-exch_keyout tool_sm9_bin_alice_ra.pem -out tool_sm9_bin_ra.bin)
gmssl_run(sm9exch -stage respond -bin
-pubmaster tool_sm9_enc_mpk.pem
-key tool_sm9_bob_exch_key.pem -pass ${SM9_USER_PASS} -id Bob
-peer_id ${SM9_ID} -in tool_sm9_bin_ra.bin
-exch_keyout tool_sm9_bin_bob_rb.pem -out tool_sm9_bin_rb_sb.bin)
gmssl_run(sm9exch -stage confirm -bin
-pubmaster tool_sm9_enc_mpk.pem
-key tool_sm9_alice_exch_key.pem -pass ${SM9_USER_PASS} -id ${SM9_ID}
-peer_id Bob -exch_key tool_sm9_bin_alice_ra.pem
-in tool_sm9_bin_rb_sb.bin
-keylen 48 -keyout tool_sm9_bin_alice_shared_key.bin
-out tool_sm9_bin_sa.bin)
gmssl_run(sm9exch -stage finish -bin
-pubmaster tool_sm9_enc_mpk.pem
-key tool_sm9_bob_exch_key.pem -pass ${SM9_USER_PASS} -id Bob
-peer_id ${SM9_ID}
-exch_key tool_sm9_bin_bob_rb.pem
-in tool_sm9_bin_sa.bin
-keylen 48 -keyout tool_sm9_bin_bob_shared_key.bin)
gmssl_files_equal(tool_sm9_bin_alice_shared_key.bin tool_sm9_bin_bob_shared_key.bin)
execute_process(
COMMAND ${GMSSL_BIN} sm9exch -stage init
-pubmaster tool_sm9_enc_mpk.pem -peer_id Bob
-exch_keyout tool_sm9_stdio_alice_ra.pem
OUTPUT_FILE tool_sm9_stdio_ra.hex
RESULT_VARIABLE TEST_RESULT
ERROR_VARIABLE TEST_STDERR
)
if(NOT TEST_RESULT EQUAL 0)
message(FATAL_ERROR "command failed: ${GMSSL_BIN} sm9exch -stage init\nstderr: ${TEST_STDERR}")
endif()
execute_process(
COMMAND ${GMSSL_BIN} sm9exch -stage respond
-pubmaster tool_sm9_enc_mpk.pem
-key tool_sm9_bob_exch_key.pem -pass ${SM9_USER_PASS} -id Bob
-peer_id ${SM9_ID}
-exch_keyout tool_sm9_stdio_bob_rb.pem
INPUT_FILE tool_sm9_stdio_ra.hex
OUTPUT_FILE tool_sm9_stdio_rb_sb.hex
RESULT_VARIABLE TEST_RESULT
ERROR_VARIABLE TEST_STDERR
)
if(NOT TEST_RESULT EQUAL 0)
message(FATAL_ERROR "command failed: ${GMSSL_BIN} sm9exch -stage respond\nstderr: ${TEST_STDERR}")
endif()
execute_process(
COMMAND ${GMSSL_BIN} sm9exch -stage confirm
-pubmaster tool_sm9_enc_mpk.pem
-key tool_sm9_alice_exch_key.pem -pass ${SM9_USER_PASS} -id ${SM9_ID}
-peer_id Bob -exch_key tool_sm9_stdio_alice_ra.pem
-keylen 48 -keyout tool_sm9_stdio_alice_shared_key.hex
INPUT_FILE tool_sm9_stdio_rb_sb.hex
OUTPUT_FILE tool_sm9_stdio_sa.hex
RESULT_VARIABLE TEST_RESULT
ERROR_VARIABLE TEST_STDERR
)
if(NOT TEST_RESULT EQUAL 0)
message(FATAL_ERROR "command failed: ${GMSSL_BIN} sm9exch -stage confirm\nstderr: ${TEST_STDERR}")
endif()
execute_process(
COMMAND ${GMSSL_BIN} sm9exch -stage finish
-pubmaster tool_sm9_enc_mpk.pem
-key tool_sm9_bob_exch_key.pem -pass ${SM9_USER_PASS} -id Bob
-peer_id ${SM9_ID}
-exch_key tool_sm9_stdio_bob_rb.pem
-keylen 48 -keyout tool_sm9_stdio_bob_shared_key.hex
INPUT_FILE tool_sm9_stdio_sa.hex
RESULT_VARIABLE TEST_RESULT
ERROR_VARIABLE TEST_STDERR
)
if(NOT TEST_RESULT EQUAL 0)
message(FATAL_ERROR "command failed: ${GMSSL_BIN} sm9exch -stage finish\nstderr: ${TEST_STDERR}")
endif()
gmssl_files_equal(tool_sm9_stdio_alice_shared_key.hex tool_sm9_stdio_bob_shared_key.hex)

View File

@@ -8,3 +8,25 @@ gmssl_run(zuc -key ${ZUC_KEY} -iv ${ZUC_IV} -in tool_zuc.plain -out tool_zuc.cip
gmssl_expect_file_hex(tool_zuc.cipher "178fec4735b5b4edbfed84d4fc7cda00")
gmssl_run(zuc -key ${ZUC_KEY} -iv ${ZUC_IV} -in tool_zuc.cipher -out tool_zuc.decrypt)
gmssl_files_equal(tool_zuc.plain tool_zuc.decrypt)
gmssl_run(zuc_128_eea3
-key 173d14ba5003731d7a60049470f00a29
-count 0x66035492 -bearer 15 -direction 0
-in_hex 6cf65340735552ab0c9752fa6f9025fe0bd675d9005875b2
-out tool_zuc_128_eea3.cipher)
gmssl_expect_file_hex(tool_zuc_128_eea3.cipher
"a6c85fc66afb8533aafc2518dfe784940ee1e4b030238cc8")
gmssl_expect_stdout("390a91b7\n" zuc_128_eia3
-key 00000000000000000000000000000000
-count 0 -bearer 0 -direction 0 -in_hex 00)
gmssl_run(zuc256
-key 0000000000000000000000000000000000000000000000000000000000000000
-iv 0000000000000000000000000000000000000000000000
-in tool_zuc.plain -out tool_zuc256.cipher)
gmssl_expect_file_hex(tool_zuc256.cipher "68e108e51a361ad5e2c509585ad9ae65")
gmssl_run(zuc256
-key 0000000000000000000000000000000000000000000000000000000000000000
-iv 0000000000000000000000000000000000000000000000
-in tool_zuc256.cipher -out tool_zuc256.decrypt)
gmssl_files_equal(tool_zuc.plain tool_zuc256.decrypt)