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

crypto: caam - 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
7545e166 ef780324

+6 -5
+5 -5
drivers/crypto/caam/caamalg.c
··· 992 992 struct caam_ctx *ctx = crypto_aead_ctx(aead); 993 993 unsigned int ivsize = crypto_aead_ivsize(aead); 994 994 u32 *desc = edesc->hw_desc; 995 - bool generic_gcm = (ivsize == 12); 995 + bool generic_gcm = (ivsize == GCM_AES_IV_SIZE); 996 996 unsigned int last; 997 997 998 998 init_aead_job(req, edesc, all_contig, encrypt); ··· 1004 1004 1005 1005 /* Read GCM IV */ 1006 1006 append_cmd(desc, CMD_FIFO_LOAD | FIFOLD_CLASS_CLASS1 | IMMEDIATE | 1007 - FIFOLD_TYPE_IV | FIFOLD_TYPE_FLUSH1 | 12 | last); 1007 + FIFOLD_TYPE_IV | FIFOLD_TYPE_FLUSH1 | GCM_AES_IV_SIZE | last); 1008 1008 /* Append Salt */ 1009 1009 if (!generic_gcm) 1010 1010 append_data(desc, ctx->key + ctx->cdata.keylen, 4); ··· 1953 1953 .setauthsize = rfc4106_setauthsize, 1954 1954 .encrypt = ipsec_gcm_encrypt, 1955 1955 .decrypt = ipsec_gcm_decrypt, 1956 - .ivsize = 8, 1956 + .ivsize = GCM_RFC4106_IV_SIZE, 1957 1957 .maxauthsize = AES_BLOCK_SIZE, 1958 1958 }, 1959 1959 .caam = { ··· 1971 1971 .setauthsize = rfc4543_setauthsize, 1972 1972 .encrypt = ipsec_gcm_encrypt, 1973 1973 .decrypt = ipsec_gcm_decrypt, 1974 - .ivsize = 8, 1974 + .ivsize = GCM_RFC4543_IV_SIZE, 1975 1975 .maxauthsize = AES_BLOCK_SIZE, 1976 1976 }, 1977 1977 .caam = { ··· 1990 1990 .setauthsize = gcm_setauthsize, 1991 1991 .encrypt = gcm_encrypt, 1992 1992 .decrypt = gcm_decrypt, 1993 - .ivsize = 12, 1993 + .ivsize = GCM_AES_IV_SIZE, 1994 1994 .maxauthsize = AES_BLOCK_SIZE, 1995 1995 }, 1996 1996 .caam = {
+1
drivers/crypto/caam/compat.h
··· 31 31 #include <crypto/aes.h> 32 32 #include <crypto/ctr.h> 33 33 #include <crypto/des.h> 34 + #include <crypto/gcm.h> 34 35 #include <crypto/sha.h> 35 36 #include <crypto/md5.h> 36 37 #include <crypto/internal/aead.h>