mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-06 16:36:16 +08:00
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:
@@ -47,7 +47,7 @@ static int test_sm4_ecb(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int test_sm4_ecb_testvec(void)
|
||||
static int test_sm4_ecb_test_vectors(void)
|
||||
{
|
||||
SM4_KEY sm4_key;
|
||||
uint8_t key[16] = {
|
||||
@@ -180,11 +180,10 @@ static int test_sm4_ecb_ctx(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
if (test_sm4_ecb() != 1) goto err;
|
||||
if (test_sm4_ecb_testvec() != 1) goto err;
|
||||
if (test_sm4_ecb_test_vectors() != 1) goto err;
|
||||
if (test_sm4_ecb_ctx() != 1) goto err;
|
||||
printf("%s all tests passed\n", __FILE__);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user