Optimize some xxx_hmac_init functions

pull/1991/head^2
jsteube 5 years ago
parent eaefbec3fa
commit a671d501aa

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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)

@ -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])

@ -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])

@ -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])

Loading…
Cancel
Save