summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/sunxi-ss
diff options
context:
space:
mode:
authorAntoine Ténart <antoine.tenart@free-electrons.com>2017-06-01 21:38:59 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2017-06-19 14:19:51 +0800
commit303391d69b6ae7dff30f7886b717e39f47067d6d (patch)
tree9c33552edfba94ada0b3cb82a8248548c21af32a /drivers/crypto/sunxi-ss
parent214a9bd0f8dec468de6a32f445c540f786773ee8 (diff)
downloadblackbird-op-linux-303391d69b6ae7dff30f7886b717e39f47067d6d.tar.gz
blackbird-op-linux-303391d69b6ae7dff30f7886b717e39f47067d6d.zip
crypto: sun4i-ss - simplify the appended bit assignment
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>
Diffstat (limited to 'drivers/crypto/sunxi-ss')
-rw-r--r--drivers/crypto/sunxi-ss/sun4i-ss-hash.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c
index 59d9b4412aca..0c2efc88bc0a 100644
--- a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c
+++ b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c
@@ -392,12 +392,8 @@ hash_final:
}
/* 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)
OpenPOWER on IntegriCloud