]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
crypto: aead - remove useless setting of type flags
authorEric Biggers <ebiggers@google.com>
Sat, 30 Jun 2018 22:16:14 +0000 (15:16 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 8 Jul 2018 16:30:26 +0000 (00:30 +0800)
Some aead algorithms set .cra_flags = CRYPTO_ALG_TYPE_AEAD.  But this is
redundant with the C structure type ('struct aead_alg'), and
crypto_register_aead() already sets the type flag automatically,
clearing any type flag that was already there.  Apparently the useless
assignment has just been copy+pasted around.

So, remove the useless assignment from all the aead algorithms.

This patch shouldn't change any actual behavior.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/s390/crypto/aes_s390.c
crypto/aegis128.c
crypto/aegis128l.c
crypto/aegis256.c
crypto/morus1280.c
crypto/morus640.c
drivers/crypto/axis/artpec6_crypto.c
drivers/crypto/bcm/cipher.c
drivers/crypto/chelsio/chcr_algo.c
drivers/crypto/inside-secure/safexcel_cipher.c

index ad47abd086308d3040c12807c54174f84e2e35d6..c54cb26eb7f5049b047a3cd140c9069926a615b2 100644 (file)
@@ -1035,7 +1035,6 @@ static struct aead_alg gcm_aes_aead = {
        .chunksize              = AES_BLOCK_SIZE,
 
        .base                   = {
-               .cra_flags              = CRYPTO_ALG_TYPE_AEAD,
                .cra_blocksize          = 1,
                .cra_ctxsize            = sizeof(struct s390_aes_ctx),
                .cra_priority           = 900,
index 38271303ce16c9a1138077747cc38ade1b5ff296..c22f4414856d9939cbd23774bd7091c84d8fa497 100644 (file)
@@ -429,7 +429,6 @@ static struct aead_alg crypto_aegis128_alg = {
        .chunksize = AEGIS_BLOCK_SIZE,
 
        .base = {
-               .cra_flags = CRYPTO_ALG_TYPE_AEAD,
                .cra_blocksize = 1,
                .cra_ctxsize = sizeof(struct aegis_ctx),
                .cra_alignmask = 0,
index 64dc2654b863ee7bf54406b9ec0975854b650cfc..b6fb21ebdc3e8a6e7d72bd9f3602d5d95c227d18 100644 (file)
@@ -493,7 +493,6 @@ static struct aead_alg crypto_aegis128l_alg = {
        .chunksize = AEGIS128L_CHUNK_SIZE,
 
        .base = {
-               .cra_flags = CRYPTO_ALG_TYPE_AEAD,
                .cra_blocksize = 1,
                .cra_ctxsize = sizeof(struct aegis_ctx),
                .cra_alignmask = 0,
index a489d741d33ad5bc487a58253712f9361385de92..11f0f8ec9c7c27d77a8338a0451da8d387c15360 100644 (file)
@@ -444,7 +444,6 @@ static struct aead_alg crypto_aegis256_alg = {
        .chunksize = AEGIS_BLOCK_SIZE,
 
        .base = {
-               .cra_flags = CRYPTO_ALG_TYPE_AEAD,
                .cra_blocksize = 1,
                .cra_ctxsize = sizeof(struct aegis_ctx),
                .cra_alignmask = 0,
index 6180b2557836a3156062abebea0b3c4c7d6d39a4..d057cf5ac4a8b07897e7e0e143e65015a4cbc71f 100644 (file)
@@ -514,7 +514,6 @@ static struct aead_alg crypto_morus1280_alg = {
        .chunksize = MORUS1280_BLOCK_SIZE,
 
        .base = {
-               .cra_flags = CRYPTO_ALG_TYPE_AEAD,
                .cra_blocksize = 1,
                .cra_ctxsize = sizeof(struct morus1280_ctx),
                .cra_alignmask = 0,
index 9fbcde307daf90b554ac5e96da627f0f77eb24e9..5c48a7cb899e6f3e23076df0fc5a61e679fe02c3 100644 (file)
@@ -510,7 +510,6 @@ static struct aead_alg crypto_morus640_alg = {
        .chunksize = MORUS640_BLOCK_SIZE,
 
        .base = {
-               .cra_flags = CRYPTO_ALG_TYPE_AEAD,
                .cra_blocksize = 1,
                .cra_ctxsize = sizeof(struct morus640_ctx),
                .cra_alignmask = 0,
index 049af6de3cb698cf7e31550a2eaaf44fff247f9d..59392178d8bc66a9cea4e909a8fe61b31c313a9f 100644 (file)
@@ -2964,7 +2964,7 @@ static struct aead_alg aead_algos[] = {
                        .cra_name = "gcm(aes)",
                        .cra_driver_name = "artpec-gcm-aes",
                        .cra_priority = 300,
-                       .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC |
+                       .cra_flags = CRYPTO_ALG_ASYNC |
                                     CRYPTO_ALG_KERN_DRIVER_ONLY,
                        .cra_blocksize = 1,
                        .cra_ctxsize = sizeof(struct artpec6_cryptotfm_context),
index 4e2babd6b89d755770a029f52639c072d341b041..2d1f1db9f807448c45bc228d7c4f500d3ac6152c 100644 (file)
@@ -4689,7 +4689,7 @@ static int spu_register_aead(struct iproc_alg_s *driver_alg)
        aead->base.cra_ctxsize = sizeof(struct iproc_ctx_s);
        INIT_LIST_HEAD(&aead->base.cra_list);
 
-       aead->base.cra_flags |= CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC;
+       aead->base.cra_flags |= CRYPTO_ALG_ASYNC;
        /* setkey set in alg initialization */
        aead->setauthsize = aead_setauthsize;
        aead->encrypt = aead_encrypt;
index 915b1500393cd0a1e324f292a48653fc6af522e5..5c539af8ed6048c9687dae5f99653d57a17bc4c7 100644 (file)
@@ -4236,8 +4236,7 @@ static int chcr_register_alg(void)
                        break;
                case CRYPTO_ALG_TYPE_AEAD:
                        driver_algs[i].alg.aead.base.cra_flags =
-                               CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC |
-                               CRYPTO_ALG_NEED_FALLBACK;
+                               CRYPTO_ALG_ASYNC | CRYPTO_ALG_NEED_FALLBACK;
                        driver_algs[i].alg.aead.encrypt = chcr_aead_encrypt;
                        driver_algs[i].alg.aead.decrypt = chcr_aead_decrypt;
                        driver_algs[i].alg.aead.init = chcr_aead_cra_init;
index 9d292427a4881161613aadf2cdda33a7cf847133..19024500a89529c299cfc8d12f6b2bf92f96c7a8 100644 (file)
@@ -1186,7 +1186,7 @@ struct safexcel_alg_template safexcel_alg_authenc_hmac_sha1_cbc_aes = {
                        .cra_name = "authenc(hmac(sha1),cbc(aes))",
                        .cra_driver_name = "safexcel-authenc-hmac-sha1-cbc-aes",
                        .cra_priority = 300,
-                       .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC |
+                       .cra_flags = CRYPTO_ALG_ASYNC |
                                     CRYPTO_ALG_KERN_DRIVER_ONLY,
                        .cra_blocksize = AES_BLOCK_SIZE,
                        .cra_ctxsize = sizeof(struct safexcel_cipher_ctx),
@@ -1221,7 +1221,7 @@ struct safexcel_alg_template safexcel_alg_authenc_hmac_sha256_cbc_aes = {
                        .cra_name = "authenc(hmac(sha256),cbc(aes))",
                        .cra_driver_name = "safexcel-authenc-hmac-sha256-cbc-aes",
                        .cra_priority = 300,
-                       .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC |
+                       .cra_flags = CRYPTO_ALG_ASYNC |
                                     CRYPTO_ALG_KERN_DRIVER_ONLY,
                        .cra_blocksize = AES_BLOCK_SIZE,
                        .cra_ctxsize = sizeof(struct safexcel_cipher_ctx),
@@ -1256,7 +1256,7 @@ struct safexcel_alg_template safexcel_alg_authenc_hmac_sha224_cbc_aes = {
                        .cra_name = "authenc(hmac(sha224),cbc(aes))",
                        .cra_driver_name = "safexcel-authenc-hmac-sha224-cbc-aes",
                        .cra_priority = 300,
-                       .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC |
+                       .cra_flags = CRYPTO_ALG_ASYNC |
                                     CRYPTO_ALG_KERN_DRIVER_ONLY,
                        .cra_blocksize = AES_BLOCK_SIZE,
                        .cra_ctxsize = sizeof(struct safexcel_cipher_ctx),
@@ -1291,7 +1291,7 @@ struct safexcel_alg_template safexcel_alg_authenc_hmac_sha512_cbc_aes = {
                        .cra_name = "authenc(hmac(sha512),cbc(aes))",
                        .cra_driver_name = "safexcel-authenc-hmac-sha512-cbc-aes",
                        .cra_priority = 300,
-                       .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC |
+                       .cra_flags = CRYPTO_ALG_ASYNC |
                                     CRYPTO_ALG_KERN_DRIVER_ONLY,
                        .cra_blocksize = AES_BLOCK_SIZE,
                        .cra_ctxsize = sizeof(struct safexcel_cipher_ctx),
@@ -1326,7 +1326,7 @@ struct safexcel_alg_template safexcel_alg_authenc_hmac_sha384_cbc_aes = {
                        .cra_name = "authenc(hmac(sha384),cbc(aes))",
                        .cra_driver_name = "safexcel-authenc-hmac-sha384-cbc-aes",
                        .cra_priority = 300,
-                       .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC |
+                       .cra_flags = CRYPTO_ALG_ASYNC |
                                     CRYPTO_ALG_KERN_DRIVER_ONLY,
                        .cra_blocksize = AES_BLOCK_SIZE,
                        .cra_ctxsize = sizeof(struct safexcel_cipher_ctx),