Skip to content

Commit 95cb29c

Browse files
authored
Merge pull request #289 from JacobBarthelmeh/aes
add init of cmac in test case
2 parents 072eb6d + 643d4a5 commit 95cb29c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/wh_test_crypto.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3877,6 +3877,11 @@ static int whTestCrypto_Cmac(whClientContext* ctx, int devId, WC_RNG* rng)
38773877
ret);
38783878
break;
38793879
}
3880+
ret = wc_InitCmac_ex(cmac, NULL, 0, WC_CMAC_AES, NULL, NULL, devId);
3881+
if (ret != 0) {
3882+
WH_ERROR_PRINT("Failed wc_InitCmac_ex (gen) tc=%d %d\n", i, ret);
3883+
break;
3884+
}
38803885
ret = wh_Client_CmacSetKeyId(cmac, keyId);
38813886
if (ret != 0) {
38823887
WH_ERROR_PRINT("Failed to wh_Client_CmacSetKeyId (gen) tc=%d %d\n",
@@ -3925,6 +3930,7 @@ static int whTestCrypto_Cmac(whClientContext* ctx, int devId, WC_RNG* rng)
39253930
WH_ERROR_PRINT("Failed wc_AesCmacVerify_ex tc=%d %d\n", i, ret);
39263931
break;
39273932
}
3933+
wc_CmacFree(cmac);
39283934
ret = wh_Client_KeyEvict(ctx, keyId);
39293935
if (ret != 0) {
39303936
WH_ERROR_PRINT("Failed to wh_Client_KeyEvict (ver) tc=%d %d\n", i,

0 commit comments

Comments
 (0)