API Reference Manual  1.45.0
odp_crypto_session_param_t Struct Reference

Crypto API session creation parameters. More...

#include <crypto_types.h>

Collaboration diagram for odp_crypto_session_param_t:
[legend]

Data Fields

odp_crypto_op_t op
 Encode vs. More...
 
odp_crypto_op_type_t op_type
 Crypto operation type. More...
 
odp_bool_t cipher_range_in_bits
 Cipher range unit. More...
 
odp_bool_t auth_range_in_bits
 Auth range unit. More...
 
odp_bool_t auth_cipher_text
 Authenticate cipher vs. More...
 
odp_bool_t hash_result_in_auth_range
 Hash result location may overlap authentication range. More...
 
odp_bool_t null_crypto_enable
 Enable skipping crypto on per-packet basis. More...
 
odp_crypto_op_mode_t op_mode
 Operation mode when using packet interface: sync or async. More...
 
odp_cipher_alg_t cipher_alg
 Cipher algorithm. More...
 
odp_crypto_key_t cipher_key
 Cipher key. More...
 
uint32_t cipher_iv_len
 Cipher IV length. More...
 
odp_auth_alg_t auth_alg
 Authentication algorithm. More...
 
odp_crypto_key_t auth_key
 Authentication key. More...
 
uint32_t auth_iv_len
 Authentication IV length. More...
 
uint32_t auth_digest_len
 Authentication digest length in bytes. More...
 
uint32_t auth_aad_len
 Additional Authenticated Data (AAD) length in bytes. More...
 
odp_queue_t compl_queue
 Async mode completion event queue. More...
 
odp_pool_t output_pool
 Output pool. More...
 

Detailed Description

Crypto API session creation parameters.

Examples
odp_crypto.c.

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

Field Documentation

◆ op

odp_crypto_op_t odp_crypto_session_param_t::op

Encode vs.

decode operation

The default value is ODP_CRYPTO_OP_ENCODE.

Examples
odp_crypto.c.

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

◆ op_type

odp_crypto_op_type_t odp_crypto_session_param_t::op_type

Crypto operation type.

This field defines how the crypto operation functions are to be called and what they return. In particular, this field specifies the interpretation of the output packet parameter, how output packets are allocated and what data and metadata they contain.

The default value is ODP_CRYPTO_OP_TYPE_LEGACY.

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

◆ cipher_range_in_bits

odp_bool_t odp_crypto_session_param_t::cipher_range_in_bits

Cipher range unit.

When this flag is true, cipher range offset and length are in bits. Otherwise the offset and length are in bytes.

If cipher capabilities do not include bit_mode, setting this to true causes a session creation failure.

The default value is false.

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

◆ auth_range_in_bits

odp_bool_t odp_crypto_session_param_t::auth_range_in_bits

Auth range unit.

When this flag is true, auth range offset and length are in bits. Otherwise the offset and length are in bytes.

If auth capabilities do not include bit_mode, setting this to true causes a session creation failure.

The default value is false.

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

◆ auth_cipher_text

odp_bool_t odp_crypto_session_param_t::auth_cipher_text

Authenticate cipher vs.

plain text

Controls ordering of authentication and cipher operations, and is relative to the operation (encode vs decode). When encoding, TRUE indicates the authentication operation should be performed after the cipher operation else before. When decoding, TRUE indicates the reverse order of operation.

The value is ignored with authenticated encryption algorithms such as AES-GCM. The value is also ignored when one of the algorithms is null.

true: Authenticate cipher text false: Authenticate plain text

The default value is false.

Examples
odp_crypto.c.

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

◆ hash_result_in_auth_range

odp_bool_t odp_crypto_session_param_t::hash_result_in_auth_range

Hash result location may overlap authentication range.

This flag indicates that the hash result location may (but is not required to) overlap authentication range. Setting this flag may reduce performance.

Default value is false.

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

◆ null_crypto_enable

odp_bool_t odp_crypto_session_param_t::null_crypto_enable

Enable skipping crypto on per-packet basis.

When this flag is true, the null_crypto flag of crypto operation parameters can be set to request skipping of ciphering and authentication of a packet regardless of session configuration. This may be useful for preserving packet order between packets that require crypto processing and packets that do not.

This flag must be set false when op_mode is ODP_CRYPTO_SYNC.

The default value is false.

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

◆ op_mode

odp_crypto_op_mode_t odp_crypto_session_param_t::op_mode

Operation mode when using packet interface: sync or async.

The default value is ODP_CRYPTO_SYNC.

Examples
odp_crypto.c.

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

◆ cipher_alg

odp_cipher_alg_t odp_crypto_session_param_t::cipher_alg

Cipher algorithm.

Select cipher algorithm to be used. ODP_CIPHER_ALG_NULL indicates that ciphering is disabled. Use odp_crypto_capability() for supported algorithms. Note that some algorithms restrict choice of the pairing authentication algorithm. When ciphering is enabled cipher key and IV need to be set. The default value is ODP_CIPHER_ALG_NULL.

When ciphering is disabled, i.e. cipher_alg is ODP_CIPHER_ALG_NULL, cipher_key and cipher_iv_len parameters are ignored.

Examples
odp_crypto.c.

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

◆ cipher_key

odp_crypto_key_t odp_crypto_session_param_t::cipher_key

Cipher key.

Use odp_crypto_cipher_capa() for supported key and IV lengths.

Examples
odp_crypto.c.

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

◆ cipher_iv_len

uint32_t odp_crypto_session_param_t::cipher_iv_len

Cipher IV length.

The default value is zero.

Examples
odp_crypto.c.

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

◆ auth_alg

odp_auth_alg_t odp_crypto_session_param_t::auth_alg

Authentication algorithm.

Select authentication algorithm to be used. ODP_AUTH_ALG_NULL indicates that authentication is disabled. Use odp_crypto_capability() for supported algorithms. Note that some algorithms restrict choice of the pairing cipher algorithm.

When single algorithm provides both ciphering and authentication (i.e. authenticated encryption), authentication side key (auth_key) and IV (auth_iv) are ignored, and cipher side parameters are used instead.

When authentication is disabled, i.e. auth_alg is ODP_AUTH_ALG_NULL, auth_key, auth_iv_len, auth_digest_len, auth_aad_len and hash_result_in_auth_range parameters are ignored.

The default value is ODP_AUTH_ALG_NULL.

Examples
odp_crypto.c.

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

◆ auth_key

odp_crypto_key_t odp_crypto_session_param_t::auth_key

Authentication key.

Use odp_crypto_auth_capability() for supported key lengths.

Examples
odp_crypto.c.

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

◆ auth_iv_len

uint32_t odp_crypto_session_param_t::auth_iv_len

Authentication IV length.

The default value is zero.

Examples
odp_crypto.c.

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

◆ auth_digest_len

uint32_t odp_crypto_session_param_t::auth_digest_len

Authentication digest length in bytes.

Use odp_crypto_auth_capability() for supported digest lengths.

Examples
odp_crypto.c.

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

◆ auth_aad_len

uint32_t odp_crypto_session_param_t::auth_aad_len

Additional Authenticated Data (AAD) length in bytes.

AAD length is constant for all operations (packets) of the session. Set to zero when AAD is not used. Use odp_crypto_auth_capability() for supported AAD lengths. The default value is zero.

Examples
odp_crypto.c.

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

◆ compl_queue

odp_queue_t odp_crypto_session_param_t::compl_queue

Async mode completion event queue.

The completion queue is used to return completions from odp_crypto_op_enq() to the application.

Examples
odp_crypto.c.

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

◆ output_pool

odp_pool_t odp_crypto_session_param_t::output_pool

Output pool.

When the output packet is not specified during the call to crypto operation in the legacy operation type, the output packet will be allocated from this pool.

In ODP_CRYPTO_OP_TYPE_BASIC and ODP_CRYPTO_OP_TYPE_OOP operation types this must be set to ODP_POOL_INVALID.

Examples
odp_crypto.c.

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


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