From f5ed97174730b7a4e7ef336fba32ec8669afc084 Mon Sep 17 00:00:00 2001 From: Zhi Guan Date: Tue, 14 May 2024 10:08:05 +0800 Subject: [PATCH] Update sm4_ctr_sm3_hmac.c --- tools/sm4_ctr_sm3_hmac.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/sm4_ctr_sm3_hmac.c b/tools/sm4_ctr_sm3_hmac.c index 25f85557e..676c3424a 100755 --- a/tools/sm4_ctr_sm3_hmac.c +++ b/tools/sm4_ctr_sm3_hmac.c @@ -32,12 +32,16 @@ static const char *options = " -in file | stdin Input data\n" " -out file | stdout Output data\n" "\n" -"Examples" +"Examples\n" "\n" -" echo \"hello\" | gmssl sm4_ctr_sm3_hmac -encrypt -key 11223344556677881122334455667788 -iv 112233445566778811223344 -out ciphertext.bin\n" -" gmssl sm4_ctr_sm3_hmac -decrypt -key 11223344556677881122334455667788 -iv 112233445566778811223344 -in ciphertext.bin\n" +" $ TEXT=`gmssl rand -outlen 20 -hex`\n" +" $ KEY=`gmssl rand -outlen 48 -hex`\n" +" $ IV=`gmssl rand -outlen 16 -hex`\n" +" $ echo -n $TEXT | gmssl sm4_ctr_sm3_hmac -encrypt -key $KEY -iv $IV -out sm4_ctr_sm3_hmac_ciphertext.bin\n" +" $ gmssl sm4_ctr_sm3_hmac -decrypt -key $KEY -iv $IV -in sm4_ctr_sm3_hmac_ciphertext.bin\n" "\n"; + int sm4_ctr_sm3_hmac_main(int argc, char **argv) { int ret = 1;