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

crypto: chelsio - 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
8f6acb7f 07b83f43

+5 -4
+5 -4
drivers/crypto/chelsio/chcr_algo.c
··· 53 53 #include <crypto/aes.h> 54 54 #include <crypto/algapi.h> 55 55 #include <crypto/hash.h> 56 + #include <crypto/gcm.h> 56 57 #include <crypto/sha.h> 57 58 #include <crypto/authenc.h> 58 59 #include <crypto/ctr.h> ··· 2535 2534 if (get_aead_subtype(tfm) == 2536 2535 CRYPTO_ALG_SUB_TYPE_AEAD_RFC4106) { 2537 2536 memcpy(reqctx->iv, aeadctx->salt, 4); 2538 - memcpy(reqctx->iv + 4, req->iv, 8); 2537 + memcpy(reqctx->iv + 4, req->iv, GCM_RFC4106_IV_SIZE); 2539 2538 } else { 2540 - memcpy(reqctx->iv, req->iv, 12); 2539 + memcpy(reqctx->iv, req->iv, GCM_AES_IV_SIZE); 2541 2540 } 2542 2541 *((unsigned int *)(reqctx->iv + 12)) = htonl(0x01); 2543 2542 ··· 3386 3385 sizeof(struct chcr_aead_ctx) + 3387 3386 sizeof(struct chcr_gcm_ctx), 3388 3387 }, 3389 - .ivsize = 12, 3388 + .ivsize = GCM_AES_IV_SIZE, 3390 3389 .maxauthsize = GHASH_DIGEST_SIZE, 3391 3390 .setkey = chcr_gcm_setkey, 3392 3391 .setauthsize = chcr_gcm_setauthsize, ··· 3406 3405 sizeof(struct chcr_gcm_ctx), 3407 3406 3408 3407 }, 3409 - .ivsize = 8, 3408 + .ivsize = GCM_RFC4106_IV_SIZE, 3410 3409 .maxauthsize = GHASH_DIGEST_SIZE, 3411 3410 .setkey = chcr_gcm_setkey, 3412 3411 .setauthsize = chcr_4106_4309_setauthsize,