summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2019-11-12 11:20:28 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2019-11-22 18:48:35 +0800
commit9cf2cfc0eb0046a8ffefe0a8e3d5abe20bb4dc3e (patch)
tree1c1da9e0abdadb82673ad0bbb957882182494212
parentad919ff72edf98093c18042df0708d57ea9a7cec (diff)
downloadlinux-crypto-9cf2cfc0eb0046a8ffefe0a8e3d5abe20bb4dc3e.tar.gz
linux-crypto-9cf2cfc0eb0046a8ffefe0a8e3d5abe20bb4dc3e.zip
crypto: blake2b - open code set last block helper
The helper is trival and called once, inlining makes things simpler. There's a comment to tie it back to the idea behind the code. Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--crypto/blake2b_generic.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/crypto/blake2b_generic.c b/crypto/blake2b_generic.c
index 442c639c..463ac597 100644
--- a/crypto/blake2b_generic.c
+++ b/crypto/blake2b_generic.c
@@ -65,11 +65,6 @@ static const u8 blake2b_sigma[12][16] = {
{ 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }
};
-static void blake2b_set_lastblock(struct blake2b_state *S)
-{
- S->f[0] = (u64)-1;
-}
-
static void blake2b_increment_counter(struct blake2b_state *S, const u64 inc)
{
S->t[0] += inc;
@@ -231,7 +226,8 @@ static int blake2b_final(struct shash_desc *desc, u8 *out)
size_t i;
blake2b_increment_counter(state, state->buflen);
- blake2b_set_lastblock(state);
+ /* Set last block */
+ state->f[0] = (u64)-1;
/* Padding */
memset(state->buf + state->buflen, 0, BLAKE2B_BLOCKBYTES - state->buflen);
blake2b_compress(state, state->buf);