From ee26805138dcb4627e94a9b7ca7125d47d8b7297 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Mon, 12 Apr 2021 14:44:56 +0200 Subject: [PATCH] In UTF8 to UTF16 conversion, reserve enough room to handle very long UTF8 inputs --- OpenCL/inc_hash_md4.cl | 16 ++++++++-------- OpenCL/inc_hash_md5.cl | 16 ++++++++-------- OpenCL/inc_hash_ripemd160.cl | 16 ++++++++-------- OpenCL/inc_hash_sha1.cl | 16 ++++++++-------- OpenCL/inc_hash_sha224.cl | 16 ++++++++-------- OpenCL/inc_hash_sha256.cl | 16 ++++++++-------- OpenCL/inc_hash_sha384.cl | 16 ++++++++-------- OpenCL/inc_hash_sha512.cl | 24 ++++++++++++------------ OpenCL/inc_hash_whirlpool.cl | 16 ++++++++-------- 9 files changed, 76 insertions(+), 76 deletions(-) diff --git a/OpenCL/inc_hash_md4.cl b/OpenCL/inc_hash_md4.cl index 3fa89680c..149e7002f 100644 --- a/OpenCL/inc_hash_md4.cl +++ b/OpenCL/inc_hash_md4.cl @@ -363,18 +363,18 @@ DECLSPEC void md4_update_swap (md4_ctx_t *ctx, const u32 *w, const int len) DECLSPEC void md4_update_utf16le (md4_ctx_t *ctx, const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); md4_update (ctx, w_utf16_buf, w_utf16_len); } DECLSPEC void md4_update_utf16le_swap (md4_ctx_t *ctx, const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); md4_update_swap (ctx, w_utf16_buf, w_utf16_len); } @@ -519,18 +519,18 @@ DECLSPEC void md4_update_global_swap (md4_ctx_t *ctx, GLOBAL_AS const u32 *w, co DECLSPEC void md4_update_global_utf16le (md4_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); md4_update (ctx, w_utf16_buf, w_utf16_len); } DECLSPEC void md4_update_global_utf16le_swap (md4_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); md4_update_swap (ctx, w_utf16_buf, w_utf16_len); } diff --git a/OpenCL/inc_hash_md5.cl b/OpenCL/inc_hash_md5.cl index 73d236467..d268cd3c3 100644 --- a/OpenCL/inc_hash_md5.cl +++ b/OpenCL/inc_hash_md5.cl @@ -399,18 +399,18 @@ DECLSPEC void md5_update_swap (md5_ctx_t *ctx, const u32 *w, const int len) DECLSPEC void md5_update_utf16le (md5_ctx_t *ctx, const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); md5_update (ctx, w_utf16_buf, w_utf16_len); } DECLSPEC void md5_update_utf16le_swap (md5_ctx_t *ctx, const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); md5_update_swap (ctx, w_utf16_buf, w_utf16_len); } @@ -555,18 +555,18 @@ DECLSPEC void md5_update_global_swap (md5_ctx_t *ctx, GLOBAL_AS const u32 *w, co DECLSPEC void md5_update_global_utf16le (md5_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); md5_update (ctx, w_utf16_buf, w_utf16_len); } DECLSPEC void md5_update_global_utf16le_swap (md5_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); md5_update_swap (ctx, w_utf16_buf, w_utf16_len); } diff --git a/OpenCL/inc_hash_ripemd160.cl b/OpenCL/inc_hash_ripemd160.cl index 1b18f01b8..d100ebf70 100644 --- a/OpenCL/inc_hash_ripemd160.cl +++ b/OpenCL/inc_hash_ripemd160.cl @@ -497,18 +497,18 @@ DECLSPEC void ripemd160_update_swap (ripemd160_ctx_t *ctx, const u32 *w, const i DECLSPEC void ripemd160_update_utf16le (ripemd160_ctx_t *ctx, const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); ripemd160_update (ctx, w_utf16_buf, w_utf16_len); } DECLSPEC void ripemd160_update_utf16le_swap (ripemd160_ctx_t *ctx, const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); ripemd160_update_swap (ctx, w_utf16_buf, w_utf16_len); } @@ -653,18 +653,18 @@ DECLSPEC void ripemd160_update_global_swap (ripemd160_ctx_t *ctx, GLOBAL_AS cons DECLSPEC void ripemd160_update_global_utf16le (ripemd160_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); ripemd160_update (ctx, w_utf16_buf, w_utf16_len); } DECLSPEC void ripemd160_update_global_utf16le_swap (ripemd160_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); ripemd160_update_swap (ctx, w_utf16_buf, w_utf16_len); } diff --git a/OpenCL/inc_hash_sha1.cl b/OpenCL/inc_hash_sha1.cl index f71f04193..3ea263178 100644 --- a/OpenCL/inc_hash_sha1.cl +++ b/OpenCL/inc_hash_sha1.cl @@ -612,18 +612,18 @@ DECLSPEC void sha1_update_swap (sha1_ctx_t *ctx, const u32 *w, const int len) DECLSPEC void sha1_update_utf16le (sha1_ctx_t *ctx, const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha1_update (ctx, w_utf16_buf, w_utf16_len); } DECLSPEC void sha1_update_utf16le_swap (sha1_ctx_t *ctx, const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha1_update_swap (ctx, w_utf16_buf, w_utf16_len); } @@ -886,18 +886,18 @@ DECLSPEC void sha1_update_global_swap (sha1_ctx_t *ctx, GLOBAL_AS const u32 *w, DECLSPEC void sha1_update_global_utf16le (sha1_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha1_update (ctx, w_utf16_buf, w_utf16_len); } DECLSPEC void sha1_update_global_utf16le_swap (sha1_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha1_update_swap (ctx, w_utf16_buf, w_utf16_len); } diff --git a/OpenCL/inc_hash_sha224.cl b/OpenCL/inc_hash_sha224.cl index a5b780376..2e970a10a 100644 --- a/OpenCL/inc_hash_sha224.cl +++ b/OpenCL/inc_hash_sha224.cl @@ -414,18 +414,18 @@ DECLSPEC void sha224_update_swap (sha224_ctx_t *ctx, const u32 *w, const int len DECLSPEC void sha224_update_utf16le (sha224_ctx_t *ctx, const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha224_update (ctx, w_utf16_buf, w_utf16_len); } DECLSPEC void sha224_update_utf16le_swap (sha224_ctx_t *ctx, const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha224_update_swap (ctx, w_utf16_buf, w_utf16_len); } @@ -570,18 +570,18 @@ DECLSPEC void sha224_update_global_swap (sha224_ctx_t *ctx, GLOBAL_AS const u32 DECLSPEC void sha224_update_global_utf16le (sha224_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha224_update (ctx, w_utf16_buf, w_utf16_len); } DECLSPEC void sha224_update_global_utf16le_swap (sha224_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha224_update_swap (ctx, w_utf16_buf, w_utf16_len); } diff --git a/OpenCL/inc_hash_sha256.cl b/OpenCL/inc_hash_sha256.cl index 49bb19f3d..93208b060 100644 --- a/OpenCL/inc_hash_sha256.cl +++ b/OpenCL/inc_hash_sha256.cl @@ -414,18 +414,18 @@ DECLSPEC void sha256_update_swap (sha256_ctx_t *ctx, const u32 *w, const int len DECLSPEC void sha256_update_utf16le (sha256_ctx_t *ctx, const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha256_update (ctx, w_utf16_buf, w_utf16_len); } DECLSPEC void sha256_update_utf16le_swap (sha256_ctx_t *ctx, const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha256_update_swap (ctx, w_utf16_buf, w_utf16_len); } @@ -570,18 +570,18 @@ DECLSPEC void sha256_update_global_swap (sha256_ctx_t *ctx, GLOBAL_AS const u32 DECLSPEC void sha256_update_global_utf16le (sha256_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha256_update (ctx, w_utf16_buf, w_utf16_len); } DECLSPEC void sha256_update_global_utf16le_swap (sha256_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha256_update_swap (ctx, w_utf16_buf, w_utf16_len); } diff --git a/OpenCL/inc_hash_sha384.cl b/OpenCL/inc_hash_sha384.cl index ef09c26f6..37db1f676 100644 --- a/OpenCL/inc_hash_sha384.cl +++ b/OpenCL/inc_hash_sha384.cl @@ -622,18 +622,18 @@ DECLSPEC void sha384_update_swap (sha384_ctx_t *ctx, const u32 *w, const int len DECLSPEC void sha384_update_utf16le (sha384_ctx_t *ctx, const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha384_update (ctx, w_utf16_buf, w_utf16_len); } DECLSPEC void sha384_update_utf16le_swap (sha384_ctx_t *ctx, const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha384_update_swap (ctx, w_utf16_buf, w_utf16_len); } @@ -882,18 +882,18 @@ DECLSPEC void sha384_update_global_swap (sha384_ctx_t *ctx, GLOBAL_AS const u32 DECLSPEC void sha384_update_global_utf16le (sha384_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha384_update (ctx, w_utf16_buf, w_utf16_len); } DECLSPEC void sha384_update_global_utf16le_swap (sha384_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha384_update_swap (ctx, w_utf16_buf, w_utf16_len); } diff --git a/OpenCL/inc_hash_sha512.cl b/OpenCL/inc_hash_sha512.cl index 19aee7368..a00780271 100644 --- a/OpenCL/inc_hash_sha512.cl +++ b/OpenCL/inc_hash_sha512.cl @@ -622,18 +622,18 @@ DECLSPEC void sha512_update_swap (sha512_ctx_t *ctx, const u32 *w, const int len DECLSPEC void sha512_update_utf16le (sha512_ctx_t *ctx, const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha512_update (ctx, w_utf16_buf, w_utf16_len); } DECLSPEC void sha512_update_utf16le_swap (sha512_ctx_t *ctx, const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha512_update_swap (ctx, w_utf16_buf, w_utf16_len); } @@ -882,18 +882,18 @@ DECLSPEC void sha512_update_global_swap (sha512_ctx_t *ctx, GLOBAL_AS const u32 DECLSPEC void sha512_update_global_utf16le (sha512_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha512_update (ctx, w_utf16_buf, w_utf16_len); } DECLSPEC void sha512_update_global_utf16le_swap (sha512_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha512_update_swap (ctx, w_utf16_buf, w_utf16_len); } @@ -1414,18 +1414,18 @@ DECLSPEC void sha512_hmac_init_global_swap (sha512_hmac_ctx_t *ctx, GLOBAL_AS co DECLSPEC void sha512_hmac_init_global_ut16le (sha512_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha512_hmac_init (ctx, w_utf16_buf, w_utf16_len); } DECLSPEC void sha512_hmac_init_global_utf16le_swap (sha512_hmac_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); sha512_hmac_init_swap (ctx, w_utf16_buf, w_utf16_len); } diff --git a/OpenCL/inc_hash_whirlpool.cl b/OpenCL/inc_hash_whirlpool.cl index 5b30615f7..d2853e4f9 100644 --- a/OpenCL/inc_hash_whirlpool.cl +++ b/OpenCL/inc_hash_whirlpool.cl @@ -1018,18 +1018,18 @@ DECLSPEC void whirlpool_update_swap (whirlpool_ctx_t *ctx, const u32 *w, const i DECLSPEC void whirlpool_update_utf16le (whirlpool_ctx_t *ctx, const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); whirlpool_update (ctx, w_utf16_buf, w_utf16_len); } DECLSPEC void whirlpool_update_utf16le_swap (whirlpool_ctx_t *ctx, const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); whirlpool_update_swap (ctx, w_utf16_buf, w_utf16_len); } @@ -1174,18 +1174,18 @@ DECLSPEC void whirlpool_update_global_swap (whirlpool_ctx_t *ctx, GLOBAL_AS cons DECLSPEC void whirlpool_update_global_utf16le (whirlpool_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); whirlpool_update (ctx, w_utf16_buf, w_utf16_len); } DECLSPEC void whirlpool_update_global_utf16le_swap (whirlpool_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { - u32 w_utf16_buf[64] = { 0 }; + u32 w_utf16_buf[256] = { 0 }; - const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, 256); + const int w_utf16_len = utf8_to_utf16le_global (w, len, 256, w_utf16_buf, sizeof (w_utf16_buf)); whirlpool_update_swap (ctx, w_utf16_buf, w_utf16_len); }