assh/assh_cipher.h header reference
Description
This header file contains API descriptors for cipher algorithm modules implemented in the library.
See also cipheralgos and coremod.
Header inclusion
Members
Types
- struct assh_algo_cipher_s
- typedef void (assh_cipher_cleanup_t)(assh_context_s *c, void *ctx_)
- typedef assh_status_t (assh_cipher_init_t)(assh_context_s *c, void *ctx_, const uint8_t *key, const uint8_t *iv, assh_bool_t encrypt)
- enum assh_cipher_op_e
- typedef assh_status_t (assh_cipher_process_t)(void *ctx_, uint8_t *data, size_t len, assh_cipher_op_e op, uint32_t seq)
Functions
- const assh_algo_cipher_s * assh_algo_cipher(const assh_algo_s *algo)
- assh_status_t assh_algo_cipher_by_name(assh_context_s *c, const char *name, size_t name_len, const assh_algo_cipher_s **ca, const assh_algo_name_s **namep)
- assh_status_t assh_algo_cipher_by_name_static(const assh_algo_s **table, const char *name, size_t name_len, const assh_algo_cipher_s **ca, const assh_algo_name_s **namep)
Constant
- const assh_algo_cipher_s assh_cipher_none
Macros
Members detail
const assh_algo_cipher_s * assh_algo_cipher(const assh_algo_s *algo)
This function is declared in assh/assh_cipher.h source file, line 112.
This function casts and returns the passed pointer if the algorithm class is ASSH_ALGO_CIPHER. In other cases, NULL is returned.
assh_status_t assh_algo_cipher_by_name(assh_context_s *c, const char *name, size_t name_len, const assh_algo_cipher_s **ca, const assh_algo_name_s **namep)
This function is declared in assh/assh_cipher.h source file, line 136.
This function finds a registered cipher algorithm.
See also assh_algo_by_name.
assh_status_t assh_algo_cipher_by_name_static(const assh_algo_s **table, const char *name, size_t name_len, const assh_algo_cipher_s **ca, const assh_algo_name_s **namep)
This function is declared in assh/assh_cipher.h source file, line 125.
This function finds a cipher algorithm in a NULL terminated array of pointers to algorithm descriptors.
See also assh_algo_by_name_static.
This struct is declared in assh/assh_cipher.h source file, line 84.
This struct is the cipher algorithm descriptor. It can be casted to the assh_algo_s type.
See also coremod.
Field | Description |
---|---|
assh_algo_s algo; | |
assh_cipher_init_t * f_init; | |
assh_cipher_process_t * f_process; | |
assh_cipher_cleanup_t * f_cleanup; | |
uint16_t ctx_size; | Size of the context structure needed to initialize the algorithm. |
uint8_t block_size; | Cipher block size in bytes, not less than 8. |
uint8_t iv_size; | Cipher IV size, may be 0. |
uint8_t key_size; | Cipher key size in bytes. |
uint8_t auth_size; | Cipher authentication tag size in bytes, may be 0. |
uint8_t head_size; | Number of packet bytes which must be fetched in order to decipher the packet length word. greater or equal to 4. |
const assh_algo_cipher_s assh_cipher_none
This constant is declared in assh/assh_cipher.h source file, line 144.
This constant is a cipher algorithm implementation descriptor for the dummy none algorithm.
This macro is for internal use only.
This macro is declared in assh/assh_cipher.h source file, line 72.
This macro expands to:
void (n)(struct assh_context_s *c, void *ctx_)
See also assh_cipher_cleanup_t.
This macro is for internal use only.
This macro is declared in assh/assh_cipher.h source file, line 40.
This macro expands to:
ASSH_WARN_UNUSED_RESULT assh_status_t (n)(struct assh_context_s *c, void *ctx_,
const uint8_t *key, const uint8_t *iv,
assh_bool_t encrypt)
See also assh_cipher_init_t.
This macro is for internal use only.
This macro is declared in assh/assh_cipher.h source file, line 63.
This macro expands to:
ASSH_WARN_UNUSED_RESULT assh_status_t (n)(void *ctx_, uint8_t *data, size_t len,
enum assh_cipher_op_e op, uint32_t seq)
See also assh_cipher_process_t.
typedef void (assh_cipher_cleanup_t)(assh_context_s *c, void *ctx_)
This typedef is for internal use only.
This typedef is declared in assh/assh_cipher.h source file, line 78.
This declaration involves expansion of the ASSH_CIPHER_CLEANUP_FCN macro.
This typedef defines the function type for the context cleanup operation of the cipher module interface.
typedef assh_status_t (assh_cipher_init_t)(assh_context_s *c, void *ctx_, const uint8_t *key, const uint8_t *iv, assh_bool_t encrypt)
This typedef is for internal use only.
This typedef is declared in assh/assh_cipher.h source file, line 50.
This declaration involves expansion of the ASSH_CIPHER_INIT_FCN macro.
This typedef defines the function type for the cipher initialization operation of the cipher module interface. The ctx_ argument must points to a buffer allocated in secure memory of size given by assh_algo_cipher_s::ctx_size.
This enum is for internal use only.
This enum is declared in assh/assh_cipher.h source file, line 54.
This enum specifies the packet cipher processing phases.
Identifier | Value | Description |
---|---|---|
ASSH_CIPHER_PCK_HEAD | 0 | Process packet head data containing the packet length word |
ASSH_CIPHER_PCK_TAIL | 1 | Process remaining packet data |
ASSH_CIPHER_KEY | 2 | Process key blob |
typedef assh_status_t (assh_cipher_process_t)(void *ctx_, uint8_t *data, size_t len, assh_cipher_op_e op, uint32_t seq)
This typedef is for internal use only.
This typedef is declared in assh/assh_cipher.h source file, line 70.
This declaration involves expansion of the ASSH_CIPHER_PROCESS_FCN macro.
This typedef defines the function type for the data processing operation of the cipher module interface.