On 26/01/15 5:42 am, Taras Kondratiuk wrote:
On 01/15/2015 05:55 PM, Robbie King wrote:
@@ -210,6 +211,21 @@ typedef struct odp_crypto_compl_status {
        enum crypto_hw_err  hw_err;   /**< Hardware specific return code */
  } odp_crypto_compl_status_t;
+/**
+ * Cryto API completion event
+ */
+typedef odp_buffer_t odp_crypto_compl_event_t;
+
+/**
+ * Crypto API operation result
+ */
+typedef struct odp_crypto_op_result {
+       odp_bool_t  ok;                  /**< Request completed successfully */
+       void *ctx;                       /**< User context from request */
+       odp_packet_t pkt;                /**< Output packet */
+       odp_crypto_compl_status_t cipher_status; /**< Cipher status */
+       odp_crypto_compl_status_t auth_status;   /**< Authentication status */
Detailed status is usually needed only in case of failure. Can we say
*_status fields are valid (filled) only when ok == false?
+1. This makes sense.

Actually even in case of failure application will usually drop the
packet without deep analysis, so it seems reasonable to move detailed
status into a separate query.

typedef struct odp_crypto_op_errors {
        odp_crypto_compl_status_t cipher_status; /**< Cipher status */
        odp_crypto_compl_status_t auth_status;   /**< Authentication status */
} odp_crypto_op_errors_t;

odp_crypto_compl_errors(odp_crypto_compl_event_t completion_event, 
odp_crypto_op_errors_t *errors);
Incase of a synchronous crypto operation there is no completion_event as odp_crypto_op_result is directly returned as part of the odp_crypto_operation(). Hence we would prefer not to remove cipher_status and auth_status from odp_crypto_op_result struct.

+} odp_crypto_op_result_t;
/**
   * Crypto session creation (synchronous)


_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to