Add more SM4 test vectors

SM4 pass openssl and other known test vectors. SM4-GCM and SM4-XTS only support the GB/T GF(2^128) encoding standard.
This commit is contained in:
Zhi Guan
2024-04-21 10:10:46 +08:00
parent a485fa0b10
commit 252c9e1765
16 changed files with 1267 additions and 691 deletions

View File

@@ -196,7 +196,7 @@ static int test_sm4_gcm_gbt36624_2(void)
return 1;
}
static int test_sm4_gcm_update(void)
static int test_sm4_gcm_ctx(void)
{
SM4_GCM_CTX aead_ctx;
uint8_t key[16];
@@ -317,7 +317,7 @@ int main(void)
if (test_sm4_gcm() != 1) goto err;
if (test_sm4_gcm_gbt36624_1() != 1) goto err;
if (test_sm4_gcm_gbt36624_2() != 1) goto err;
if (test_sm4_gcm_update() != 1) goto err;
if (test_sm4_gcm_ctx() != 1) goto err;
printf("%s all tests passed\n", __FILE__);
return 0;
err: