API Reference Manual  1.45.0
odp_crypto_packet_op_param_t Struct Reference

Crypto packet API per packet operation parameters. More...

#include <crypto_types.h>

Collaboration diagram for odp_crypto_packet_op_param_t:
[legend]

Data Fields

odp_crypto_session_t session
 Session handle from creation.
 
const uint8_t * cipher_iv_ptr
 IV pointer for cipher.
 
const uint8_t * auth_iv_ptr
 IV pointer for authentication.
 
uint32_t hash_result_offset
 Offset from start of packet for hash result. More...
 
const uint8_t * aad_ptr
 Pointer to AAD. More...
 
odp_packet_data_range_t cipher_range
 Data range to be ciphered. More...
 
odp_packet_data_range_t auth_range
 Data range to be authenticated. More...
 
int32_t dst_offset_shift
 Shift of the output offsets with ODP_CRYPTO_OP_TYPE_OOP. More...
 
uint8_t null_crypto:1
 Use null crypto algorithms. More...
 

Detailed Description

Crypto packet API per packet operation parameters.

Examples
ipsec_crypto/odp_ipsec.c, and odp_crypto.c.

Definition at line 923 of file api/spec/crypto_types.h.

Field Documentation

◆ hash_result_offset

uint32_t odp_crypto_packet_op_param_t::hash_result_offset

Offset from start of packet for hash result.

In case of decode sessions, the expected hash will be read from this offset from the input packet and compared with the calculated hash. After the operation the hash bytes will have undefined values except with out-of-place sessions (ODP_CRYPTO_OP_TYPE_OOP operation type).

With out-of-place decode sessions the input packet is not modified but if the hash location overlaps the cipher range or the auth range, then the corresponding location in the output packet will have undefined content.

In case of encode sessions the calculated hash will be stored in this offset in the output packet.

If the hash_result_in_auth_range session parameter is true, the hash result location may overlap auth_range. In that case the result location will be treated as containing zero bytes for the purpose of hash calculation in decode sessions.

Examples
ipsec_crypto/odp_ipsec.c, and odp_crypto.c.

Definition at line 954 of file api/spec/crypto_types.h.

◆ aad_ptr

const uint8_t* odp_crypto_packet_op_param_t::aad_ptr

Pointer to AAD.

AAD length is defined by 'auth_aad_len' session parameter.

Examples
odp_crypto.c.

Definition at line 959 of file api/spec/crypto_types.h.

◆ cipher_range

odp_packet_data_range_t odp_crypto_packet_op_param_t::cipher_range

Data range to be ciphered.

The range is given in bits or bytes as configured at session creation.

Ignored by the null cipher with operation types other than ODP_CRYPTO_OP_TYPE_OOP.

With the OOP operation type the cipher range is copied to the output packet even with the null cipher. Non-zero-length ranges are not necessarily supported with the null cipher and the OOP operation type. If the requested range is not supported, the crypto operation will fail. The failure is indicated through odp_crypto_result() or through a negative return value of odp_crypto_op()/odp_crypto_op_enq().

Examples
ipsec_crypto/odp_ipsec.c, and odp_crypto.c.

Definition at line 977 of file api/spec/crypto_types.h.

◆ auth_range

odp_packet_data_range_t odp_crypto_packet_op_param_t::auth_range

Data range to be authenticated.

The range is given in bits or bytes as configured at session creation.

The value is ignored with authenticated encryption algorithms, such as AES-GCM, which authenticate data in the cipher range and the AAD.

Ignored by the null auth algorithm with operation types other than ODP_CRYPTO_OP_TYPE_OOP.

With the OOP operation type the auth range is copied to the output packet even with the null auth algorithm. Non-zero-length ranges are not necessarily supported with the null algorithm and the OOP operation type. If the requested range is not supported, the crypto operation will fail. The failure is indicated through odp_crypto_result() or through a negative return value of odp_crypto_op()/odp_crypto_op_enq().

Algorithms in GMAC mode use this field instead of aad_ptr for the data bytes to be authenticated.

Examples
ipsec_crypto/odp_ipsec.c, and odp_crypto.c.

Definition at line 1002 of file api/spec/crypto_types.h.

◆ dst_offset_shift

int32_t odp_crypto_packet_op_param_t::dst_offset_shift

Shift of the output offsets with ODP_CRYPTO_OP_TYPE_OOP.

The processed crypto range and auth range of the input packet will be written in the output packet at the offset specified in the ranges (i.e. the same as in the input packet), shifted by this many bytes. This allows directing the output to a different packet offset than the offset of the input data.

This is ignored if the crypto operation type is not ODP_CRYPTO_OP_TYPE_OOP.

Definition at line 1015 of file api/spec/crypto_types.h.

◆ null_crypto

uint8_t odp_crypto_packet_op_param_t::null_crypto

Use null crypto algorithms.

Process packet using the null cipher and null auth algorithm instead of the algoithms configured in the session. This flag is ignored if the null_crypto_enable session parameter is not set.

Definition at line 1023 of file api/spec/crypto_types.h.


The documentation for this struct was generated from the following file: