Update sm4 tool to support more modes

Not finish yet
This commit is contained in:
Zhi Guan
2024-02-21 09:24:22 +08:00
parent 326e7de416
commit 79a6437c8c
4 changed files with 526 additions and 27 deletions

View File

@@ -27,10 +27,11 @@ static int test_sm4_xts(void)
uint8_t plaintext[16 * 4];
uint8_t encrypted[sizeof(plaintext)];
uint8_t decrypted[sizeof(plaintext)];
size_t tweak = 0x12345678;
uint8_t tweak[16];
size_t i;
rand_bytes(key, sizeof(key));
rand_bytes(tweak, sizeof(tweak));
rand_bytes(plaintext, sizeof(plaintext));
for (i = 0; i < sizeof(len)/sizeof(len[0]); i++) {