aboutsummaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorJanne Peltonen <janne.peltonen@nokia.com>2023-02-20 19:29:32 +0200
committerMatias Elo <matias.elo@nokia.com>2023-04-12 15:52:37 +0300
commitc919196071d2850e75f3c6cd920845c23acd3377 (patch)
tree08121e1851f9d5a85c4ba05cd8987b40a48ae2bf /platform
parentadea8b08b8f95cc61d67650e4b1f63aac996f068 (diff)
linux-gen: crypto: treat IV and AAD as const arrays
Treat IV and AAD pointers of operation parameter as pointers to const data to prepare for similar API change. Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Anoob Joseph <anoobj@marvell.com>
Diffstat (limited to 'platform')
-rw-r--r--platform/linux-generic/arch/aarch64/odp_crypto_armv8.c2
-rw-r--r--platform/linux-generic/odp_crypto_ipsecmb.c6
-rw-r--r--platform/linux-generic/odp_crypto_openssl.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c
index 4def7866d..ee0307371 100644
--- a/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c
+++ b/platform/linux-generic/arch/aarch64/odp_crypto_armv8.c
@@ -203,7 +203,7 @@ null_crypto_routine(odp_packet_t pkt ODP_UNUSED,
set_crypto_op_result_ok(pkt);
}
-static inline void copy_aad(uint8_t *dst, uint8_t *src, uint32_t len)
+static inline void copy_aad(uint8_t *dst, const uint8_t *src, uint32_t len)
{
_ODP_ASSERT(len == 8 || len == 12);
diff --git a/platform/linux-generic/odp_crypto_ipsecmb.c b/platform/linux-generic/odp_crypto_ipsecmb.c
index 467a0d1b4..6c59957cb 100644
--- a/platform/linux-generic/odp_crypto_ipsecmb.c
+++ b/platform/linux-generic/odp_crypto_ipsecmb.c
@@ -171,7 +171,7 @@ odp_crypto_alg_err_t ipsec_mb_cipher_op(odp_packet_t pkt,
odp_crypto_generic_session_t *session)
{
IMB_MGR *mb_mgr = local.mb_mgr;
- uint8_t *iv_ptr = param->cipher_iv_ptr;
+ const uint8_t *iv_ptr = param->cipher_iv_ptr;
uint32_t in_pos = param->cipher_range.offset;
uint32_t in_len = param->cipher_range.length;
@@ -248,7 +248,7 @@ odp_crypto_alg_err_t auth_ipsec_mb_gen(odp_packet_t pkt,
odp_crypto_generic_session_t *session)
{
IMB_MGR *mb_mgr = local.mb_mgr;
- uint8_t *iv_ptr = param->auth_iv_ptr;
+ const uint8_t *iv_ptr = param->auth_iv_ptr;
uint32_t in_pos = param->auth_range.offset;
uint32_t in_len = param->auth_range.length;
uint32_t auth_tag;
@@ -312,7 +312,7 @@ odp_crypto_alg_err_t auth_ipsec_mb_check(odp_packet_t pkt,
odp_crypto_generic_session_t *session)
{
IMB_MGR *mb_mgr = local.mb_mgr;
- uint8_t *iv_ptr = param->auth_iv_ptr;
+ const uint8_t *iv_ptr = param->auth_iv_ptr;
uint32_t in_pos = param->auth_range.offset;
uint32_t in_len = param->auth_range.length;
uint32_t bytes = ZUC_DIGEST_LENGTH;
diff --git a/platform/linux-generic/odp_crypto_openssl.c b/platform/linux-generic/odp_crypto_openssl.c
index 99ce28339..3912b37ec 100644
--- a/platform/linux-generic/odp_crypto_openssl.c
+++ b/platform/linux-generic/odp_crypto_openssl.c
@@ -705,7 +705,7 @@ int packet_cmac_eia2(odp_packet_t pkt,
uint8_t *hash)
{
CMAC_CTX *ctx = local.cmac_ctx[session->idx];
- void *iv_ptr = param->auth_iv_ptr;
+ const void *iv_ptr = param->auth_iv_ptr;
uint32_t offset = param->auth_range.offset;
uint32_t len = param->auth_range.length;
size_t outlen;