From 1fcd23aa77fad1ac87b31fa4051f07e58edccf13 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 8 Jun 2023 09:06:41 +0900 Subject: [PATCH] ODROID: Remove blake2s_update, blake2s_final functions. This commit contains blake2s_update, blake2s_final functions. "crypto: blake2s - generic C library implementation and selftest" Change-Id: I477a0350530386630972dfb1ff7c54fd307e8529 --- net/wireguard/crypto/zinc/blake2s/blake2s.c | 36 --------------------- 1 file changed, 36 deletions(-) diff --git a/net/wireguard/crypto/zinc/blake2s/blake2s.c b/net/wireguard/crypto/zinc/blake2s/blake2s.c index a9b8a8d95998..24d45a05d562 100644 --- a/net/wireguard/crypto/zinc/blake2s/blake2s.c +++ b/net/wireguard/crypto/zinc/blake2s/blake2s.c @@ -167,42 +167,6 @@ static inline void blake2s_compress(struct blake2s_state *state, } } -void blake2s_update(struct blake2s_state *state, const u8 *in, size_t inlen) -{ - const size_t fill = BLAKE2S_BLOCK_SIZE - state->buflen; - - if (unlikely(!inlen)) - return; - if (inlen > fill) { - memcpy(state->buf + state->buflen, in, fill); - blake2s_compress(state, state->buf, 1, BLAKE2S_BLOCK_SIZE); - state->buflen = 0; - in += fill; - inlen -= fill; - } - if (inlen > BLAKE2S_BLOCK_SIZE) { - const size_t nblocks = DIV_ROUND_UP(inlen, BLAKE2S_BLOCK_SIZE); - /* Hash one less (full) block than strictly possible */ - blake2s_compress(state, in, nblocks - 1, BLAKE2S_BLOCK_SIZE); - in += BLAKE2S_BLOCK_SIZE * (nblocks - 1); - inlen -= BLAKE2S_BLOCK_SIZE * (nblocks - 1); - } - memcpy(state->buf + state->buflen, in, inlen); - state->buflen += inlen; -} - -void blake2s_final(struct blake2s_state *state, u8 *out) -{ - WARN_ON(IS_ENABLED(DEBUG) && !out); - blake2s_set_lastblock(state); - memset(state->buf + state->buflen, 0, - BLAKE2S_BLOCK_SIZE - state->buflen); /* Padding */ - blake2s_compress(state, state->buf, 1, state->buflen); - cpu_to_le32_array(state->h, ARRAY_SIZE(state->h)); - memcpy(out, state->h, state->outlen); - memzero_explicit(state, sizeof(*state)); -} - void blake2s_hmac(u8 *out, const u8 *in, const u8 *key, const size_t outlen, const size_t inlen, const size_t keylen) {