Commit a59851d2 authored by Corentin LABBE's avatar Corentin LABBE Committed by Herbert Xu

crypto: bcm - Use GCM IV size constant

This patch replace GCM IV size value by their constant name.
Signed-off-by: default avatarCorentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 219d51c7
...@@ -1367,11 +1367,11 @@ static int handle_aead_req(struct iproc_reqctx_s *rctx) ...@@ -1367,11 +1367,11 @@ static int handle_aead_req(struct iproc_reqctx_s *rctx)
* expects AAD to include just SPI and seqno. So * expects AAD to include just SPI and seqno. So
* subtract off the IV len. * subtract off the IV len.
*/ */
aead_parms.assoc_size -= GCM_ESP_IV_SIZE; aead_parms.assoc_size -= GCM_RFC4106_IV_SIZE;
if (rctx->is_encrypt) { if (rctx->is_encrypt) {
aead_parms.return_iv = true; aead_parms.return_iv = true;
aead_parms.ret_iv_len = GCM_ESP_IV_SIZE; aead_parms.ret_iv_len = GCM_RFC4106_IV_SIZE;
aead_parms.ret_iv_off = GCM_ESP_SALT_SIZE; aead_parms.ret_iv_off = GCM_ESP_SALT_SIZE;
} }
} else { } else {
...@@ -3255,7 +3255,7 @@ static struct iproc_alg_s driver_algs[] = { ...@@ -3255,7 +3255,7 @@ static struct iproc_alg_s driver_algs[] = {
.cra_flags = CRYPTO_ALG_NEED_FALLBACK .cra_flags = CRYPTO_ALG_NEED_FALLBACK
}, },
.setkey = aead_gcm_esp_setkey, .setkey = aead_gcm_esp_setkey,
.ivsize = GCM_ESP_IV_SIZE, .ivsize = GCM_RFC4106_IV_SIZE,
.maxauthsize = AES_BLOCK_SIZE, .maxauthsize = AES_BLOCK_SIZE,
}, },
.cipher_info = { .cipher_info = {
...@@ -3301,7 +3301,7 @@ static struct iproc_alg_s driver_algs[] = { ...@@ -3301,7 +3301,7 @@ static struct iproc_alg_s driver_algs[] = {
.cra_flags = CRYPTO_ALG_NEED_FALLBACK .cra_flags = CRYPTO_ALG_NEED_FALLBACK
}, },
.setkey = rfc4543_gcm_esp_setkey, .setkey = rfc4543_gcm_esp_setkey,
.ivsize = GCM_ESP_IV_SIZE, .ivsize = GCM_RFC4106_IV_SIZE,
.maxauthsize = AES_BLOCK_SIZE, .maxauthsize = AES_BLOCK_SIZE,
}, },
.cipher_info = { .cipher_info = {
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <crypto/aes.h> #include <crypto/aes.h>
#include <crypto/internal/hash.h> #include <crypto/internal/hash.h>
#include <crypto/aead.h> #include <crypto/aead.h>
#include <crypto/gcm.h>
#include <crypto/sha.h> #include <crypto/sha.h>
#include <crypto/sha3.h> #include <crypto/sha3.h>
...@@ -39,8 +40,6 @@ ...@@ -39,8 +40,6 @@
#define ARC4_STATE_SIZE 4 #define ARC4_STATE_SIZE 4
#define CCM_AES_IV_SIZE 16 #define CCM_AES_IV_SIZE 16
#define GCM_AES_IV_SIZE 12
#define GCM_ESP_IV_SIZE 8
#define CCM_ESP_IV_SIZE 8 #define CCM_ESP_IV_SIZE 8
#define RFC4543_ICV_SIZE 16 #define RFC4543_ICV_SIZE 16
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment