diff options
-rw-r--r-- | include/odp/api/spec/crypto.h | 27 | ||||
-rw-r--r-- | include/odp/api/spec/crypto_types.h | 26 |
2 files changed, 34 insertions, 19 deletions
diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h index 4292b78c1..d9265c57e 100644 --- a/include/odp/api/spec/crypto.h +++ b/include/odp/api/spec/crypto.h @@ -259,17 +259,28 @@ odp_event_t odp_crypto_packet_to_event(odp_packet_t pkt); /** * Get crypto operation results from a crypto processed packet * - * Successful crypto operations of all types (SYNC and ASYNC) produce packets - * which contain crypto result metadata. This function copies the operation - * results from a crypto processed packet. Event subtype of this kind of - * packet is ODP_EVENT_PACKET_CRYPTO. Results are undefined if a non-crypto - * processed packet is passed as input. + * Crypto operations of all types (SYNC and ASYNC) produce packets which + * contain crypto result metadata. This function returns success status + * of the crypto operation that was applied to a packet and optionally + * writes additional information in a result structure. + * + * If the crypto operation succeeded, zero is returned and the values + * written in the cipher_status and auth_status fields of the result + * structure have undefined values. + * + * If the crypto operation failed, -1 is returned and the cipher_status + * and auth_status fields of the result structure indicate the reason for + * the failure. + * + * The subtype of the passed packet must be ODP_EVENT_PACKET_CRYPTO, + * otherwise the result of the call is undefined. * * @param packet A crypto processed packet (ODP_EVENT_PACKET_CRYPTO) - * @param[out] result Pointer to operation result for output + * @param[out] result Pointer to operation result for output or NULL * - * @retval 0 On success - * @retval <0 On failure + * @retval 0 Crypto operation succeeded + * @retval -1 Crypto operation failed + * @retval <-1 Failed to get crypto operation status of the packet */ int odp_crypto_result(odp_crypto_packet_result_t *result, odp_packet_t packet); diff --git a/include/odp/api/spec/crypto_types.h b/include/odp/api/spec/crypto_types.h index ae232db78..24b9fbbfd 100644 --- a/include/odp/api/spec/crypto_types.h +++ b/include/odp/api/spec/crypto_types.h @@ -897,14 +897,16 @@ typedef enum { typedef enum { /** Algorithm successful */ ODP_CRYPTO_ALG_ERR_NONE, - /** Invalid data block size */ + /** Invalid range or packet size */ ODP_CRYPTO_ALG_ERR_DATA_SIZE, /** Key size invalid for algorithm */ - ODP_CRYPTO_ALG_ERR_KEY_SIZE, + ODP_DEPRECATE(ODP_CRYPTO_ALG_ERR_KEY_SIZE), /** Computed ICV value mismatch */ ODP_CRYPTO_ALG_ERR_ICV_CHECK, /** IV value not specified */ - ODP_CRYPTO_ALG_ERR_IV_INVALID, + ODP_DEPRECATE(ODP_CRYPTO_ALG_ERR_IV_INVALID), + /** Other error */ + ODP_CRYPTO_ALG_ERR_OTHER, } odp_crypto_alg_err_t; /** @@ -912,12 +914,12 @@ typedef enum { */ typedef enum { /** Operation completed successfully */ - ODP_CRYPTO_HW_ERR_NONE, + ODP_DEPRECATE(ODP_CRYPTO_HW_ERR_NONE), /** Error detected during DMA of data */ - ODP_CRYPTO_HW_ERR_DMA, + ODP_DEPRECATE(ODP_CRYPTO_HW_ERR_DMA), /** Operation failed due to pool depletion */ - ODP_CRYPTO_HW_ERR_BP_DEPLETED, -} odp_crypto_hw_err_t; + ODP_DEPRECATE(ODP_CRYPTO_HW_ERR_BP_DEPLETED), +} ODP_DEPRECATE(odp_crypto_hw_err_t); /** * Cryto API per packet operation completion status @@ -927,8 +929,7 @@ typedef struct odp_crypto_op_status { odp_crypto_alg_err_t alg_err; /** Hardware specific return code */ - odp_crypto_hw_err_t hw_err; - + ODP_DEPRECATE(odp_crypto_hw_err_t) ODP_DEPRECATE(hw_err); } odp_crypto_op_status_t; /** @@ -958,8 +959,11 @@ typedef struct odp_crypto_op_result { * Crypto packet API operation result */ typedef struct odp_crypto_packet_result_t { - /** Request completed successfully */ - odp_bool_t ok; + /** Request completed successfully. + * + * @deprecated Check the return value of odp_crypto_result() instead. + */ + odp_bool_t ODP_DEPRECATE(ok); /** Input packet passed to odp_crypo_op_enq() when the operation * type of the session is ODP_CRYPTO_OP_TYPE_OOP. In other cases |