Add SM4 commands in gmssl CLI

This commit is contained in:
Zhi Guan
2024-05-11 18:10:24 +08:00
parent 2c125fbaa5
commit 58340393b1
19 changed files with 1895 additions and 113 deletions

View File

@@ -31,8 +31,8 @@ static int test_sm4_ccm(void)
size_t len[] = { 4, 16, 36, 64 };
uint8_t encrypted[sizeof(plaintext)];
uint8_t decrypted[sizeof(plaintext)];
uint8_t mac[SM4_CCM_MAX_MAC_SIZE];
size_t maclen[] = { SM4_CCM_MIN_MAC_SIZE, SM4_CCM_MAX_MAC_SIZE };
uint8_t mac[SM4_CCM_MAX_TAG_SIZE];
size_t maclen[] = { SM4_CCM_MIN_TAG_SIZE, SM4_CCM_MAX_TAG_SIZE };
size_t i;
rand_bytes(key, sizeof(key));