Browse Source

crypto: qat - Use IPAD/OPAD constant

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>
Corentin LABBE 8 years ago
parent
commit
f14011ad7c
1 changed files with 3 additions and 2 deletions
  1. 3 2
      drivers/crypto/qat/qat_common/qat_algs.c

+ 3 - 2
drivers/crypto/qat/qat_common/qat_algs.c

@@ -51,6 +51,7 @@
 #include <crypto/aes.h>
 #include <crypto/aes.h>
 #include <crypto/sha.h>
 #include <crypto/sha.h>
 #include <crypto/hash.h>
 #include <crypto/hash.h>
+#include <crypto/hmac.h>
 #include <crypto/algapi.h>
 #include <crypto/algapi.h>
 #include <crypto/authenc.h>
 #include <crypto/authenc.h>
 #include <linux/dma-mapping.h>
 #include <linux/dma-mapping.h>
@@ -178,8 +179,8 @@ static int qat_alg_do_precomputes(struct icp_qat_hw_auth_algo_blk *hash,
 	for (i = 0; i < block_size; i++) {
 	for (i = 0; i < block_size; i++) {
 		char *ipad_ptr = ipad + i;
 		char *ipad_ptr = ipad + i;
 		char *opad_ptr = opad + i;
 		char *opad_ptr = opad + i;
-		*ipad_ptr ^= 0x36;
-		*opad_ptr ^= 0x5C;
+		*ipad_ptr ^= HMAC_IPAD_VALUE;
+		*opad_ptr ^= HMAC_OPAD_VALUE;
 	}
 	}
 
 
 	if (crypto_shash_init(shash))
 	if (crypto_shash_init(shash))