From: Corentin LABBE Date: Fri, 19 May 2017 06:53:30 +0000 (+0200) Subject: crypto: mediatek - Use IPAD/OPAD constant X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1127eea914c74bf8c3cb3ddaa3dcaae628e87263;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git crypto: mediatek - Use IPAD/OPAD constant This patch simply replace all occurrence of HMAC IPAD/OPAD value by their define. Signed-off-by: Corentin Labbe Reviewed-by: Matthias Brugger Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/mediatek/mtk-sha.c b/drivers/crypto/mediatek/mtk-sha.c index 2226f12d1c7a..5f4f845adbb8 100644 --- a/drivers/crypto/mediatek/mtk-sha.c +++ b/drivers/crypto/mediatek/mtk-sha.c @@ -12,6 +12,7 @@ * Some ideas are from atmel-sha.c and omap-sham.c drivers. */ +#include #include #include "mtk-platform.h" @@ -825,8 +826,8 @@ static int mtk_sha_setkey(struct crypto_ahash *tfm, const u8 *key, memcpy(bctx->opad, bctx->ipad, bs); for (i = 0; i < bs; i++) { - bctx->ipad[i] ^= 0x36; - bctx->opad[i] ^= 0x5c; + bctx->ipad[i] ^= HMAC_IPAD_VALUE; + bctx->opad[i] ^= HMAC_OPAD_VALUE; } return 0;