Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fdd0f3d8 authored by Corentin LABBE's avatar Corentin LABBE Committed by Herbert Xu
Browse files

crypto: nx - 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 cf0bd0ae
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -22,6 +22,7 @@
#include <crypto/internal/aead.h>
#include <crypto/internal/aead.h>
#include <crypto/aes.h>
#include <crypto/aes.h>
#include <crypto/algapi.h>
#include <crypto/algapi.h>
#include <crypto/gcm.h>
#include <crypto/scatterwalk.h>
#include <crypto/scatterwalk.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/types.h>
@@ -433,7 +434,7 @@ static int gcm_aes_nx_encrypt(struct aead_request *req)
	struct nx_gcm_rctx *rctx = aead_request_ctx(req);
	struct nx_gcm_rctx *rctx = aead_request_ctx(req);
	char *iv = rctx->iv;
	char *iv = rctx->iv;


	memcpy(iv, req->iv, 12);
	memcpy(iv, req->iv, GCM_AES_IV_SIZE);


	return gcm_aes_nx_crypt(req, 1, req->assoclen);
	return gcm_aes_nx_crypt(req, 1, req->assoclen);
}
}
@@ -443,7 +444,7 @@ static int gcm_aes_nx_decrypt(struct aead_request *req)
	struct nx_gcm_rctx *rctx = aead_request_ctx(req);
	struct nx_gcm_rctx *rctx = aead_request_ctx(req);
	char *iv = rctx->iv;
	char *iv = rctx->iv;


	memcpy(iv, req->iv, 12);
	memcpy(iv, req->iv, GCM_AES_IV_SIZE);


	return gcm_aes_nx_crypt(req, 0, req->assoclen);
	return gcm_aes_nx_crypt(req, 0, req->assoclen);
}
}
@@ -498,7 +499,7 @@ struct aead_alg nx_gcm_aes_alg = {
	},
	},
	.init        = nx_crypto_ctx_aes_gcm_init,
	.init        = nx_crypto_ctx_aes_gcm_init,
	.exit        = nx_crypto_ctx_aead_exit,
	.exit        = nx_crypto_ctx_aead_exit,
	.ivsize      = 12,
	.ivsize      = GCM_AES_IV_SIZE,
	.maxauthsize = AES_BLOCK_SIZE,
	.maxauthsize = AES_BLOCK_SIZE,
	.setkey      = gcm_aes_nx_set_key,
	.setkey      = gcm_aes_nx_set_key,
	.encrypt     = gcm_aes_nx_encrypt,
	.encrypt     = gcm_aes_nx_encrypt,
@@ -516,7 +517,7 @@ struct aead_alg nx_gcm4106_aes_alg = {
	},
	},
	.init        = nx_crypto_ctx_aes_gcm_init,
	.init        = nx_crypto_ctx_aes_gcm_init,
	.exit        = nx_crypto_ctx_aead_exit,
	.exit        = nx_crypto_ctx_aead_exit,
	.ivsize      = 8,
	.ivsize      = GCM_RFC4106_IV_SIZE,
	.maxauthsize = AES_BLOCK_SIZE,
	.maxauthsize = AES_BLOCK_SIZE,
	.setkey      = gcm4106_aes_nx_set_key,
	.setkey      = gcm4106_aes_nx_set_key,
	.setauthsize = gcm4106_aes_nx_setauthsize,
	.setauthsize = gcm4106_aes_nx_setauthsize,