OPTIGA™ Trust M
Host Library Documentation
optiga/include/optiga/pal/pal_crypt.h
Go to the documentation of this file.
1 
39 #ifndef _PAL_CRYPT_H_
40 #define _PAL_CRYPT_H_
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
47 #include "optiga/pal/pal.h"
48 
50 typedef struct pal_crypt_t
51 {
53  void * callback_ctx;
55 
82 LIBRARY_EXPORTS pal_status_t pal_crypt_tls_prf_sha256(pal_crypt_t* p_pal_crypt,
83  const uint8_t * p_secret,
84  uint16_t secret_length,
85  const uint8_t * p_label,
86  uint16_t label_length,
87  const uint8_t * p_seed,
88  uint16_t seed_length,
89  uint8_t * p_derived_key,
90  uint16_t derived_key_length);
91 
121  const uint8_t * p_plain_text,
122  uint16_t plain_text_length,
123  const uint8_t * p_encrypt_key,
124  const uint8_t * p_nonce,
125  uint16_t nonce_length,
126  const uint8_t * p_associated_data,
127  uint16_t associated_data_length,
128  uint8_t mac_size,
129  uint8_t * p_cipher_text);
130 
161  const uint8_t * p_cipher_text,
162  uint16_t cipher_text_length,
163  const uint8_t * p_decrypt_key,
164  const uint8_t * p_nonce,
165  uint16_t nonce_length,
166  const uint8_t * p_associated_data,
167  uint16_t associated_data_length,
168  uint8_t mac_size,
169  uint8_t * p_plain_text);
170 
190 pal_status_t pal_crypt_version(uint8_t * p_crypt_lib_version_info, uint16_t * length);
191 
192 #ifdef __cplusplus
193 }
194 #endif
195 
196 #endif /*_PAL_CRYPT_H_ */
197 
pal_status_t
uint16_t pal_status_t
PAL return status.
Definition: examples/tools/protected_update_data_set/include/pal/pal_crypt.h:54
pal_crypt_t
PAL crypt context structure.
Definition: optiga/include/optiga/pal/pal_crypt.h:51
pal_crypt_decrypt_aes128_ccm
LIBRARY_EXPORTS pal_status_t pal_crypt_decrypt_aes128_ccm(pal_crypt_t *p_pal_crypt, const uint8_t *p_cipher_text, uint16_t cipher_text_length, const uint8_t *p_decrypt_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_plain_text)
Decrypts the cipher text using AES CCM algorithm and provides the plain text.
optiga_lib_types.h
This file contains the type definitions for the fundamental data types.
pal_crypt_encrypt_aes128_ccm
LIBRARY_EXPORTS 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)
Encrypts the input plain text using AES CCM algorithm and provides the cipher text as well as MAC int...
pal_crypt_t
struct pal_crypt_t pal_crypt_t
PAL crypt context structure.
pal_crypt_version
pal_status_t pal_crypt_version(uint8_t *p_crypt_lib_version_info, uint16_t *length)
Gets the external crypto library version number.
pal.h
This file provides the prototype declarations of platform abstraction layer.
pal_crypt_t::callback_ctx
void * callback_ctx
callback
Definition: optiga/include/optiga/pal/pal_crypt.h:53
pal_crypt_tls_prf_sha256
LIBRARY_EXPORTS 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)
Derives the key using the TLS PRF SHA256 for a given secret.