mirror of
https://github.com/hashcat/hashcat.git
synced 2025-01-08 23:01:14 +00:00
In UTF8 to UTF16 conversion, reserve enough room to handle very long UTF8 inputs
This commit is contained in:
parent
2b0001b879
commit
ee26805138
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user