OSDN Git Service

crypto: brcm - Use IPAD/OPAD constant
authorCorentin LABBE <clabbe.montjoie@gmail.com>
Fri, 19 May 2017 06:53:24 +0000 (08:53 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 23 May 2017 04:52:06 +0000 (12:52 +0800)
This patch simply replace all occurrence of HMAC IPAD/OPAD value by their
define.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/bcm/cipher.c

index cc0d5b9..61393dc 100644 (file)
@@ -36,6 +36,7 @@
 #include <crypto/internal/aead.h>
 #include <crypto/aes.h>
 #include <crypto/des.h>
+#include <crypto/hmac.h>
 #include <crypto/sha.h>
 #include <crypto/md5.h>
 #include <crypto/authenc.h>
@@ -2510,8 +2511,8 @@ static int ahash_hmac_setkey(struct crypto_ahash *ahash, const u8 *key,
                memcpy(ctx->opad, ctx->ipad, blocksize);
 
                for (index = 0; index < blocksize; index++) {
-                       ctx->ipad[index] ^= 0x36;
-                       ctx->opad[index] ^= 0x5c;
+                       ctx->ipad[index] ^= HMAC_IPAD_VALUE;
+                       ctx->opad[index] ^= HMAC_OPAD_VALUE;
                }
 
                flow_dump("  ipad: ", ctx->ipad, blocksize);