Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: ccp - Use GCM IV size constant

This patch replace GCM IV size value by their constant name.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Corentin LABBE and committed by
Herbert Xu
cf0bd0ae 7545e166

+4 -5
+4 -5
drivers/crypto/ccp/ccp-crypto-aes-galois.c
··· 19 19 #include <crypto/algapi.h> 20 20 #include <crypto/aes.h> 21 21 #include <crypto/ctr.h> 22 + #include <crypto/gcm.h> 22 23 #include <crypto/scatterwalk.h> 23 24 #include <linux/delay.h> 24 25 25 26 #include "ccp-crypto.h" 26 - 27 - #define AES_GCM_IVSIZE 12 28 27 29 28 static int ccp_aes_gcm_complete(struct crypto_async_request *async_req, int ret) 30 29 { ··· 94 95 */ 95 96 96 97 /* Prepare the IV: 12 bytes + an integer (counter) */ 97 - memcpy(rctx->iv, req->iv, AES_GCM_IVSIZE); 98 + memcpy(rctx->iv, req->iv, GCM_AES_IV_SIZE); 98 99 for (i = 0; i < 3; i++) 99 - rctx->iv[i + AES_GCM_IVSIZE] = 0; 100 + rctx->iv[i + GCM_AES_IV_SIZE] = 0; 100 101 rctx->iv[AES_BLOCK_SIZE - 1] = 1; 101 102 102 103 /* Set up a scatterlist for the IV */ ··· 159 160 .encrypt = ccp_aes_gcm_encrypt, 160 161 .decrypt = ccp_aes_gcm_decrypt, 161 162 .init = ccp_aes_gcm_cra_init, 162 - .ivsize = AES_GCM_IVSIZE, 163 + .ivsize = GCM_AES_IV_SIZE, 163 164 .maxauthsize = AES_BLOCK_SIZE, 164 165 .base = { 165 166 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER |