浏览代码

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>
Antoine Ténart 8 年之前
父节点
当前提交
303391d69b
共有 1 个文件被更改,包括 2 次插入6 次删除
  1. 2 6
      drivers/crypto/sunxi-ss/sun4i-ss-hash.c

+ 2 - 6
drivers/crypto/sunxi-ss/sun4i-ss-hash.c

@@ -392,12 +392,8 @@ hash_final:
 	}
 	}
 
 
 	/* write the remaining bytes of the nbw buffer */
 	/* 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)
 	 * number of space to pad to obtain 64o minus 8(size) minus 4 (final 1)