This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, next has been updated via e4842694a95771c87694aedae015669427bf2b21 (commit) via 28c81e87089e43692ead705cee56da2513c309b2 (commit) via c397d62bf8b29162e59d8796f10c87ebe5f37168 (commit) via bae3d1f5adbaba5f798b1e08d744f96bab1b6964 (commit) from 5a58bbf2bb331fd7dde2ebbc0430634ace6900fb (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit e4842694a95771c87694aedae015669427bf2b21 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Tue Dec 19 19:58:00 2017 +0300
linux-gen: crypto, ipsec: use auth_iv
Separate handling of authentication IV data.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 71140863..62e3a75a 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -35,9 +35,7 @@ * Keep sorted: first by key length, then by IV length */ static const odp_crypto_cipher_capability_t cipher_capa_null[] = { -{.key_len = 0, .iv_len = 0}, -/* Special case for GMAC */ -{.key_len = 0, .iv_len = 12} }; +{.key_len = 0, .iv_len = 0} };
static const odp_crypto_cipher_capability_t cipher_capa_trides_cbc[] = { {.key_len = 24, .iv_len = 8} }; @@ -85,7 +83,8 @@ static const odp_crypto_auth_capability_t auth_capa_aes_gcm[] = { {.digest_len = 16, .key_len = 0, .aad_len = {.min = 8, .max = 12, .inc = 4} } };
static const odp_crypto_auth_capability_t auth_capa_aes_gmac[] = { -{.digest_len = 16, .key_len = 16, .aad_len = {.min = 0, .max = 0, .inc = 0} } }; +{.digest_len = 16, .key_len = 16, .aad_len = {.min = 0, .max = 0, .inc = 0}, + .iv_len = 12 } };
/** Forward declaration of session structure */ typedef struct odp_crypto_generic_session_t odp_crypto_generic_session_t; @@ -122,6 +121,7 @@ struct odp_crypto_generic_session_t {
struct { uint8_t key[EVP_MAX_KEY_LENGTH]; + uint8_t iv_data[EVP_MAX_IV_LENGTH]; uint32_t key_length; uint32_t bytes; union { @@ -710,10 +710,10 @@ odp_crypto_alg_err_t aes_gmac_gen(odp_packet_t pkt, uint8_t block[EVP_MAX_MD_SIZE]; int ret;
- if (param->cipher_iv_ptr) - iv_ptr = param->cipher_iv_ptr; - else if (session->p.cipher_iv.data) - iv_ptr = session->cipher.iv_data; + if (param->auth_iv_ptr) + iv_ptr = param->auth_iv_ptr; + else if (session->p.auth_iv.data) + iv_ptr = session->auth.iv_data; else return ODP_CRYPTO_ALG_ERR_IV_INVALID;
@@ -752,10 +752,10 @@ odp_crypto_alg_err_t aes_gmac_check(odp_packet_t pkt, uint8_t block[EVP_MAX_MD_SIZE]; int ret;
- if (param->cipher_iv_ptr) - iv_ptr = param->cipher_iv_ptr; - else if (session->p.cipher_iv.data) - iv_ptr = session->cipher.iv_data; + if (param->auth_iv_ptr) + iv_ptr = param->auth_iv_ptr; + else if (session->p.auth_iv.data) + iv_ptr = session->auth.iv_data; else return ODP_CRYPTO_ALG_ERR_IV_INVALID;
@@ -976,11 +976,21 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, goto err; }
+ if (session->p.auth_iv.length > EVP_MAX_IV_LENGTH) { + ODP_DBG("Maximum auth IV length exceeded\n"); + *status = ODP_CRYPTO_SES_CREATE_ERR_INV_CIPHER; + goto err; + } + /* Copy IV data */ if (session->p.cipher_iv.data) memcpy(session->cipher.iv_data, session->p.cipher_iv.data, session->p.cipher_iv.length);
+ if (session->p.auth_iv.data) + memcpy(session->auth.iv_data, session->p.auth_iv.data, + session->p.auth_iv.length); + /* Derive order */ if (ODP_CRYPTO_OP_ENCODE == param->op) session->do_cipher_first = param->auth_cipher_text; @@ -1172,6 +1182,7 @@ odp_crypto_operation(odp_crypto_op_param_t *param,
packet_param.session = param->session; packet_param.cipher_iv_ptr = param->cipher_iv_ptr; + packet_param.auth_iv_ptr = param->auth_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; diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index 2a01ccd1..98af98c6 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -480,6 +480,7 @@ static int ipsec_in_esp(odp_packet_t *pkt, state->in.hdr_len - ipsec_sa->icv_len; param->cipher_iv_ptr = state->iv; + param->auth_iv_ptr = state->iv;
state->esp.aad.spi = esp.spi; state->esp.aad.seq_no = esp.seq_no; @@ -562,7 +563,7 @@ static int ipsec_in_ah(odp_packet_t *pkt, return -1; }
- param->cipher_iv_ptr = state->iv; + param->auth_iv_ptr = state->iv;
state->in.hdr_len = (ah.ah_len + 2) * 4; state->in.trl_len = 0; @@ -1082,6 +1083,7 @@ static int ipsec_out_esp(odp_packet_t *pkt, }
param->cipher_iv_ptr = state->iv; + param->auth_iv_ptr = state->iv;
memset(&esp, 0, sizeof(esp)); esp.spi = _odp_cpu_to_be_32(ipsec_sa->spi); @@ -1231,7 +1233,7 @@ static int ipsec_out_ah(odp_packet_t *pkt, return -1; }
- param->cipher_iv_ptr = state->iv; + param->auth_iv_ptr = state->iv;
if (odp_packet_extend_head(pkt, hdr_len, NULL, NULL) < 0) { status->error.alg = 1; diff --git a/platform/linux-generic/odp_ipsec_sad.c b/platform/linux-generic/odp_ipsec_sad.c index 53dc0943..64507d2a 100644 --- a/platform/linux-generic/odp_ipsec_sad.c +++ b/platform/linux-generic/odp_ipsec_sad.c @@ -420,7 +420,7 @@ odp_ipsec_sa_t odp_ipsec_sa_create(const odp_ipsec_sa_param_t *param) ipsec_sa->use_counter_iv = 1; ipsec_sa->esp_iv_len = 8; ipsec_sa->esp_block_len = 16; - crypto_param.cipher_iv.length = 12; + crypto_param.auth_iv.length = 12; break; default: break;
commit 28c81e87089e43692ead705cee56da2513c309b2 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Tue Dec 19 19:47:54 2017 +0300
api: crypto: add separate auth IV
GMAC auth algorithm requires IV to work. Instead of hacking the ODP_CIPHER_ALG_NULL iv to include value for ODP_AUTH_ALG_GMAC, provide separate iv (in auth capability, session params and operation params).
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 6688879a..d2a1d1dd 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -333,6 +333,9 @@ typedef struct odp_crypto_session_param_t { */ odp_crypto_key_t auth_key;
+ /** Authentication Initialization Vector (IV) */ + odp_crypto_iv_t auth_iv; + /** Authentication digest length in bytes * * Use odp_crypto_auth_capability() for supported digest lengths. @@ -408,6 +411,9 @@ typedef struct odp_crypto_op_param_t { uint8_t *cipher_iv_ptr; };
+ /** Override session authentication IV pointer */ + uint8_t *auth_iv_ptr; + /** Offset from start of packet for hash result * * Specifies the offset where the hash result is to be stored. In case @@ -449,6 +455,9 @@ typedef struct odp_crypto_packet_op_param_t { uint8_t *cipher_iv_ptr; };
+ /** Override session IV pointer for authentication */ + uint8_t *auth_iv_ptr; + /** Offset from start of packet for hash result * * Specifies the offset where the hash result is to be stored. In case @@ -614,6 +623,9 @@ typedef struct odp_crypto_auth_capability_t { /** Key length in bytes */ uint32_t key_len;
+ /** IV length in bytes */ + uint32_t iv_len; + /** Additional Authenticated Data (AAD) lengths */ struct { /** Minimum AAD length in bytes */
commit c397d62bf8b29162e59d8796f10c87ebe5f37168 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Jan 4 01:05:53 2018 +0300
api: crypto: use cipher_iv_ptr instead of override_iv_ptr
In preparation to add auth-specific IV, rename override_iv_ptr field to ciper_iv_ptr. Provide deprecated compatibility field override_iv_ptr.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index 001f5208..c0978d0d 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -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 */ diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 102d1a2e..6688879a 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -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 * diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 8e6e1a43..71140863 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -483,8 +483,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 @@ -517,8 +517,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 @@ -588,8 +588,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 @@ -638,8 +638,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 @@ -710,8 +710,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 @@ -752,8 +752,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 @@ -1171,7 +1171,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; diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index 0ef8b88a..2a01ccd1 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -479,7 +479,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; @@ -562,7 +562,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; @@ -1081,7 +1081,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); @@ -1231,7 +1231,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; diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index 526057c7..9398c5da 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -79,7 +79,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, @@ -100,8 +100,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;
@@ -154,7 +154,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, @@ -172,8 +172,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;
@@ -211,7 +211,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, @@ -230,8 +230,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;
commit bae3d1f5adbaba5f798b1e08d744f96bab1b6964 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Jan 4 01:05:53 2018 +0300
api: crypto: use cipher_iv instead of iv in session params
In preparation to add auth-specific IV, rename iv field to ciper_iv. Provide deprecated compatibility field iv.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/example/ipsec/odp_ipsec_cache.c b/example/ipsec/odp_ipsec_cache.c index bd4c1eab..220df782 100644 --- a/example/ipsec/odp_ipsec_cache.c +++ b/example/ipsec/odp_ipsec_cache.c @@ -92,13 +92,13 @@ int create_ipsec_cache_entry(sa_db_entry_t *cipher_sa, params.cipher_alg = cipher_sa->alg.u.cipher; params.cipher_key.data = cipher_sa->key.data; params.cipher_key.length = cipher_sa->key.length; - params.iv.data = entry->state.iv; - params.iv.length = cipher_sa->iv_len; + params.cipher_iv.data = entry->state.iv; + params.cipher_iv.length = cipher_sa->iv_len; mode = cipher_sa->mode; } else { params.cipher_alg = ODP_CIPHER_ALG_NULL; - params.iv.data = NULL; - params.iv.length = 0; + params.cipher_iv.data = NULL; + params.cipher_iv.length = 0; }
/* Auth */ @@ -113,10 +113,10 @@ int create_ipsec_cache_entry(sa_db_entry_t *cipher_sa, }
/* Generate an IV */ - if (params.iv.length) { - int32_t size = params.iv.length; + if (params.cipher_iv.length) { + int32_t size = params.cipher_iv.length;
- int32_t ret = odp_random_data(params.iv.data, size, 1); + int32_t ret = odp_random_data(params.cipher_iv.data, size, 1); if (ret != size) return -1; } diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 4fa7a1c9..102d1a2e 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -313,7 +313,13 @@ typedef struct odp_crypto_session_param_t { odp_crypto_key_t cipher_key;
/** Cipher Initialization Vector (IV) */ - odp_crypto_iv_t iv; + union { + /** @deprecated Use cipher_iv */ + odp_crypto_iv_t ODP_DEPRECATE(iv); + + /** Cipher Initialization Vector (IV) */ + odp_crypto_iv_t cipher_iv; + };
/** Authentication algorithm * diff --git a/platform/linux-generic/odp_crypto.c b/platform/linux-generic/odp_crypto.c index 325a9d06..8e6e1a43 100644 --- a/platform/linux-generic/odp_crypto.c +++ b/platform/linux-generic/odp_crypto.c @@ -485,7 +485,7 @@ odp_crypto_alg_err_t cipher_encrypt(odp_packet_t pkt,
if (param->override_iv_ptr) iv_ptr = param->override_iv_ptr; - else if (session->p.iv.data) + else if (session->p.cipher_iv.data) iv_ptr = session->cipher.iv_data; else return ODP_CRYPTO_ALG_ERR_IV_INVALID; @@ -519,7 +519,7 @@ odp_crypto_alg_err_t cipher_decrypt(odp_packet_t pkt,
if (param->override_iv_ptr) iv_ptr = param->override_iv_ptr; - else if (session->p.iv.data) + else if (session->p.cipher_iv.data) iv_ptr = session->cipher.iv_data; else return ODP_CRYPTO_ALG_ERR_IV_INVALID; @@ -541,8 +541,9 @@ static int process_cipher_param(odp_crypto_generic_session_t *session, return -1;
/* Verify IV len is correct */ - if (!((0 == session->p.iv.length) || - ((uint32_t)EVP_CIPHER_iv_length(cipher) == session->p.iv.length))) + if (!((0 == session->p.cipher_iv.length) || + ((uint32_t)EVP_CIPHER_iv_length(cipher) == + session->p.cipher_iv.length))) return -1;
session->cipher.evp_cipher = cipher; @@ -570,7 +571,7 @@ aes_gcm_encrypt_init(odp_crypto_generic_session_t *session) EVP_EncryptInit_ex(ctx, session->cipher.evp_cipher, NULL, session->cipher.key_data, NULL); EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, - session->p.iv.length, NULL); + session->p.cipher_iv.length, NULL); EVP_CIPHER_CTX_set_padding(ctx, 0); }
@@ -589,7 +590,7 @@ odp_crypto_alg_err_t aes_gcm_encrypt(odp_packet_t pkt,
if (param->override_iv_ptr) iv_ptr = param->override_iv_ptr; - else if (session->p.iv.data) + else if (session->p.cipher_iv.data) iv_ptr = session->cipher.iv_data; else return ODP_CRYPTO_ALG_ERR_IV_INVALID; @@ -620,7 +621,7 @@ aes_gcm_decrypt_init(odp_crypto_generic_session_t *session) EVP_DecryptInit_ex(ctx, session->cipher.evp_cipher, NULL, session->cipher.key_data, NULL); EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, - session->p.iv.length, NULL); + session->p.cipher_iv.length, NULL); EVP_CIPHER_CTX_set_padding(ctx, 0); }
@@ -639,7 +640,7 @@ odp_crypto_alg_err_t aes_gcm_decrypt(odp_packet_t pkt,
if (param->override_iv_ptr) iv_ptr = param->override_iv_ptr; - else if (session->p.iv.data) + else if (session->p.cipher_iv.data) iv_ptr = session->cipher.iv_data; else return ODP_CRYPTO_ALG_ERR_IV_INVALID; @@ -695,7 +696,7 @@ aes_gmac_gen_init(odp_crypto_generic_session_t *session) EVP_EncryptInit_ex(ctx, session->auth.evp_cipher, NULL, session->auth.key, NULL); EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, - session->p.iv.length, NULL); + session->p.cipher_iv.length, NULL); EVP_CIPHER_CTX_set_padding(ctx, 0); }
@@ -711,7 +712,7 @@ odp_crypto_alg_err_t aes_gmac_gen(odp_packet_t pkt,
if (param->override_iv_ptr) iv_ptr = param->override_iv_ptr; - else if (session->p.iv.data) + else if (session->p.cipher_iv.data) iv_ptr = session->cipher.iv_data; else return ODP_CRYPTO_ALG_ERR_IV_INVALID; @@ -737,7 +738,7 @@ aes_gmac_check_init(odp_crypto_generic_session_t *session) EVP_DecryptInit_ex(ctx, session->auth.evp_cipher, NULL, session->auth.key, NULL); EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, - session->p.iv.length, NULL); + session->p.cipher_iv.length, NULL); EVP_CIPHER_CTX_set_padding(ctx, 0); }
@@ -753,7 +754,7 @@ odp_crypto_alg_err_t aes_gmac_check(odp_packet_t pkt,
if (param->override_iv_ptr) iv_ptr = param->override_iv_ptr; - else if (session->p.iv.data) + else if (session->p.cipher_iv.data) iv_ptr = session->cipher.iv_data; else return ODP_CRYPTO_ALG_ERR_IV_INVALID; @@ -969,16 +970,16 @@ odp_crypto_session_create(odp_crypto_session_param_t *param, /* Copy parameters */ session->p = *param;
- if (session->p.iv.length > EVP_MAX_IV_LENGTH) { + if (session->p.cipher_iv.length > EVP_MAX_IV_LENGTH) { ODP_DBG("Maximum IV length exceeded\n"); *status = ODP_CRYPTO_SES_CREATE_ERR_INV_CIPHER; goto err; }
/* Copy IV data */ - if (session->p.iv.data) - memcpy(session->cipher.iv_data, session->p.iv.data, - session->p.iv.length); + if (session->p.cipher_iv.data) + memcpy(session->cipher.iv_data, session->p.cipher_iv.data, + session->p.cipher_iv.length);
/* Derive order */ if (ODP_CRYPTO_OP_ENCODE == param->op) diff --git a/platform/linux-generic/odp_ipsec_sad.c b/platform/linux-generic/odp_ipsec_sad.c index 1a63858a..53dc0943 100644 --- a/platform/linux-generic/odp_ipsec_sad.c +++ b/platform/linux-generic/odp_ipsec_sad.c @@ -362,13 +362,13 @@ odp_ipsec_sa_t odp_ipsec_sa_create(const odp_ipsec_sa_param_t *param) crypto_param.auth_alg = param->crypto.auth_alg; crypto_param.auth_key = param->crypto.auth_key;
- crypto_param.iv.length = + crypto_param.cipher_iv.length = _odp_ipsec_cipher_iv_len(crypto_param.cipher_alg);
crypto_param.auth_digest_len = _odp_ipsec_auth_digest_len(crypto_param.auth_alg);
- if ((uint32_t)-1 == crypto_param.iv.length || + if ((uint32_t)-1 == crypto_param.cipher_iv.length || (uint32_t)-1 == crypto_param.auth_digest_len) goto error;
@@ -420,7 +420,7 @@ odp_ipsec_sa_t odp_ipsec_sa_create(const odp_ipsec_sa_param_t *param) ipsec_sa->use_counter_iv = 1; ipsec_sa->esp_iv_len = 8; ipsec_sa->esp_block_len = 16; - crypto_param.iv.length = 12; + crypto_param.cipher_iv.length = 12; break; default: break; diff --git a/test/performance/odp_crypto.c b/test/performance/odp_crypto.c index f6524bc6..1d598ebb 100644 --- a/test/performance/odp_crypto.c +++ b/test/performance/odp_crypto.c @@ -193,7 +193,7 @@ static crypto_alg_config_t algs_config[] = { .data = test_key24, .length = sizeof(test_key24) }, - .iv = { + .cipher_iv = { .data = test_iv, .length = 8, }, @@ -208,7 +208,7 @@ static crypto_alg_config_t algs_config[] = { .data = test_key24, .length = sizeof(test_key24) }, - .iv = { + .cipher_iv = { .data = test_iv, .length = 8, }, @@ -240,7 +240,7 @@ static crypto_alg_config_t algs_config[] = { .data = test_key16, .length = sizeof(test_key16) }, - .iv = { + .cipher_iv = { .data = test_iv, .length = 16, }, @@ -255,7 +255,7 @@ static crypto_alg_config_t algs_config[] = { .data = test_key16, .length = sizeof(test_key16) }, - .iv = { + .cipher_iv = { .data = test_iv, .length = 16, }, @@ -287,7 +287,7 @@ static crypto_alg_config_t algs_config[] = { .data = test_key16, .length = sizeof(test_key16) }, - .iv = { + .cipher_iv = { .data = test_iv, .length = 12, }, diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index ec477535..526057c7 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -315,9 +315,9 @@ static void alg_test(odp_crypto_op_t op, .data = ref->auth_key, .length = ref->auth_key_length }; - odp_crypto_iv_t iv = { - .data = ovr_iv ? NULL : ref->iv, - .length = ref->iv_length + odp_crypto_iv_t cipher_iv = { + .data = ovr_iv ? NULL : ref->cipher_iv, + .length = ref->cipher_iv_length };
/* Create a crypto session */ @@ -331,7 +331,7 @@ static void alg_test(odp_crypto_op_t op, ses_params.compl_queue = suite_context.queue; ses_params.output_pool = suite_context.pool; ses_params.cipher_key = cipher_key; - ses_params.iv = iv; + ses_params.cipher_iv = cipher_iv; ses_params.auth_key = auth_key; ses_params.auth_digest_len = ref->digest_length; ses_params.auth_aad_len = ref->aad_length; @@ -381,17 +381,17 @@ static void alg_test(odp_crypto_op_t op,
if (!suite_context.packet) rc = alg_op(pkt, &ok, session, - ovr_iv ? ref->iv : NULL, + ovr_iv ? ref->cipher_iv : NULL, &cipher_range, &auth_range, ref->aad, ref->length); else if (ODP_CRYPTO_ASYNC == suite_context.op_mode) rc = alg_packet_op_enq(pkt, &ok, session, - ovr_iv ? ref->iv : NULL, + ovr_iv ? ref->cipher_iv : NULL, &cipher_range, &auth_range, ref->aad, ref->length); else rc = alg_packet_op(pkt, &ok, session, - ovr_iv ? ref->iv : NULL, + ovr_iv ? ref->cipher_iv : NULL, &cipher_range, &auth_range, ref->aad, ref->length); if (rc < 0) @@ -518,7 +518,7 @@ static void check_alg(odp_crypto_op_t op, if (cipher_capa[i].key_len == ref[idx].cipher_key_length && cipher_capa[i].iv_len == - ref[idx].iv_length) { + ref[idx].cipher_iv_length) { cipher_idx = i; break; } @@ -529,7 +529,7 @@ static void check_alg(odp_crypto_op_t op, ", iv_len=%" PRIu32 "\n", cipher_alg_name(cipher_alg), ref[idx].cipher_key_length, - ref[idx].iv_length); + ref[idx].cipher_iv_length); continue; }
diff --git a/test/validation/api/crypto/test_vectors.h b/test/validation/api/crypto/test_vectors.h index 6592a335..195f9ce5 100644 --- a/test/validation/api/crypto/test_vectors.h +++ b/test/validation/api/crypto/test_vectors.h @@ -14,8 +14,8 @@ typedef struct crypto_test_reference_s { uint8_t cipher_key[MAX_KEY_LEN]; uint32_t auth_key_length; uint8_t auth_key[MAX_KEY_LEN]; - uint32_t iv_length; - uint8_t iv[MAX_IV_LEN]; + uint32_t cipher_iv_length; + uint8_t cipher_iv[MAX_IV_LEN]; uint32_t length; uint8_t plaintext[MAX_DATA_LEN]; uint8_t ciphertext[MAX_DATA_LEN]; @@ -49,8 +49,8 @@ static crypto_test_reference_t tdes_cbc_reference[] = { .cipher_key = { 0x62, 0x7f, 0x46, 0x0e, 0x08, 0x10, 0x4a, 0x10, 0x43, 0xcd, 0x26, 0x5d, 0x58, 0x40, 0xea, 0xf1, 0x31, 0x3e, 0xdf, 0x97, 0xdf, 0x2a, 0x8a, 0x8c}, - .iv_length = TDES_CBC_IV_LEN, - .iv = { 0x8e, 0x29, 0xf7, 0x5e, 0xa7, 0x7e, 0x54, 0x75 }, + .cipher_iv_length = TDES_CBC_IV_LEN, + .cipher_iv = { 0x8e, 0x29, 0xf7, 0x5e, 0xa7, 0x7e, 0x54, 0x75 }, .length = 8, .plaintext = { 0x32, 0x6a, 0x49, 0x4c, 0xd3, 0x3f, 0xe7, 0x56 }, .ciphertext = { 0xb2, 0x2b, 0x8d, 0x66, 0xde, 0x97, 0x06, 0x92 } @@ -60,8 +60,8 @@ static crypto_test_reference_t tdes_cbc_reference[] = { .cipher_key = { 0x37, 0xae, 0x5e, 0xbf, 0x46, 0xdf, 0xf2, 0xdc, 0x07, 0x54, 0xb9, 0x4f, 0x31, 0xcb, 0xb3, 0x85, 0x5e, 0x7f, 0xd3, 0x6d, 0xc8, 0x70, 0xbf, 0xae}, - .iv_length = TDES_CBC_IV_LEN, - .iv = {0x3d, 0x1d, 0xe3, 0xcc, 0x13, 0x2e, 0x3b, 0x65 }, + .cipher_iv_length = TDES_CBC_IV_LEN, + .cipher_iv = {0x3d, 0x1d, 0xe3, 0xcc, 0x13, 0x2e, 0x3b, 0x65 }, .length = 16, .plaintext = { 0x84, 0x40, 0x1f, 0x78, 0xfe, 0x6c, 0x10, 0x87, 0x6d, 0x8e, 0xa2, 0x30, 0x94, 0xea, 0x53, 0x09 }, @@ -75,9 +75,9 @@ static crypto_test_reference_t aes_cbc_reference[] = { .cipher_key_length = AES128_CBC_KEY_LEN, .cipher_key = { 0x06, 0xa9, 0x21, 0x40, 0x36, 0xb8, 0xa1, 0x5b, 0x51, 0x2e, 0x03, 0xd5, 0x34, 0x12, 0x00, 0x06}, - .iv_length = AES_CBC_IV_LEN, - .iv = { 0x3d, 0xaf, 0xba, 0x42, 0x9d, 0x9e, 0xb4, 0x30, - 0xb4, 0x22, 0xda, 0x80, 0x2c, 0x9f, 0xac, 0x41 }, + .cipher_iv_length = AES_CBC_IV_LEN, + .cipher_iv = { 0x3d, 0xaf, 0xba, 0x42, 0x9d, 0x9e, 0xb4, 0x30, + 0xb4, 0x22, 0xda, 0x80, 0x2c, 0x9f, 0xac, 0x41 }, .length = 16, .plaintext = "Single block msg", .ciphertext = { 0xe3, 0x53, 0x77, 0x9c, 0x10, 0x79, 0xae, 0xb8, @@ -87,9 +87,9 @@ static crypto_test_reference_t aes_cbc_reference[] = { .cipher_key_length = AES128_CBC_KEY_LEN, .cipher_key = { 0xc2, 0x86, 0x69, 0x6d, 0x88, 0x7c, 0x9a, 0xa0, 0x61, 0x1b, 0xbb, 0x3e, 0x20, 0x25, 0xa4, 0x5a}, - .iv_length = AES_CBC_IV_LEN, - .iv = { 0x56, 0x2e, 0x17, 0x99, 0x6d, 0x09, 0x3d, 0x28, - 0xdd, 0xb3, 0xba, 0x69, 0x5a, 0x2e, 0x6f, 0x58 }, + .cipher_iv_length = AES_CBC_IV_LEN, + .cipher_iv = { 0x56, 0x2e, 0x17, 0x99, 0x6d, 0x09, 0x3d, 0x28, + 0xdd, 0xb3, 0xba, 0x69, 0x5a, 0x2e, 0x6f, 0x58 }, .length = 32, .plaintext = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, @@ -104,9 +104,9 @@ static crypto_test_reference_t aes_cbc_reference[] = { .cipher_key_length = AES128_CBC_KEY_LEN, .cipher_key = { 0x6c, 0x3e, 0xa0, 0x47, 0x76, 0x30, 0xce, 0x21, 0xa2, 0xce, 0x33, 0x4a, 0xa7, 0x46, 0xc2, 0xcd}, - .iv_length = AES_CBC_IV_LEN, - .iv = { 0xc7, 0x82, 0xdc, 0x4c, 0x09, 0x8c, 0x66, 0xcb, - 0xd9, 0xcd, 0x27, 0xd8, 0x25, 0x68, 0x2c, 0x81 }, + .cipher_iv_length = AES_CBC_IV_LEN, + .cipher_iv = { 0xc7, 0x82, 0xdc, 0x4c, 0x09, 0x8c, 0x66, 0xcb, + 0xd9, 0xcd, 0x27, 0xd8, 0x25, 0x68, 0x2c, 0x81 }, .length = 48, .plaintext = "This is a 48-byte message (exactly 3 AES blocks)", .ciphertext = { 0xd0, 0xa0, 0x2b, 0x38, 0x36, 0x45, 0x17, 0x53, @@ -120,9 +120,9 @@ static crypto_test_reference_t aes_cbc_reference[] = { .cipher_key_length = AES128_CBC_KEY_LEN, .cipher_key = { 0x56, 0xe4, 0x7a, 0x38, 0xc5, 0x59, 0x89, 0x74, 0xbc, 0x46, 0x90, 0x3d, 0xba, 0x29, 0x03, 0x49}, - .iv_length = AES_CBC_IV_LEN, - .iv = { 0x8c, 0xe8, 0x2e, 0xef, 0xbe, 0xa0, 0xda, 0x3c, - 0x44, 0x69, 0x9e, 0xd7, 0xdb, 0x51, 0xb7, 0xd9 }, + .cipher_iv_length = AES_CBC_IV_LEN, + .cipher_iv = { 0x8c, 0xe8, 0x2e, 0xef, 0xbe, 0xa0, 0xda, 0x3c, + 0x44, 0x69, 0x9e, 0xd7, 0xdb, 0x51, 0xb7, 0xd9 }, .length = 64, .plaintext = { 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, @@ -146,9 +146,9 @@ static crypto_test_reference_t aes_cbc_reference[] = { .cipher_key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c}, - .iv_length = AES_CBC_IV_LEN, - .iv = { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, - 0xde, 0xca, 0xf8, 0x88, 0x01, 0x23, 0x45, 0x67 }, + .cipher_iv_length = AES_CBC_IV_LEN, + .cipher_iv = { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, + 0xde, 0xca, 0xf8, 0x88, 0x01, 0x23, 0x45, 0x67 }, .length = 32, .plaintext = { 0x45, 0x00, 0x00, 0x28, 0xa4, 0xad, 0x40, 0x00, 0x40, 0x06, 0x78, 0x80, 0x0a, 0x01, 0x03, 0x8f, @@ -165,9 +165,9 @@ static crypto_test_reference_t aes_cbc_reference[] = { 0x34, 0x45, 0x56, 0x67, 0x78, 0x89, 0x9a, 0xab, 0xab, 0xbc, 0xcd, 0xde, 0xf0, 0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78, 0x89, 0x9a, 0xab}, - .iv_length = AES_CBC_IV_LEN, - .iv = { 0x11, 0x22, 0x33, 0x44, 0x01, 0x02, 0x03, 0x04, - 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c }, + .cipher_iv_length = AES_CBC_IV_LEN, + .cipher_iv = { 0x11, 0x22, 0x33, 0x44, 0x01, 0x02, 0x03, 0x04, + 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c }, .length = 48, .plaintext = { 0x45, 0x00, 0x00, 0x30, 0x69, 0xa6, 0x40, 0x00, 0x80, 0x06, 0x26, 0x90, 0xc0, 0xa8, 0x01, 0x02, @@ -189,9 +189,9 @@ static crypto_test_reference_t aes_ctr_reference[] = { .cipher_key_length = AES128_CTR_KEY_LEN, .cipher_key = { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c}, - .iv_length = AES_CTR_IV_LEN, - .iv = { 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }, + .cipher_iv_length = AES_CTR_IV_LEN, + .cipher_iv = { 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }, .length = 64, .plaintext = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, @@ -215,9 +215,9 @@ static crypto_test_reference_t aes_ctr_reference[] = { .cipher_key = { 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52, 0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5, 0x62, 0xf8, 0xea, 0xd2, 0x52, 0x2c, 0x6b, 0x7b}, - .iv_length = AES_CTR_IV_LEN, - .iv = { 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }, + .cipher_iv_length = AES_CTR_IV_LEN, + .cipher_iv = { 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }, .length = 64, .plaintext = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, @@ -242,9 +242,9 @@ static crypto_test_reference_t aes_ctr_reference[] = { 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, 0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4}, - .iv_length = AES_CTR_IV_LEN, - .iv = { 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, - 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }, + .cipher_iv_length = AES_CTR_IV_LEN, + .cipher_iv = { 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }, .length = 64, .plaintext = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, @@ -273,9 +273,9 @@ static crypto_test_reference_t aes_gcm_reference[] = { .cipher_key_length = AES128_GCM_KEY_LEN, .cipher_key = { 0x4c, 0x80, 0xcd, 0xef, 0xbb, 0x5d, 0x10, 0xda, 0x90, 0x6a, 0xc7, 0x3c, 0x36, 0x13, 0xa6, 0x34}, - .iv_length = AES_GCM_IV_LEN, - .iv = { 0x2e, 0x44, 0x3b, 0x68, 0x49, 0x56, 0xed, 0x7e, - 0x3b, 0x24, 0x4c, 0xfe }, + .cipher_iv_length = AES_GCM_IV_LEN, + .cipher_iv = { 0x2e, 0x44, 0x3b, 0x68, 0x49, 0x56, 0xed, 0x7e, + 0x3b, 0x24, 0x4c, 0xfe }, .length = 72, .plaintext = { 0x45, 0x00, 0x00, 0x48, 0x69, 0x9a, 0x00, 0x00, 0x80, 0x11, 0x4d, 0xb7, 0xc0, 0xa8, 0x01, 0x02, @@ -306,9 +306,9 @@ static crypto_test_reference_t aes_gcm_reference[] = { .cipher_key_length = AES128_GCM_KEY_LEN, .cipher_key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08}, - .iv_length = AES_GCM_IV_LEN, - .iv = { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, - 0xde, 0xca, 0xf8, 0x88 }, + .cipher_iv_length = AES_GCM_IV_LEN, + .cipher_iv = { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, + 0xde, 0xca, 0xf8, 0x88 }, .length = 64, .plaintext = { 0x45, 0x00, 0x00, 0x3e, 0x69, 0x8f, 0x00, 0x00, 0x80, 0x11, 0x4d, 0xcc, 0xc0, 0xa8, 0x01, 0x02, @@ -336,9 +336,9 @@ static crypto_test_reference_t aes_gcm_reference[] = { .cipher_key_length = AES128_GCM_KEY_LEN, .cipher_key = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, - .iv_length = AES_GCM_IV_LEN, - .iv = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 }, + .cipher_iv_length = AES_GCM_IV_LEN, + .cipher_iv = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }, .length = 64, .plaintext = { 0x45, 0x00, 0x00, 0x3c, 0x99, 0xc5, 0x00, 0x00, 0x80, 0x01, 0xcb, 0x7a, 0x40, 0x67, 0x93, 0x18, @@ -366,9 +366,9 @@ static crypto_test_reference_t aes_gcm_reference[] = { .cipher_key_length = AES128_GCM_KEY_LEN, .cipher_key = { 0x3d, 0xe0, 0x98, 0x74, 0xb3, 0x88, 0xe6, 0x49, 0x19, 0x88, 0xd0, 0xc3, 0x60, 0x7e, 0xae, 0x1f}, - .iv_length = AES_GCM_IV_LEN, - .iv = { 0x57, 0x69, 0x0e, 0x43, 0x4e, 0x28, 0x00, 0x00, - 0xa2, 0xfc, 0xa1, 0xa3 }, + .cipher_iv_length = AES_GCM_IV_LEN, + .cipher_iv = { 0x57, 0x69, 0x0e, 0x43, 0x4e, 0x28, 0x00, 0x00, + 0xa2, 0xfc, 0xa1, 0xa3 }, .length = 28, .plaintext = { 0x45, 0x00, 0x00, 0x1c, 0x42, 0xa2, 0x00, 0x00, 0x80, 0x01, 0x44, 0x1f, 0x40, 0x67, 0x93, 0xb6, @@ -390,9 +390,9 @@ static crypto_test_reference_t aes_gcm_reference[] = { .cipher_key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c}, - .iv_length = AES_GCM_IV_LEN, - .iv = { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, - 0xde, 0xca, 0xf8, 0x88 }, + .cipher_iv_length = AES_GCM_IV_LEN, + .cipher_iv = { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, + 0xde, 0xca, 0xf8, 0x88 }, .length = 40, .plaintext = { 0x45, 0x00, 0x00, 0x28, 0xa4, 0xad, 0x40, 0x00, 0x40, 0x06, 0x78, 0x80, 0x0a, 0x01, 0x03, 0x8f, @@ -416,9 +416,9 @@ static crypto_test_reference_t aes_gcm_reference[] = { 0x34, 0x45, 0x56, 0x67, 0x78, 0x89, 0x9a, 0xab, 0xab, 0xbc, 0xcd, 0xde, 0xf0, 0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78, 0x89, 0x9a, 0xab}, - .iv_length = AES_GCM_IV_LEN, - .iv = { 0x11, 0x22, 0x33, 0x44, 0x01, 0x02, 0x03, 0x04, 0x05, - 0x06, 0x07, 0x08 }, + .cipher_iv_length = AES_GCM_IV_LEN, + .cipher_iv = { 0x11, 0x22, 0x33, 0x44, 0x01, 0x02, 0x03, 0x04, + 0x05, 0x06, 0x07, 0x08 }, .length = 52, .plaintext = { 0x45, 0x00, 0x00, 0x30, 0x69, 0xa6, 0x40, 0x00, 0x80, 0x06, 0x26, 0x90, 0xc0, 0xa8, 0x01, 0x02, @@ -447,9 +447,9 @@ static crypto_test_reference_t aes_gmac_reference[] = { .auth_key_length = AES128_GCM_KEY_LEN, .auth_key = { 0x4c, 0x80, 0xcd, 0xef, 0xbb, 0x5d, 0x10, 0xda, 0x90, 0x6a, 0xc7, 0x3c, 0x36, 0x13, 0xa6, 0x34}, - .iv_length = AES_GCM_IV_LEN, - .iv = { 0x22, 0x43, 0x3c, 0x64, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 }, + .cipher_iv_length = AES_GCM_IV_LEN, + .cipher_iv = { 0x22, 0x43, 0x3c, 0x64, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }, .length = 68, .plaintext = { 0x00, 0x00, 0x43, 0x21, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-----------------------------------------------------------------------
Summary of changes: example/ipsec/odp_ipsec.c | 2 +- example/ipsec/odp_ipsec_cache.c | 14 +-- include/odp/api/spec/crypto.h | 38 ++++++-- platform/linux-generic/odp_crypto.c | 82 +++++++++-------- platform/linux-generic/odp_ipsec.c | 10 ++- platform/linux-generic/odp_ipsec_sad.c | 6 +- test/performance/odp_crypto.c | 10 +-- test/validation/api/crypto/odp_crypto_test_inp.c | 36 ++++---- test/validation/api/crypto/test_vectors.h | 108 +++++++++++------------ 9 files changed, 174 insertions(+), 132 deletions(-)
hooks/post-receive