Lines Matching defs:state
14 void blake2b_compress_generic(struct blake2b_state *state,
17 static inline void blake2b_set_lastblock(struct blake2b_state *state)
19 state->f[0] = -1;
22 typedef void (*blake2b_compress_t)(struct blake2b_state *state,
25 static inline void __blake2b_update(struct blake2b_state *state,
29 const size_t fill = BLAKE2B_BLOCK_SIZE - state->buflen;
34 memcpy(state->buf + state->buflen, in, fill);
35 (*compress)(state, state->buf, 1, BLAKE2B_BLOCK_SIZE);
36 state->buflen = 0;
43 (*compress)(state, in, nblocks - 1, BLAKE2B_BLOCK_SIZE);
47 memcpy(state->buf + state->buflen, in, inlen);
48 state->buflen += inlen;
51 static inline void __blake2b_final(struct blake2b_state *state, u8 *out,
56 blake2b_set_lastblock(state);
57 memset(state->buf + state->buflen, 0,
58 BLAKE2B_BLOCK_SIZE - state->buflen); /* Padding */
59 (*compress)(state, state->buf, 1, state->buflen);
60 for (i = 0; i < ARRAY_SIZE(state->h); i++)
61 __cpu_to_le64s(&state->h[i]);
62 memcpy(out, state->h, state->outlen);
89 struct blake2b_state *state = shash_desc_ctx(desc);
92 __blake2b_init(state, outlen, tctx->key, tctx->keylen);
100 struct blake2b_state *state = shash_desc_ctx(desc);
102 __blake2b_update(state, in, inlen, compress);
109 struct blake2b_state *state = shash_desc_ctx(desc);
111 __blake2b_final(state, out, compress);