@@ -635,7 +635,7 @@ pkt_disposition_e do_ipsec_in_classify(odp_packet_t *pkt,
if (esp) {
params.cipher_range.offset = ipv4_data_p(ip) + hdr_len - buf;
params.cipher_range.length = ipv4_data_len(ip) - hdr_len;
- params.override_iv_ptr = esp->iv;
+ params.cipher_iv_ptr = esp->iv;
}
/* Issue crypto request */
@@ -400,8 +400,13 @@ typedef struct odp_crypto_op_param_t {
*/
odp_packet_t out_pkt;
- /** Override session IV pointer */
- uint8_t *override_iv_ptr;
+ /** Override session IV pointer for cipher */
+ union {
+ /** @deprecated use cipher_iv_ptr */
+ uint8_t *ODP_DEPRECATE(override_iv_ptr);
+ /** Override session IV pointer for cipher */
+ uint8_t *cipher_iv_ptr;
+ };
/** Offset from start of packet for hash result
*
@@ -436,8 +441,13 @@ typedef struct odp_crypto_packet_op_param_t {
/** Session handle from creation */
odp_crypto_session_t session;
- /** Override session IV pointer */
- uint8_t *override_iv_ptr;
+ /** Override session IV pointer for cipher */
+ union {
+ /** @deprecated use cipher_iv_ptr */
+ uint8_t *ODP_DEPRECATE(override_iv_ptr);
+ /** Override session IV pointer for cipher */
+ uint8_t *cipher_iv_ptr;
+ };
/** Offset from start of packet for hash result
*
@@ -434,8 +434,8 @@ odp_crypto_alg_err_t cipher_encrypt(odp_packet_t pkt,
void *iv_ptr;
int ret;
- if (param->override_iv_ptr)
- iv_ptr = param->override_iv_ptr;
+ if (param->cipher_iv_ptr)
+ iv_ptr = param->cipher_iv_ptr;
else if (session->p.cipher_iv.data)
iv_ptr = session->cipher.iv_data;
else
@@ -465,8 +465,8 @@ odp_crypto_alg_err_t cipher_decrypt(odp_packet_t pkt,
void *iv_ptr;
int ret;
- if (param->override_iv_ptr)
- iv_ptr = param->override_iv_ptr;
+ if (param->cipher_iv_ptr)
+ iv_ptr = param->cipher_iv_ptr;
else if (session->p.cipher_iv.data)
iv_ptr = session->cipher.iv_data;
else
@@ -528,8 +528,8 @@ odp_crypto_alg_err_t aes_gcm_encrypt(odp_packet_t pkt,
uint8_t block[EVP_MAX_MD_SIZE];
int ret;
- if (param->override_iv_ptr)
- iv_ptr = param->override_iv_ptr;
+ if (param->cipher_iv_ptr)
+ iv_ptr = param->cipher_iv_ptr;
else if (session->p.cipher_iv.data)
iv_ptr = session->cipher.iv_data;
else
@@ -575,8 +575,8 @@ odp_crypto_alg_err_t aes_gcm_decrypt(odp_packet_t pkt,
uint8_t block[EVP_MAX_MD_SIZE];
int ret;
- if (param->override_iv_ptr)
- iv_ptr = param->override_iv_ptr;
+ if (param->cipher_iv_ptr)
+ iv_ptr = param->cipher_iv_ptr;
else if (session->p.cipher_iv.data)
iv_ptr = session->cipher.iv_data;
else
@@ -641,8 +641,8 @@ odp_crypto_alg_err_t aes_gmac_gen(odp_packet_t pkt,
uint8_t block[EVP_MAX_MD_SIZE];
int ret;
- if (param->override_iv_ptr)
- iv_ptr = param->override_iv_ptr;
+ if (param->cipher_iv_ptr)
+ iv_ptr = param->cipher_iv_ptr;
else if (session->p.cipher_iv.data)
iv_ptr = session->cipher.iv_data;
else
@@ -680,8 +680,8 @@ odp_crypto_alg_err_t aes_gmac_check(odp_packet_t pkt,
uint8_t block[EVP_MAX_MD_SIZE];
int ret;
- if (param->override_iv_ptr)
- iv_ptr = param->override_iv_ptr;
+ if (param->cipher_iv_ptr)
+ iv_ptr = param->cipher_iv_ptr;
else if (session->p.cipher_iv.data)
iv_ptr = session->cipher.iv_data;
else
@@ -1101,7 +1101,7 @@ odp_crypto_operation(odp_crypto_op_param_t *param,
int rc;
packet_param.session = param->session;
- packet_param.override_iv_ptr = param->override_iv_ptr;
+ packet_param.cipher_iv_ptr = param->cipher_iv_ptr;
packet_param.hash_result_offset = param->hash_result_offset;
packet_param.aad_ptr = param->aad_ptr;
packet_param.cipher_range = param->cipher_range;
@@ -477,7 +477,7 @@ static int ipsec_in_esp(odp_packet_t *pkt,
state->ip_hdr_len -
state->in.hdr_len -
ipsec_sa->icv_len;
- param->override_iv_ptr = state->iv;
+ param->cipher_iv_ptr = state->iv;
state->esp.aad.spi = esp.spi;
state->esp.aad.seq_no = esp.seq_no;
@@ -560,7 +560,7 @@ static int ipsec_in_ah(odp_packet_t *pkt,
return -1;
}
- param->override_iv_ptr = state->iv;
+ param->cipher_iv_ptr = state->iv;
state->in.hdr_len = (ah.ah_len + 2) * 4;
state->in.trl_len = 0;
@@ -1079,7 +1079,7 @@ static int ipsec_out_esp(odp_packet_t *pkt,
return -1;
}
- param->override_iv_ptr = state->iv;
+ param->cipher_iv_ptr = state->iv;
memset(&esp, 0, sizeof(esp));
esp.spi = odp_cpu_to_be_32(ipsec_sa->spi);
@@ -1229,7 +1229,7 @@ static int ipsec_out_ah(odp_packet_t *pkt,
return -1;
}
- param->override_iv_ptr = state->iv;
+ param->cipher_iv_ptr = state->iv;
if (odp_packet_extend_head(pkt, hdr_len, NULL, NULL) < 0) {
status->error.alg = 1;
@@ -78,7 +78,7 @@ static const char *cipher_alg_name(odp_cipher_alg_t cipher)
static int alg_op(odp_packet_t pkt,
odp_bool_t *ok,
odp_crypto_session_t session,
- uint8_t *op_iv_ptr,
+ uint8_t *cipher_iv_ptr,
odp_packet_data_range_t *cipher_range,
odp_packet_data_range_t *auth_range,
uint8_t *aad,
@@ -99,8 +99,8 @@ static int alg_op(odp_packet_t pkt,
op_params.cipher_range = *cipher_range;
op_params.auth_range = *auth_range;
- if (op_iv_ptr)
- op_params.override_iv_ptr = op_iv_ptr;
+ if (cipher_iv_ptr)
+ op_params.cipher_iv_ptr = cipher_iv_ptr;
op_params.aad_ptr = aad;
@@ -153,7 +153,7 @@ static int alg_op(odp_packet_t pkt,
static int alg_packet_op(odp_packet_t pkt,
odp_bool_t *ok,
odp_crypto_session_t session,
- uint8_t *op_iv_ptr,
+ uint8_t *cipher_iv_ptr,
odp_packet_data_range_t *cipher_range,
odp_packet_data_range_t *auth_range,
uint8_t *aad,
@@ -171,8 +171,8 @@ static int alg_packet_op(odp_packet_t pkt,
op_params.cipher_range = *cipher_range;
op_params.auth_range = *auth_range;
- if (op_iv_ptr)
- op_params.override_iv_ptr = op_iv_ptr;
+ if (cipher_iv_ptr)
+ op_params.cipher_iv_ptr = cipher_iv_ptr;
op_params.aad_ptr = aad;
@@ -210,7 +210,7 @@ static int alg_packet_op(odp_packet_t pkt,
static int alg_packet_op_enq(odp_packet_t pkt,
odp_bool_t *ok,
odp_crypto_session_t session,
- uint8_t *op_iv_ptr,
+ uint8_t *cipher_iv_ptr,
odp_packet_data_range_t *cipher_range,
odp_packet_data_range_t *auth_range,
uint8_t *aad,
@@ -229,8 +229,8 @@ static int alg_packet_op_enq(odp_packet_t pkt,
op_params.cipher_range = *cipher_range;
op_params.auth_range = *auth_range;
- if (op_iv_ptr)
- op_params.override_iv_ptr = op_iv_ptr;
+ if (cipher_iv_ptr)
+ op_params.cipher_iv_ptr = cipher_iv_ptr;
op_params.aad_ptr = aad;