Code have skein_512_ctx and skein_256_ctx but skein1024_ctx.
It would be logical to convert these names to a single form.
Signed-off-by: Anton Saraev <antonysaraev@gmail.com>
Reviewed-by: Jake Edge <jake@lwn.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
u8 b[SKEIN_512_BLOCK_BYTES]; /* partial block buf (8-byte aligned) */
};
-struct skein1024_ctx { /* 1024-bit Skein hash context structure */
+struct skein_1024_ctx { /* 1024-bit Skein hash context structure */
struct skein_ctx_hdr h; /* common header context variables */
u64 X[SKEIN1024_STATE_WORDS]; /* chaining variables */
u8 b[SKEIN1024_BLOCK_BYTES]; /* partial block buf (8-byte aligned) */
/* Skein APIs for (incremental) "straight hashing" */
int skein_256_init(struct skein_256_ctx *ctx, size_t hash_bit_len);
int skein_512_init(struct skein_512_ctx *ctx, size_t hash_bit_len);
-int skein_1024_init(struct skein1024_ctx *ctx, size_t hash_bit_len);
+int skein_1024_init(struct skein_1024_ctx *ctx, size_t hash_bit_len);
int skein_256_update(struct skein_256_ctx *ctx, const u8 *msg,
size_t msg_byte_cnt);
int skein_512_update(struct skein_512_ctx *ctx, const u8 *msg,
size_t msg_byte_cnt);
-int skein_1024_update(struct skein1024_ctx *ctx, const u8 *msg,
+int skein_1024_update(struct skein_1024_ctx *ctx, const u8 *msg,
size_t msg_byte_cnt);
int skein_256_final(struct skein_256_ctx *ctx, u8 *hash_val);
int skein_512_final(struct skein_512_ctx *ctx, u8 *hash_val);
-int skein_1024_final(struct skein1024_ctx *ctx, u8 *hash_val);
+int skein_1024_final(struct skein_1024_ctx *ctx, u8 *hash_val);
/*
** Skein APIs for "extended" initialization: MAC keys, tree hashing.
u64 tree_info, const u8 *key, size_t key_bytes);
int skein_512_init_ext(struct skein_512_ctx *ctx, size_t hash_bit_len,
u64 tree_info, const u8 *key, size_t key_bytes);
-int skein_1024_init_ext(struct skein1024_ctx *ctx, size_t hash_bit_len,
+int skein_1024_init_ext(struct skein_1024_ctx *ctx, size_t hash_bit_len,
u64 tree_info, const u8 *key, size_t key_bytes);
/*
*/
int skein_256_final_pad(struct skein_256_ctx *ctx, u8 *hash_val);
int skein_512_final_pad(struct skein_512_ctx *ctx, u8 *hash_val);
-int skein_1024_final_pad(struct skein1024_ctx *ctx, u8 *hash_val);
+int skein_1024_final_pad(struct skein_1024_ctx *ctx, u8 *hash_val);
#ifndef SKEIN_TREE_HASH
#define SKEIN_TREE_HASH (1)
#if SKEIN_TREE_HASH
int skein_256_output(struct skein_256_ctx *ctx, u8 *hash_val);
int skein_512_output(struct skein_512_ctx *ctx, u8 *hash_val);
-int skein_1024_output(struct skein1024_ctx *ctx, u8 *hash_val);
+int skein_1024_output(struct skein_1024_ctx *ctx, u8 *hash_val);
#endif
/*****************************************************************
struct skein_ctx_hdr h;
struct skein_256_ctx s256;
struct skein_512_ctx s512;
- struct skein1024_ctx s1024;
+ struct skein_1024_ctx s1024;
} m;
};
size_t blk_cnt, size_t byte_cnt_add);
void skein_512_process_block(struct skein_512_ctx *ctx, const u8 *blk_ptr,
size_t blk_cnt, size_t byte_cnt_add);
-void skein_1024_process_block(struct skein1024_ctx *ctx, const u8 *blk_ptr,
+void skein_1024_process_block(struct skein_1024_ctx *ctx, const u8 *blk_ptr,
size_t blk_cnt, size_t byte_cnt_add);
#endif
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/* init the context for a straight hashing operation */
-int skein_1024_init(struct skein1024_ctx *ctx, size_t hash_bit_len)
+int skein_1024_init(struct skein_1024_ctx *ctx, size_t hash_bit_len)
{
union {
u8 b[SKEIN1024_STATE_BYTES];
/* init the context for a MAC and/or tree hash operation */
/* [identical to skein_1024_init() when key_bytes == 0 && \
* tree_info == SKEIN_CFG_TREE_INFO_SEQUENTIAL] */
-int skein_1024_init_ext(struct skein1024_ctx *ctx, size_t hash_bit_len,
+int skein_1024_init_ext(struct skein_1024_ctx *ctx, size_t hash_bit_len,
u64 tree_info, const u8 *key, size_t key_bytes)
{
union {
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/* process the input bytes */
-int skein_1024_update(struct skein1024_ctx *ctx, const u8 *msg,
+int skein_1024_update(struct skein_1024_ctx *ctx, const u8 *msg,
size_t msg_byte_cnt)
{
size_t n;
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/* finalize the hash computation and output the result */
-int skein_1024_final(struct skein1024_ctx *ctx, u8 *hash_val)
+int skein_1024_final(struct skein_1024_ctx *ctx, u8 *hash_val)
{
size_t i, n, byte_cnt;
u64 X[SKEIN1024_STATE_WORDS];
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/* finalize the hash computation and output the block, no OUTPUT stage */
-int skein_1024_final_pad(struct skein1024_ctx *ctx, u8 *hash_val)
+int skein_1024_final_pad(struct skein_1024_ctx *ctx, u8 *hash_val)
{
/* catch uninitialized context */
Skein_Assert(ctx->h.b_cnt <= SKEIN1024_BLOCK_BYTES, SKEIN_FAIL);
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/* just do the OUTPUT stage */
-int skein_1024_output(struct skein1024_ctx *ctx, u8 *hash_val)
+int skein_1024_output(struct skein_1024_ctx *ctx, u8 *hash_val)
{
size_t i, n, byte_cnt;
u64 X[SKEIN1024_STATE_WORDS];
ctx->h.T[1] = tweak[1];
}
-void skein_1024_process_block(struct skein1024_ctx *ctx, const u8 *blk_ptr,
+void skein_1024_process_block(struct skein_1024_ctx *ctx, const u8 *blk_ptr,
size_t blk_cnt, size_t byte_cnt_add)
{
struct threefish_key key;
/***************************** Skein1024 ******************************/
#if !(SKEIN_USE_ASM & 1024)
-void skein_1024_process_block(struct skein1024_ctx *ctx, const u8 *blk_ptr,
+void skein_1024_process_block(struct skein_1024_ctx *ctx, const u8 *blk_ptr,
size_t blk_cnt, size_t byte_cnt_add)
{ /* do it in C, always looping (unrolled is bigger AND slower!) */
enum {