Lines Matching +full:out +full:- +full:functions

1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
3 * Helper functions for BLAKE2s implementations.
24 state->f[0] = -1; in blake2s_set_lastblock()
30 /* Helper functions for BLAKE2s shared by the library and shash APIs */
36 const size_t fill = BLAKE2S_BLOCK_SIZE - state->buflen; in __blake2s_update()
41 memcpy(state->buf + state->buflen, in, fill); in __blake2s_update()
42 (*compress)(state, state->buf, 1, BLAKE2S_BLOCK_SIZE); in __blake2s_update()
43 state->buflen = 0; in __blake2s_update()
45 inlen -= fill; in __blake2s_update()
50 (*compress)(state, in, nblocks - 1, BLAKE2S_BLOCK_SIZE); in __blake2s_update()
51 in += BLAKE2S_BLOCK_SIZE * (nblocks - 1); in __blake2s_update()
52 inlen -= BLAKE2S_BLOCK_SIZE * (nblocks - 1); in __blake2s_update()
54 memcpy(state->buf + state->buflen, in, inlen); in __blake2s_update()
55 state->buflen += inlen; in __blake2s_update()
58 static inline void __blake2s_final(struct blake2s_state *state, u8 *out, in __blake2s_final() argument
62 memset(state->buf + state->buflen, 0, in __blake2s_final()
63 BLAKE2S_BLOCK_SIZE - state->buflen); /* Padding */ in __blake2s_final()
64 (*compress)(state, state->buf, 1, state->buflen); in __blake2s_final()
65 cpu_to_le32_array(state->h, ARRAY_SIZE(state->h)); in __blake2s_final()
66 memcpy(out, state->h, state->outlen); in __blake2s_final()
69 /* Helper functions for shash implementations of BLAKE2s */
82 return -EINVAL; in crypto_blake2s_setkey()
84 memcpy(tctx->key, key, keylen); in crypto_blake2s_setkey()
85 tctx->keylen = keylen; in crypto_blake2s_setkey()
92 const struct blake2s_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in crypto_blake2s_init()
94 unsigned int outlen = crypto_shash_digestsize(desc->tfm); in crypto_blake2s_init()
96 __blake2s_init(state, outlen, tctx->key, tctx->keylen); in crypto_blake2s_init()
110 static inline int crypto_blake2s_final(struct shash_desc *desc, u8 *out, in crypto_blake2s_final() argument
115 __blake2s_final(state, out, compress); in crypto_blake2s_final()