OPTIGA™ Trust M
Host Library Documentation
examples/tools/protected_update_data_set/include/pal/pal_crypt.h File Reference

This file defines APIs, types and data structures used for protected update pal crypt. More...

#include <stdint.h>
#include "protected_update_data_set.h"
Include dependency graph for examples/tools/protected_update_data_set/include/pal/pal_crypt.h:

Go to the source code of this file.

Data Structures

struct  pal_crypt
 
typedef struct pal_crypt pal_crypt_t
 
typedef uint16_t pal_status_t
 PAL return status. More...
 
pal_status_t pal_crypt_hash (pal_crypt_t *p_pal_crypt, uint8_t hash_algorithm, const uint8_t *p_message, uint32_t message_length, uint8_t *p_digest)
 
pal_status_t pal_crypt_sign (pal_crypt_t *p_pal_crypt, uint8_t *p_digest, uint16_t digest_length, uint8_t *p_signature, uint16_t *signature_length, const uint8_t *p_private_key, uint16_t private_key_length)
 
pal_status_t pal_crypt_get_signature_length (uint8_t *p_private_key, uint16_t *sign_len, signature_algo_t sign_algo)
 
pal_status_t pal_crypt_encrypt_aes128_ccm (pal_crypt_t *p_pal_crypt, const uint8_t *p_plain_text, uint16_t plain_text_length, const uint8_t *p_encrypt_key, const uint8_t *p_nonce, uint16_t nonce_length, const uint8_t *p_associated_data, uint16_t associated_data_length, uint8_t mac_size, uint8_t *p_cipher_text)
 
pal_status_t pal_crypt_tls_prf_sha256 (pal_crypt_t *p_pal_crypt, const uint8_t *p_secret, uint16_t secret_length, const uint8_t *p_label, uint16_t label_length, const uint8_t *p_seed, uint16_t seed_length, uint8_t *p_derived_key, uint16_t derived_key_length)
 
pal_status_t pal_crypt_generate_random (pal_crypt_t *p_pal_crypt, uint8_t *p_random_data, uint16_t random_data_length)
 
pal_status_t pal_crypt_set_seed (pal_crypt_t *p_pal_crypt, uint8_t *p_seed, uint16_t seed_length)
 
pal_status_t pal_crypt_get_key_type (int8_t *key_file)
 
pal_status_t pal_crypt_parse_ecc_key (void *key_file, uint8_t **D, uint16_t *D_length, uint8_t **X, uint16_t *X_length, uint8_t **Y, uint16_t *Y_length)
 
pal_status_t pal_crypt_parse_rsa_key (void *key_file, uint8_t **N, uint16_t *N_length, uint8_t **E, uint16_t *E_length, uint8_t **D, uint16_t *D_length)
 

Detailed Description

This file defines APIs, types and data structures used for protected update pal crypt.

Author
Infineon Technologies AG

Definition in file examples/tools/protected_update_data_set/include/pal/pal_crypt.h.

Typedef Documentation

◆ pal_crypt_t

typedef struct pal_crypt pal_crypt_t

◆ pal_status_t

typedef uint16_t pal_status_t

PAL return status.

Definition at line 54 of file examples/tools/protected_update_data_set/include/pal/pal_crypt.h.

Function Documentation

◆ pal_crypt_encrypt_aes128_ccm()

pal_status_t pal_crypt_encrypt_aes128_ccm ( pal_crypt_t p_pal_crypt,
const uint8_t *  p_plain_text,
uint16_t  plain_text_length,
const uint8_t *  p_encrypt_key,
const uint8_t *  p_nonce,
uint16_t  nonce_length,
const uint8_t *  p_associated_data,
uint16_t  associated_data_length,
uint8_t  mac_size,
uint8_t *  p_cipher_text 
)

◆ pal_crypt_generate_random()

pal_status_t pal_crypt_generate_random ( pal_crypt_t p_pal_crypt,
uint8_t *  p_random_data,
uint16_t  random_data_length 
)

◆ pal_crypt_get_key_type()

pal_status_t pal_crypt_get_key_type ( int8_t *  key_file)

◆ pal_crypt_get_signature_length()

pal_status_t pal_crypt_get_signature_length ( uint8_t *  p_private_key,
uint16_t *  sign_len,
signature_algo_t  sign_algo 
)

◆ pal_crypt_hash()

pal_status_t pal_crypt_hash ( pal_crypt_t p_pal_crypt,
uint8_t  hash_algorithm,
const uint8_t *  p_message,
uint32_t  message_length,
uint8_t *  p_digest 
)

◆ pal_crypt_parse_ecc_key()

pal_status_t pal_crypt_parse_ecc_key ( void *  key_file,
uint8_t **  D,
uint16_t *  D_length,
uint8_t **  X,
uint16_t *  X_length,
uint8_t **  Y,
uint16_t *  Y_length 
)

◆ pal_crypt_parse_rsa_key()

pal_status_t pal_crypt_parse_rsa_key ( void *  key_file,
uint8_t **  N,
uint16_t *  N_length,
uint8_t **  E,
uint16_t *  E_length,
uint8_t **  D,
uint16_t *  D_length 
)

◆ pal_crypt_set_seed()

pal_status_t pal_crypt_set_seed ( pal_crypt_t p_pal_crypt,
uint8_t *  p_seed,
uint16_t  seed_length 
)

◆ pal_crypt_sign()

pal_status_t pal_crypt_sign ( pal_crypt_t p_pal_crypt,
uint8_t *  p_digest,
uint16_t  digest_length,
uint8_t *  p_signature,
uint16_t *  signature_length,
const uint8_t *  p_private_key,
uint16_t  private_key_length 
)

◆ pal_crypt_tls_prf_sha256()

pal_status_t pal_crypt_tls_prf_sha256 ( pal_crypt_t p_pal_crypt,
const uint8_t *  p_secret,
uint16_t  secret_length,
const uint8_t *  p_label,
uint16_t  label_length,
const uint8_t *  p_seed,
uint16_t  seed_length,
uint8_t *  p_derived_key,
uint16_t  derived_key_length 
)