• Home
  • Raw
  • Download

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()
27 /* Helper functions for BLAKE2s shared by the library and shash APIs */
33 const size_t fill = BLAKE2S_BLOCK_SIZE - state->buflen; in __blake2s_update()
38 memcpy(state->buf + state->buflen, in, fill); in __blake2s_update()
40 blake2s_compress_generic(state, state->buf, 1, in __blake2s_update()
43 blake2s_compress(state, state->buf, 1, in __blake2s_update()
45 state->buflen = 0; in __blake2s_update()
47 inlen -= fill; in __blake2s_update()
53 blake2s_compress_generic(state, in, nblocks - 1, in __blake2s_update()
56 blake2s_compress(state, in, nblocks - 1, in __blake2s_update()
58 in += BLAKE2S_BLOCK_SIZE * (nblocks - 1); in __blake2s_update()
59 inlen -= BLAKE2S_BLOCK_SIZE * (nblocks - 1); in __blake2s_update()
61 memcpy(state->buf + state->buflen, in, inlen); in __blake2s_update()
62 state->buflen += inlen; in __blake2s_update()
66 __blake2s_final(struct blake2s_state *state, u8 *out, bool force_generic) in __blake2s_final() argument
69 memset(state->buf + state->buflen, 0, in __blake2s_final()
70 BLAKE2S_BLOCK_SIZE - state->buflen); /* Padding */ in __blake2s_final()
72 blake2s_compress_generic(state, state->buf, 1, state->buflen); in __blake2s_final()
74 blake2s_compress(state, state->buf, 1, state->buflen); in __blake2s_final()
75 cpu_to_le32_array(state->h, ARRAY_SIZE(state->h)); in __blake2s_final()
76 memcpy(out, state->h, state->outlen); in __blake2s_final()
79 /* Helper functions for shash implementations of BLAKE2s */
92 return -EINVAL; in crypto_blake2s_setkey()
94 memcpy(tctx->key, key, keylen); in crypto_blake2s_setkey()
95 tctx->keylen = keylen; in crypto_blake2s_setkey()
102 const struct blake2s_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in crypto_blake2s_init()
104 unsigned int outlen = crypto_shash_digestsize(desc->tfm); in crypto_blake2s_init()
106 __blake2s_init(state, outlen, tctx->key, tctx->keylen); in crypto_blake2s_init()
120 static inline int crypto_blake2s_final(struct shash_desc *desc, u8 *out, in crypto_blake2s_final() argument
125 __blake2s_final(state, out, force_generic); in crypto_blake2s_final()