if (TEST_FAIL())
return -1;
- if (wc_HmacSetKey(&hmac, type, key, (word32) key_len) != 0)
+ if (wc_HmacInit(&hmac, NULL, INVALID_DEVID) != 0 ||
+ wc_HmacSetKey(&hmac, type, key, (word32) key_len) != 0)
return -1;
for (i = 0; i < num_elem; i++)
if (wc_HmacUpdate(&hmac, addr[i], len[i]) != 0)
goto done;
}
- if (wc_HmacSetKey(&hash->hmac, type, key, key_len) != 0)
+ if (wc_HmacInit(&hash->hmac, NULL, INVALID_DEVID) != 0 ||
+ wc_HmacSetKey(&hash->hmac, type, key, key_len) != 0)
goto done;
ret = hash;