forked from wolfSSL/wolfssl
Fix for benchmarking shake with custom block size. Using ./benchmark -shake 1024
caused seg fault.
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@ -393,6 +393,8 @@ cmake_install.cmake
|
|||||||
# GDB Settings
|
# GDB Settings
|
||||||
\.gdbinit
|
\.gdbinit
|
||||||
|
|
||||||
|
libFuzzer
|
||||||
|
|
||||||
# Pycharm and other IDEs
|
# Pycharm and other IDEs
|
||||||
\.idea
|
\.idea
|
||||||
|
|
||||||
@ -413,4 +415,4 @@ user_settings_asm.h
|
|||||||
/IDE/Espressif/**/sdkconfig
|
/IDE/Espressif/**/sdkconfig
|
||||||
|
|
||||||
# auto-created CMake backups
|
# auto-created CMake backups
|
||||||
**/CMakeLists.txt.old
|
**/CMakeLists.txt.old
|
||||||
|
@ -5112,7 +5112,7 @@ void bench_shake128(int useDeviceID)
|
|||||||
if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(&hash[i]),
|
if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(&hash[i]),
|
||||||
0, ×, numBlocks, &pending)) {
|
0, ×, numBlocks, &pending)) {
|
||||||
ret = wc_Shake128_Update(&hash[i], bench_plain,
|
ret = wc_Shake128_Update(&hash[i], bench_plain,
|
||||||
BENCH_SIZE);
|
bench_size);
|
||||||
if (!bench_async_handle(&ret,
|
if (!bench_async_handle(&ret,
|
||||||
BENCH_ASYNC_GET_DEV(&hash[i]), 0,
|
BENCH_ASYNC_GET_DEV(&hash[i]), 0,
|
||||||
×, &pending)) {
|
×, &pending)) {
|
||||||
@ -5148,7 +5148,7 @@ void bench_shake128(int useDeviceID)
|
|||||||
ret = wc_InitShake128(hash, HEAP_HINT,
|
ret = wc_InitShake128(hash, HEAP_HINT,
|
||||||
useDeviceID ? devId : INVALID_DEVID);
|
useDeviceID ? devId : INVALID_DEVID);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
ret = wc_Shake128_Update(hash, bench_plain, BENCH_SIZE);
|
ret = wc_Shake128_Update(hash, bench_plain, bench_size);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
ret = wc_Shake128_Final(hash, digest[0],
|
ret = wc_Shake128_Final(hash, digest[0],
|
||||||
WC_SHA3_128_BLOCK_SIZE);
|
WC_SHA3_128_BLOCK_SIZE);
|
||||||
@ -5207,7 +5207,7 @@ void bench_shake256(int useDeviceID)
|
|||||||
if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(&hash[i]),
|
if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(&hash[i]),
|
||||||
0, ×, numBlocks, &pending)) {
|
0, ×, numBlocks, &pending)) {
|
||||||
ret = wc_Shake256_Update(&hash[i], bench_plain,
|
ret = wc_Shake256_Update(&hash[i], bench_plain,
|
||||||
BENCH_SIZE);
|
bench_size);
|
||||||
if (!bench_async_handle(&ret,
|
if (!bench_async_handle(&ret,
|
||||||
BENCH_ASYNC_GET_DEV(&hash[i]), 0,
|
BENCH_ASYNC_GET_DEV(&hash[i]), 0,
|
||||||
×, &pending)) {
|
×, &pending)) {
|
||||||
@ -5243,7 +5243,7 @@ void bench_shake256(int useDeviceID)
|
|||||||
ret = wc_InitShake256(hash, HEAP_HINT,
|
ret = wc_InitShake256(hash, HEAP_HINT,
|
||||||
useDeviceID ? devId : INVALID_DEVID);
|
useDeviceID ? devId : INVALID_DEVID);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
ret = wc_Shake256_Update(hash, bench_plain, BENCH_SIZE);
|
ret = wc_Shake256_Update(hash, bench_plain, bench_size);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
ret = wc_Shake256_Final(hash, digest[0],
|
ret = wc_Shake256_Final(hash, digest[0],
|
||||||
WC_SHA3_256_BLOCK_SIZE);
|
WC_SHA3_256_BLOCK_SIZE);
|
||||||
|
Reference in New Issue
Block a user