platform/linux-generic/odp_crypto_null.c
int
odp_crypto_operation(odp_crypto_op_param_t *param,
		     odp_bool_t *posted,
		     odp_crypto_op_result_t *result)
{
	odp_crypto_packet_op_param_t packet_param;
	odp_packet_t out_pkt = param->out_pkt;
	odp_crypto_packet_result_t packet_result;
	odp_crypto_op_result_t local_result;
	int rc;

	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;
	packet_param.auth_range = param->auth_range;

	rc = odp_crypto_op(&param->pkt, &out_pkt, &packet_param, 1);
	if (rc <= 0)
		return -1;

	rc = odp_crypto_result(&packet_result, out_pkt);
	if (rc < 0) {
		/*
		 * We cannot fail since odp_crypto_op() has already processed
		 * the packet. Let's indicate error in the result instead.
		 */
		packet_hdr(out_pkt)->p.flags.crypto_err = 1;
		packet_result.ok = false;
	}

	/* Indicate to caller operation was sync */
	*posted = 0;

	packet_subtype_set(out_pkt, ODP_EVENT_PACKET_BASIC);

	/* Fill in result */
	local_result.ctx = param->ctx;
	local_result.pkt = out_pkt;
	local_result.cipher_status = packet_result.cipher_status;
	local_result.auth_status = packet_result.auth_status;
	local_result.ok = packet_result.ok;

	/*
	 * Be bug-to-bug compatible. Return output packet also through params.
	 */
	param->out_pkt = out_pkt;

	*result = local_result;

	return 0;
}
/*
 * Shim function around packet operation, can be used by other implementations.
 */
Shim function around packet operation, can be used by other implementations.
Shim function around packet operation can be used by other implementations .
int
odp_crypto_operation(odp_crypto_op_param_t *param,
		     odp_bool_t *posted,
		     odp_crypto_op_result_t *result)
{
	odp_crypto_packet_op_param_t packet_param;
	odp_packet_t out_pkt = param->out_pkt;
	odp_crypto_packet_result_t packet_result;
	odp_crypto_op_result_t local_result;
	int rc;
	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;
	packet_param.auth_range = param->auth_range;
	rc = odp_crypto_op(&param->pkt, &out_pkt, &packet_param, 1);
	if (rc <= 0)
		return -1;
	rc = odp_crypto_result(&packet_result, out_pkt);
	if (rc < 0) {
		packet_hdr(out_pkt)->p.flags.crypto_err = 1;
		packet_result.ok = false;
	}
	*posted = 0;
	packet_subtype_set(out_pkt, ODP_EVENT_PACKET_BASIC);
	local_result.ctx = param->ctx;
	local_result.pkt = out_pkt;
	local_result.cipher_status = packet_result.cipher_status;
	local_result.auth_status = packet_result.auth_status;
	local_result.ok = packet_result.ok;
	param->out_pkt = out_pkt;
	*result = local_result;
	return 0;
}
int odp_crypto_operation ( odp_crypto_op_param_t * param , odp_bool_t * posted , odp_crypto_op_result_t * result ) { odp_crypto_packet_op_param_t packet_param ; odp_packet_t out_pkt = param -> out_pkt ; odp_crypto_packet_result_t packet_result ; odp_crypto_op_result_t local_result ; int rc ; 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 ; packet_param . auth_range = param -> auth_range ; rc = odp_crypto_op ( & param -> pkt , & out_pkt , & packet_param , 1 ) ; if ( rc <= 0 ) return -1 ; rc = odp_crypto_result ( & packet_result , out_pkt ) ; if ( rc < 0 ) { packet_hdr ( out_pkt ) -> p . flags . crypto_err = 1 ; packet_result . ok = false ; } * posted = 0 ; packet_subtype_set ( out_pkt , ODP_EVENT_PACKET_BASIC ) ; local_result . ctx = param -> ctx ; local_result . pkt = out_pkt ; local_result . cipher_status = packet_result . cipher_status ; local_result . auth_status = packet_result . auth_status ; local_result . ok = packet_result . ok ; param -> out_pkt = out_pkt ; * result = local_result ; return 0 ; }
Shim function around packet operation, can be used by other implementations.
Shim function around packet operation can be used by other implementations .
/*
		 * We cannot fail since odp_crypto_op() has already processed
		 * the packet. Let's indicate error in the result instead.
		 */ /* Indicate to caller operation was sync */ /* Fill in result */ /*
	 * Be bug-to-bug compatible. Return output packet also through params.
	 */