From a671d501aab08cd24308a7d253d7bc3b9ff5919a Mon Sep 17 00:00:00 2001 From: jsteube Date: Sun, 14 Apr 2019 17:03:37 +0200 Subject: [PATCH] Optimize some xxx_hmac_init functions --- 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 | 16 ++++++++++++---- OpenCL/inc_hash_streebog256.cl | 16 ++++++++++++---- OpenCL/inc_hash_streebog512.cl | 16 ++++++++++++---- OpenCL/inc_hash_whirlpool.cl | 16 ++++++++++++---- 11 files changed, 132 insertions(+), 44 deletions(-) diff --git a/OpenCL/inc_hash_md4.cl b/OpenCL/inc_hash_md4.cl index 425aa3e09..01fedf496 100644 --- a/OpenCL/inc_hash_md4.cl +++ b/OpenCL/inc_hash_md4.cl @@ -754,7 +754,9 @@ DECLSPEC void md4_hmac_init_64 (md4_hmac_ctx_t *ctx, const u32 *w0, const u32 *w md4_init (&ctx->ipad); - md4_update_64 (&ctx->ipad, t0, t1, t2, t3, 64); + md4_transform (t0, t1, t2, t3, ctx->ipad.h); + + ctx->ipad.len = 64; // opad @@ -777,7 +779,9 @@ DECLSPEC void md4_hmac_init_64 (md4_hmac_ctx_t *ctx, const u32 *w0, const u32 *w md4_init (&ctx->opad); - md4_update_64 (&ctx->opad, t0, t1, t2, t3, 64); + md4_transform (t0, t1, t2, t3, ctx->opad.h); + + ctx->opad.len = 64; } DECLSPEC void md4_hmac_init (md4_hmac_ctx_t *ctx, const u32 *w, const int len) @@ -1593,7 +1597,9 @@ DECLSPEC void md4_hmac_init_vector_64 (md4_hmac_ctx_vector_t *ctx, const u32x *w md4_init_vector (&ctx->ipad); - md4_update_vector_64 (&ctx->ipad, t0, t1, t2, t3, 64); + md4_transform_vector (t0, t1, t2, t3, ctx->ipad.h); + + ctx->ipad.len = 64; // opad @@ -1616,7 +1622,9 @@ DECLSPEC void md4_hmac_init_vector_64 (md4_hmac_ctx_vector_t *ctx, const u32x *w md4_init_vector (&ctx->opad); - md4_update_vector_64 (&ctx->opad, t0, t1, t2, t3, 64); + md4_transform_vector (t0, t1, t2, t3, ctx->opad.h); + + ctx->opad.len = 64; } DECLSPEC void md4_hmac_init_vector (md4_hmac_ctx_vector_t *ctx, const u32x *w, const int len) diff --git a/OpenCL/inc_hash_md5.cl b/OpenCL/inc_hash_md5.cl index 7a7dbc3c3..01964cf27 100644 --- a/OpenCL/inc_hash_md5.cl +++ b/OpenCL/inc_hash_md5.cl @@ -790,7 +790,9 @@ DECLSPEC void md5_hmac_init_64 (md5_hmac_ctx_t *ctx, const u32 *w0, const u32 *w md5_init (&ctx->ipad); - md5_update_64 (&ctx->ipad, t0, t1, t2, t3, 64); + md5_transform (t0, t1, t2, t3, ctx->ipad.h); + + ctx->ipad.len = 64; // opad @@ -813,7 +815,9 @@ DECLSPEC void md5_hmac_init_64 (md5_hmac_ctx_t *ctx, const u32 *w0, const u32 *w md5_init (&ctx->opad); - md5_update_64 (&ctx->opad, t0, t1, t2, t3, 64); + md5_transform (t0, t1, t2, t3, ctx->opad.h); + + ctx->opad.len = 64; } DECLSPEC void md5_hmac_init (md5_hmac_ctx_t *ctx, const u32 *w, const int len) @@ -1665,7 +1669,9 @@ DECLSPEC void md5_hmac_init_vector_64 (md5_hmac_ctx_vector_t *ctx, const u32x *w md5_init_vector (&ctx->ipad); - md5_update_vector_64 (&ctx->ipad, t0, t1, t2, t3, 64); + md5_transform_vector (t0, t1, t2, t3, ctx->ipad.h); + + ctx->ipad.len = 64; // opad @@ -1688,7 +1694,9 @@ DECLSPEC void md5_hmac_init_vector_64 (md5_hmac_ctx_vector_t *ctx, const u32x *w md5_init_vector (&ctx->opad); - md5_update_vector_64 (&ctx->opad, t0, t1, t2, t3, 64); + md5_transform_vector (t0, t1, t2, t3, ctx->opad.h); + + ctx->opad.len = 64; } DECLSPEC void md5_hmac_init_vector (md5_hmac_ctx_vector_t *ctx, const u32x *w, const int len) diff --git a/OpenCL/inc_hash_ripemd160.cl b/OpenCL/inc_hash_ripemd160.cl index 9434bf527..8c6e1f6af 100644 --- a/OpenCL/inc_hash_ripemd160.cl +++ b/OpenCL/inc_hash_ripemd160.cl @@ -888,7 +888,9 @@ DECLSPEC void ripemd160_hmac_init_64 (ripemd160_hmac_ctx_t *ctx, const u32 *w0, ripemd160_init (&ctx->ipad); - ripemd160_update_64 (&ctx->ipad, t0, t1, t2, t3, 64); + ripemd160_transform (t0, t1, t2, t3, ctx->ipad.h); + + ctx->ipad.len = 64; // opad @@ -911,7 +913,9 @@ DECLSPEC void ripemd160_hmac_init_64 (ripemd160_hmac_ctx_t *ctx, const u32 *w0, ripemd160_init (&ctx->opad); - ripemd160_update_64 (&ctx->opad, t0, t1, t2, t3, 64); + ripemd160_transform (t0, t1, t2, t3, ctx->opad.h); + + ctx->opad.len = 64; } DECLSPEC void ripemd160_hmac_init (ripemd160_hmac_ctx_t *ctx, const u32 *w, const int len) @@ -1862,7 +1866,9 @@ DECLSPEC void ripemd160_hmac_init_vector_64 (ripemd160_hmac_ctx_vector_t *ctx, c ripemd160_init_vector (&ctx->ipad); - ripemd160_update_vector_64 (&ctx->ipad, t0, t1, t2, t3, 64); + ripemd160_transform_vector (t0, t1, t2, t3, ctx->ipad.h); + + ctx->ipad.len = 64; // opad @@ -1885,7 +1891,9 @@ DECLSPEC void ripemd160_hmac_init_vector_64 (ripemd160_hmac_ctx_vector_t *ctx, c ripemd160_init_vector (&ctx->opad); - ripemd160_update_vector_64 (&ctx->opad, t0, t1, t2, t3, 64); + ripemd160_transform_vector (t0, t1, t2, t3, ctx->opad.h); + + ctx->opad.len = 64; } DECLSPEC void ripemd160_hmac_init_vector (ripemd160_hmac_ctx_vector_t *ctx, const u32x *w, const int len) diff --git a/OpenCL/inc_hash_sha1.cl b/OpenCL/inc_hash_sha1.cl index 4638139db..fe7ecf5ab 100644 --- a/OpenCL/inc_hash_sha1.cl +++ b/OpenCL/inc_hash_sha1.cl @@ -1056,7 +1056,9 @@ DECLSPEC void sha1_hmac_init_64 (sha1_hmac_ctx_t *ctx, const u32 *w0, const u32 sha1_init (&ctx->ipad); - sha1_update_64 (&ctx->ipad, t0, t1, t2, t3, 64); + sha1_transform (t0, t1, t2, t3, ctx->ipad.h); + + ctx->ipad.len = 64; // opad @@ -1079,7 +1081,9 @@ DECLSPEC void sha1_hmac_init_64 (sha1_hmac_ctx_t *ctx, const u32 *w0, const u32 sha1_init (&ctx->opad); - sha1_update_64 (&ctx->opad, t0, t1, t2, t3, 64); + sha1_transform (t0, t1, t2, t3, ctx->opad.h); + + ctx->opad.len = 64; } DECLSPEC void sha1_hmac_init (sha1_hmac_ctx_t *ctx, const u32 *w, const int len) @@ -2046,7 +2050,9 @@ DECLSPEC void sha1_hmac_init_vector_64 (sha1_hmac_ctx_vector_t *ctx, const u32x sha1_init_vector (&ctx->ipad); - sha1_update_vector_64 (&ctx->ipad, t0, t1, t2, t3, 64); + sha1_transform_vector (t0, t1, t2, t3, ctx->ipad.h); + + ctx->ipad.len = 64; // opad @@ -2069,7 +2075,9 @@ DECLSPEC void sha1_hmac_init_vector_64 (sha1_hmac_ctx_vector_t *ctx, const u32x sha1_init_vector (&ctx->opad); - sha1_update_vector_64 (&ctx->opad, t0, t1, t2, t3, 64); + sha1_transform_vector (t0, t1, t2, t3, ctx->opad.h); + + ctx->opad.len = 64; } DECLSPEC void sha1_hmac_init_vector (sha1_hmac_ctx_vector_t *ctx, const u32x *w, const int len) diff --git a/OpenCL/inc_hash_sha224.cl b/OpenCL/inc_hash_sha224.cl index d64f6a118..a54f54cf4 100644 --- a/OpenCL/inc_hash_sha224.cl +++ b/OpenCL/inc_hash_sha224.cl @@ -805,7 +805,9 @@ DECLSPEC void sha224_hmac_init_64 (sha224_hmac_ctx_t *ctx, const u32 *w0, const sha224_init (&ctx->ipad); - sha224_update_64 (&ctx->ipad, t0, t1, t2, t3, 64); + sha224_transform (t0, t1, t2, t3, ctx->ipad.h); + + ctx->ipad.len = 64; // opad @@ -828,7 +830,9 @@ DECLSPEC void sha224_hmac_init_64 (sha224_hmac_ctx_t *ctx, const u32 *w0, const sha224_init (&ctx->opad); - sha224_update_64 (&ctx->opad, t0, t1, t2, t3, 64); + sha224_transform (t0, t1, t2, t3, ctx->opad.h); + + ctx->opad.len = 64; } DECLSPEC void sha224_hmac_init (sha224_hmac_ctx_t *ctx, const u32 *w, const int len) @@ -1721,7 +1725,9 @@ DECLSPEC void sha224_hmac_init_vector_64 (sha224_hmac_ctx_vector_t *ctx, const u sha224_init_vector (&ctx->ipad); - sha224_update_vector_64 (&ctx->ipad, t0, t1, t2, t3, 64); + sha224_transform_vector (t0, t1, t2, t3, ctx->ipad.h); + + ctx->ipad.len = 64; // opad @@ -1744,7 +1750,9 @@ DECLSPEC void sha224_hmac_init_vector_64 (sha224_hmac_ctx_vector_t *ctx, const u sha224_init_vector (&ctx->opad); - sha224_update_vector_64 (&ctx->opad, t0, t1, t2, t3, 64); + sha224_transform_vector (t0, t1, t2, t3, ctx->opad.h); + + ctx->opad.len = 64; } DECLSPEC void sha224_hmac_init_vector (sha224_hmac_ctx_vector_t *ctx, const u32x *w, const int len) diff --git a/OpenCL/inc_hash_sha256.cl b/OpenCL/inc_hash_sha256.cl index f47140950..4a736b374 100644 --- a/OpenCL/inc_hash_sha256.cl +++ b/OpenCL/inc_hash_sha256.cl @@ -805,7 +805,9 @@ DECLSPEC void sha256_hmac_init_64 (sha256_hmac_ctx_t *ctx, const u32 *w0, const sha256_init (&ctx->ipad); - sha256_update_64 (&ctx->ipad, t0, t1, t2, t3, 64); + sha256_transform (t0, t1, t2, t3, ctx->ipad.h); + + ctx->ipad.len = 64; // opad @@ -828,7 +830,9 @@ DECLSPEC void sha256_hmac_init_64 (sha256_hmac_ctx_t *ctx, const u32 *w0, const sha256_init (&ctx->opad); - sha256_update_64 (&ctx->opad, t0, t1, t2, t3, 64); + sha256_transform (t0, t1, t2, t3, ctx->opad.h); + + ctx->opad.len = 64; } DECLSPEC void sha256_hmac_init (sha256_hmac_ctx_t *ctx, const u32 *w, const int len) @@ -1721,7 +1725,9 @@ DECLSPEC void sha256_hmac_init_vector_64 (sha256_hmac_ctx_vector_t *ctx, const u sha256_init_vector (&ctx->ipad); - sha256_update_vector_64 (&ctx->ipad, t0, t1, t2, t3, 64); + sha256_transform_vector (t0, t1, t2, t3, ctx->ipad.h); + + ctx->ipad.len = 64; // opad @@ -1744,7 +1750,9 @@ DECLSPEC void sha256_hmac_init_vector_64 (sha256_hmac_ctx_vector_t *ctx, const u sha256_init_vector (&ctx->opad); - sha256_update_vector_64 (&ctx->opad, t0, t1, t2, t3, 64); + sha256_transform_vector (t0, t1, t2, t3, ctx->opad.h); + + ctx->opad.len = 64; } DECLSPEC void sha256_hmac_init_vector (sha256_hmac_ctx_vector_t *ctx, const u32x *w, const int len) diff --git a/OpenCL/inc_hash_sha384.cl b/OpenCL/inc_hash_sha384.cl index b490e756b..d1c9235dd 100644 --- a/OpenCL/inc_hash_sha384.cl +++ b/OpenCL/inc_hash_sha384.cl @@ -1281,7 +1281,9 @@ DECLSPEC void sha384_hmac_init_128 (sha384_hmac_ctx_t *ctx, const u32 *w0, const sha384_init (&ctx->ipad); - sha384_update_128 (&ctx->ipad, t0, t1, t2, t3, t4, t5, t6, t7, 128); + sha384_transform (t0, t1, t2, t3, t4, t5, t6, t7, ctx->ipad.h); + + ctx->ipad.len = 128; // opad @@ -1320,7 +1322,9 @@ DECLSPEC void sha384_hmac_init_128 (sha384_hmac_ctx_t *ctx, const u32 *w0, const sha384_init (&ctx->opad); - sha384_update_128 (&ctx->opad, t0, t1, t2, t3, t4, t5, t6, t7, 128); + sha384_transform (t0, t1, t2, t3, t4, t5, t6, t7, ctx->opad.h); + + ctx->opad.len = 128; } DECLSPEC void sha384_hmac_init (sha384_hmac_ctx_t *ctx, const u32 *w, const int len) @@ -2701,7 +2705,9 @@ DECLSPEC void sha384_hmac_init_vector_128 (sha384_hmac_ctx_vector_t *ctx, const sha384_init_vector (&ctx->ipad); - sha384_update_vector_128 (&ctx->ipad, t0, t1, t2, t3, t4, t5, t6, t7, 128); + sha384_transform_vector (t0, t1, t2, t3, t4, t5, t6, t7, ctx->ipad.h); + + ctx->ipad.len = 128; // opad @@ -2740,7 +2746,9 @@ DECLSPEC void sha384_hmac_init_vector_128 (sha384_hmac_ctx_vector_t *ctx, const sha384_init_vector (&ctx->opad); - sha384_update_vector_128 (&ctx->opad, t0, t1, t2, t3, t4, t5, t6, t7, 128); + sha384_transform_vector (t0, t1, t2, t3, t4, t5, t6, t7, ctx->opad.h); + + ctx->opad.len = 128; } DECLSPEC void sha384_hmac_init_vector (sha384_hmac_ctx_vector_t *ctx, const u32x *w, const int len) diff --git a/OpenCL/inc_hash_sha512.cl b/OpenCL/inc_hash_sha512.cl index a33488ac4..ccad50a6e 100644 --- a/OpenCL/inc_hash_sha512.cl +++ b/OpenCL/inc_hash_sha512.cl @@ -1281,7 +1281,9 @@ DECLSPEC void sha512_hmac_init_128 (sha512_hmac_ctx_t *ctx, const u32 *w0, const sha512_init (&ctx->ipad); - sha512_update_128 (&ctx->ipad, t0, t1, t2, t3, t4, t5, t6, t7, 128); + sha512_transform (t0, t1, t2, t3, t4, t5, t6, t7, ctx->ipad.h); + + ctx->ipad.len = 128; // opad @@ -1320,7 +1322,9 @@ DECLSPEC void sha512_hmac_init_128 (sha512_hmac_ctx_t *ctx, const u32 *w0, const sha512_init (&ctx->opad); - sha512_update_128 (&ctx->opad, t0, t1, t2, t3, t4, t5, t6, t7, 128); + sha512_transform (t0, t1, t2, t3, t4, t5, t6, t7, ctx->opad.h); + + ctx->opad.len = 128; } DECLSPEC void sha512_hmac_init (sha512_hmac_ctx_t *ctx, const u32 *w, const int len) @@ -2818,7 +2822,9 @@ DECLSPEC void sha512_hmac_init_vector_128 (sha512_hmac_ctx_vector_t *ctx, const sha512_init_vector (&ctx->ipad); - sha512_update_vector_128 (&ctx->ipad, t0, t1, t2, t3, t4, t5, t6, t7, 128); + sha512_transform_vector (t0, t1, t2, t3, t4, t5, t6, t7, ctx->ipad.h); + + ctx->ipad.len = 128; // opad @@ -2857,7 +2863,9 @@ DECLSPEC void sha512_hmac_init_vector_128 (sha512_hmac_ctx_vector_t *ctx, const sha512_init_vector (&ctx->opad); - sha512_update_vector_128 (&ctx->opad, t0, t1, t2, t3, t4, t5, t6, t7, 128); + sha512_transform_vector (t0, t1, t2, t3, t4, t5, t6, t7, ctx->opad.h); + + ctx->opad.len = 128; } DECLSPEC void sha512_hmac_init_vector (sha512_hmac_ctx_vector_t *ctx, const u32x *w, const int len) diff --git a/OpenCL/inc_hash_streebog256.cl b/OpenCL/inc_hash_streebog256.cl index eab90be42..bca5ee955 100644 --- a/OpenCL/inc_hash_streebog256.cl +++ b/OpenCL/inc_hash_streebog256.cl @@ -1061,7 +1061,9 @@ DECLSPEC void streebog256_hmac_init_64 (streebog256_hmac_ctx_t *ctx, const u32 * streebog256_init (&ctx->ipad, s_sbob_sl64); - streebog256_update_64 (&ctx->ipad, t0, t1, t2, t3, 64); + streebog256_transform (&ctx->ipad, t0, t1, t2, t3); + + ctx->ipad.len = 64; // opad @@ -1084,7 +1086,9 @@ DECLSPEC void streebog256_hmac_init_64 (streebog256_hmac_ctx_t *ctx, const u32 * streebog256_init (&ctx->opad, s_sbob_sl64); - streebog256_update_64 (&ctx->opad, t0, t1, t2, t3, 64); + streebog256_transform (&ctx->opad, t0, t1, t2, t3); + + ctx->opad.len = 64; } DECLSPEC void streebog256_hmac_init (streebog256_hmac_ctx_t *ctx, const u32 *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256]) @@ -1659,7 +1663,9 @@ DECLSPEC void streebog256_hmac_init_vector_64 (streebog256_hmac_ctx_vector_t *ct streebog256_init_vector (&ctx->ipad, s_sbob_sl64); - streebog256_update_vector_64 (&ctx->ipad, t0, t1, t2, t3, 64); + streebog256_transform_vector (&ctx->ipad, t0, t1, t2, t3); + + ctx->ipad.len = 64; // opad @@ -1682,7 +1688,9 @@ DECLSPEC void streebog256_hmac_init_vector_64 (streebog256_hmac_ctx_vector_t *ct streebog256_init_vector (&ctx->opad, s_sbob_sl64); - streebog256_update_vector_64 (&ctx->opad, t0, t1, t2, t3, 64); + streebog256_transform_vector (&ctx->opad, t0, t1, t2, t3); + + ctx->opad.len = 64; } DECLSPEC void streebog256_hmac_init_vector (streebog256_hmac_ctx_vector_t *ctx, const u32x *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256]) diff --git a/OpenCL/inc_hash_streebog512.cl b/OpenCL/inc_hash_streebog512.cl index 422f0f852..83191b829 100644 --- a/OpenCL/inc_hash_streebog512.cl +++ b/OpenCL/inc_hash_streebog512.cl @@ -1061,7 +1061,9 @@ DECLSPEC void streebog512_hmac_init_64 (streebog512_hmac_ctx_t *ctx, const u32 * streebog512_init (&ctx->ipad, s_sbob_sl64); - streebog512_update_64 (&ctx->ipad, t0, t1, t2, t3, 64); + streebog512_transform (&ctx->ipad, t0, t1, t2, t3); + + ctx->ipad.len = 64; // opad @@ -1084,7 +1086,9 @@ DECLSPEC void streebog512_hmac_init_64 (streebog512_hmac_ctx_t *ctx, const u32 * streebog512_init (&ctx->opad, s_sbob_sl64); - streebog512_update_64 (&ctx->opad, t0, t1, t2, t3, 64); + streebog512_transform (&ctx->opad, t0, t1, t2, t3); + + ctx->opad.len = 64; } DECLSPEC void streebog512_hmac_init (streebog512_hmac_ctx_t *ctx, const u32 *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256]) @@ -1678,7 +1682,9 @@ DECLSPEC void streebog512_hmac_init_vector_64 (streebog512_hmac_ctx_vector_t *ct streebog512_init_vector (&ctx->ipad, s_sbob_sl64); - streebog512_update_vector_64 (&ctx->ipad, t0, t1, t2, t3, 64); + streebog512_transform_vector (&ctx->ipad, t0, t1, t2, t3); + + ctx->ipad.len = 64; // opad @@ -1701,7 +1707,9 @@ DECLSPEC void streebog512_hmac_init_vector_64 (streebog512_hmac_ctx_vector_t *ct streebog512_init_vector (&ctx->opad, s_sbob_sl64); - streebog512_update_vector_64 (&ctx->opad, t0, t1, t2, t3, 64); + streebog512_transform_vector (&ctx->opad, t0, t1, t2, t3); + + ctx->opad.len = 64; } DECLSPEC void streebog512_hmac_init_vector (streebog512_hmac_ctx_vector_t *ctx, const u32x *w, const int len, SHM_TYPE u64a (*s_sbob_sl64)[256]) diff --git a/OpenCL/inc_hash_whirlpool.cl b/OpenCL/inc_hash_whirlpool.cl index e233a0cf9..69d23b624 100644 --- a/OpenCL/inc_hash_whirlpool.cl +++ b/OpenCL/inc_hash_whirlpool.cl @@ -1969,7 +1969,9 @@ DECLSPEC void whirlpool_hmac_init_64 (whirlpool_hmac_ctx_t *ctx, const u32 *w0, whirlpool_init (&ctx->ipad, s_Ch, s_Cl); - whirlpool_update_64 (&ctx->ipad, t0, t1, t2, t3, 64); + whirlpool_transform (t0, t1, t2, t3, ctx->ipad.h, ctx->ipad.s_Ch, ctx->ipad.s_Cl); + + ctx->ipad.len = 64; // opad @@ -1992,7 +1994,9 @@ DECLSPEC void whirlpool_hmac_init_64 (whirlpool_hmac_ctx_t *ctx, const u32 *w0, whirlpool_init (&ctx->opad, s_Ch, s_Cl); - whirlpool_update_64 (&ctx->opad, t0, t1, t2, t3, 64); + whirlpool_transform (t0, t1, t2, t3, ctx->opad.h, ctx->opad.s_Ch, ctx->opad.s_Cl); + + ctx->opad.len = 64; } DECLSPEC void whirlpool_hmac_init (whirlpool_hmac_ctx_t *ctx, const u32 *w, const int len, SHM_TYPE u32 (*s_Ch)[256], SHM_TYPE u32 (*s_Cl)[256]) @@ -2963,7 +2967,9 @@ DECLSPEC void whirlpool_hmac_init_vector_64 (whirlpool_hmac_ctx_vector_t *ctx, c whirlpool_init_vector (&ctx->ipad, s_Ch, s_Cl); - whirlpool_update_vector_64 (&ctx->ipad, t0, t1, t2, t3, 64); + whirlpool_transform_vector (t0, t1, t2, t3, ctx->ipad.h, ctx->ipad.s_Ch, ctx->ipad.s_Cl); + + ctx->ipad.len = 64; // opad @@ -2986,7 +2992,9 @@ DECLSPEC void whirlpool_hmac_init_vector_64 (whirlpool_hmac_ctx_vector_t *ctx, c whirlpool_init_vector (&ctx->opad, s_Ch, s_Cl); - whirlpool_update_vector_64 (&ctx->opad, t0, t1, t2, t3, 64); + whirlpool_transform_vector (t0, t1, t2, t3, ctx->opad.h, ctx->opad.s_Ch, ctx->opad.s_Cl); + + ctx->opad.len = 64; } DECLSPEC void whirlpool_hmac_init_vector (whirlpool_hmac_ctx_vector_t *ctx, const u32x *w, const int len, SHM_TYPE u32 (*s_Ch)[256], SHM_TYPE u32 (*s_Cl)[256])