mirror of https://github.com/wolfSSL/wolfssl.git
Benchmark AES-OFB: initialize and free AES object
Device ID is not initialized unless wc_AesInit() is called. Call wc_AesFree() for possible hardware implementations.pull/5878/head
parent
11c4a0e228
commit
819d40a76f
|
@ -3423,6 +3423,12 @@ static void bench_aesofb_internal(const byte* key, word32 keySz, const byte* iv,
|
|||
double start;
|
||||
int i, ret, count;
|
||||
|
||||
ret = wc_AesInit(&enc, NULL, INVALID_DEVID);
|
||||
if (ret != 0) {
|
||||
printf("AesInit failed, ret = %d\n", ret);
|
||||
return;
|
||||
}
|
||||
|
||||
ret = wc_AesSetKey(&enc, key, keySz, iv, AES_ENCRYPTION);
|
||||
if (ret != 0) {
|
||||
printf("AesSetKey failed, ret = %d\n", ret);
|
||||
|
@ -3441,6 +3447,8 @@ static void bench_aesofb_internal(const byte* key, word32 keySz, const byte* iv,
|
|||
count += i;
|
||||
} while (bench_stats_check(start));
|
||||
bench_stats_sym_finish(label, 0, count, bench_size, start, ret);
|
||||
|
||||
wc_AesFree(&enc);
|
||||
}
|
||||
|
||||
void bench_aesofb(void)
|
||||
|
|
Loading…
Reference in New Issue