Skip to content

Commit

Permalink
crypto: sun4i-ss - simplify the appended bit assignment
Browse files Browse the repository at this point in the history
A bit is appended at the end of the input buffer for sha1. Simplify the
code assigning it.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Acked-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Antoine Ténart authored and Herbert Xu committed Jun 19, 2017
1 parent 214a9bd commit 303391d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/crypto/sunxi-ss/sun4i-ss-hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,8 @@ static int sun4i_hash(struct ahash_request *areq)
}

/* write the remaining bytes of the nbw buffer */
if (nbw) {
wb |= ((1 << 7) << (nbw * 8));
bf[j++] = wb;
} else {
bf[j++] = 1 << 7;
}
wb |= ((1 << 7) << (nbw * 8));
bf[j++] = wb;

/*
* number of space to pad to obtain 64o minus 8(size) minus 4 (final 1)
Expand Down

0 comments on commit 303391d

Please sign in to comment.