This file provides the prototypes for the commonly used functions and structures of OPTIGA Library. More...
Go to the source code of this file.
Classes | |
struct | optiga_hash_context |
Specifies the structure to the Hash context details managed by OPTIGA. More... | |
struct | hash_data_from_host |
Specifies the structure to provide the details of data to be hashed from host. More... | |
struct | hash_data_in_optiga |
Specifies the structure to provide the details of data to be hashed from OPTIGA. More... | |
struct | public_key_from_host |
Specifies the data structure of the Public Key details (key, size and type) More... | |
struct | optiga_get_data_object |
Specifies the data structure for data to be read from OPTIGA. More... | |
struct | optiga_set_data_object |
Specifies the data structure for data to be written to OPTIGA. More... | |
struct | optiga_calc_hash |
Specifies the data structure of calculate hash. More... | |
struct | optiga_get_random |
Specifies the data structure of random generation. More... | |
struct | optiga_gen_keypair |
Specifies the data structure for generate key pair. More... | |
struct | optiga_calc_sign |
Specifies the data structure for ECDSA signature. More... | |
struct | optiga_verify_sign |
Specifies the data structure for ECDSA signature verification. More... | |
struct | optiga_calc_ssec |
Specifies the data structure for ecdh secret generation. More... | |
struct | optiga_derive_key |
Specifies the structure for derivation of key using pseudo random function. More... | |
struct | optiga_enc_dec_asym |
Specifies the structure for asymmetric encryption and decryption. More... | |
struct | optiga_set_object_protected_params |
Specifies the data structure for protected update. More... | |
#define | OPTIGA_INSTANCE_ID_0 (0x00) |
Instance id of OPTIGA slave. More... | |
#define | OPTIGA_COMMS_NO_PROTECTION (0x00) |
When command data and response data is unprotected. More... | |
#define | OPTIGA_COMMS_COMMAND_PROTECTION (0x01) |
When command data is protected and response data is unprotected. More... | |
#define | OPTIGA_COMMS_RESPONSE_PROTECTION (0x02) |
When command data is unprotected and response data is protected. More... | |
#define | OPTIGA_COMMS_FULL_PROTECTION (0x03) |
Both command data and response data are protected. More... | |
#define | OPTIGA_COMMS_RE_ESTABLISH (0x80) |
Re-establish shielded connection. More... | |
#define | OPTIGA_COMMS_PROTOCOL_VERSION_PRE_SHARED_SECRET (0x01) |
Pre shared secret protocol version. More... | |
#define | OPTIGA_CRYPT_HOST_DATA (0x01) |
Data is provided by host. More... | |
#define | OPTIGA_CRYPT_OID_DATA (0x00) |
Data in internal to optiga OID. More... | |
#define | OPTIGA_LIB_INSTANCE_BUSY (0x0001) |
OPTIGA instance is busy. More... | |
#define | OPTIGA_LIB_INSTANCE_FREE (0x0000) |
OPTIGA instance is free. More... | |
#define | OPTIGA_COMMS_PROTECTION_LEVEL (0x01) |
Configure shielded connection protection level for instance. More... | |
#define | OPTIGA_COMMS_PROTOCOL_VERSION (0x02) |
Configure shielded connection protocol version for instance. More... | |
enum | optiga_key_id { OPTIGA_KEY_ID_E0F0 = 0xE0F0, OPTIGA_KEY_ID_E0F1 = 0xE0F1, OPTIGA_KEY_ID_E0F2 = 0xE0F2, OPTIGA_KEY_ID_E0F3 = 0xE0F3, OPTIGA_KEY_ID_E0FC = 0xE0FC, OPTIGA_KEY_ID_E0FD = 0xE0FD, OPTIGA_KEY_ID_SESSION_BASED = 0x0000 } |
Specifies the key location in OPTIGA. More... | |
enum | optiga_key_usage { OPTIGA_KEY_USAGE_AUTHENTICATION = 0x01, OPTIGA_KEY_USAGE_SIGN = 0x10, OPTIGA_KEY_USAGE_KEY_AGREEMENT = 0x20, OPTIGA_KEY_USAGE_ENCRYPTION = 0x02 } |
Specifies the key usage type in OPTIGA. More... | |
enum | optiga_set_obj_protected_tag { OPTIGA_SET_PROTECTED_UPDATE_START = 0x00, OPTIGA_SET_PROTECTED_UPDATE_CONTINUE = 0x02, OPTIGA_SET_PROTECTED_UPDATE_FINAL = 0x01 } |
Specifies the set protected object tag. More... | |
enum | optiga_ecc_curve { OPTIGA_ECC_CURVE_NIST_P_256 = 0x03, OPTIGA_ECC_CURVE_NIST_P_384 = 0x04 } |
Specifies the key curve type in OPTIGA. More... | |
enum | optiga_rsa_encryption_scheme { OPTIGA_RSAES_PKCS1_V15 = 0x11 } |
Specifies the RSA encryption schemes. More... | |
enum | optiga_rsa_key_type { OPTIGA_RSA_KEY_1024_BIT_EXPONENTIAL = 0x41, OPTIGA_RSA_KEY_2048_BIT_EXPONENTIAL = 0x42 } |
Specifies the RSA key type in OPTIGA. More... | |
enum | optiga_rsa_signature_scheme { OPTIGA_RSASSA_PKCS1_V15_SHA256 = 0x01, OPTIGA_RSASSA_PKCS1_V15_SHA384 = 0x02 } |
Specifies the RSA signature schemes type in OPTIGA. More... | |
enum | optiga_hash_type { OPTIGA_HASH_TYPE_SHA_256 = 0xE2 } |
Specifies the hashing algorithm type in OPTIGA. More... | |
enum | optiga_rng_type { OPTIGA_RNG_TYPE_TRNG = 0x00, OPTIGA_RNG_TYPE_DRNG = 0x01 } |
Specifies the random generation types. More... | |
typedef enum optiga_key_id | optiga_key_id_t |
Specifies the key location in OPTIGA. More... | |
typedef enum optiga_key_usage | optiga_key_usage_t |
Specifies the key usage type in OPTIGA. More... | |
typedef enum optiga_set_obj_protected_tag | optiga_set_obj_protected_tag_t |
Specifies the set protected object tag. More... | |
typedef enum optiga_ecc_curve | optiga_ecc_curve_t |
Specifies the key curve type in OPTIGA. More... | |
typedef enum optiga_rsa_encryption_scheme | optiga_rsa_encryption_scheme_t |
Specifies the RSA encryption schemes. More... | |
typedef enum optiga_rsa_key_type | optiga_rsa_key_type_t |
Specifies the RSA key type in OPTIGA. More... | |
typedef enum optiga_rsa_signature_scheme | optiga_rsa_signature_scheme_t |
Specifies the RSA signature schemes type in OPTIGA. More... | |
typedef enum optiga_hash_type | optiga_hash_type_t |
Specifies the hashing algorithm type in OPTIGA. More... | |
typedef enum optiga_rng_type | optiga_rng_type_t |
Specifies the random generation types. More... | |
typedef struct optiga_hash_context | optiga_hash_context_t |
Specifies the structure to the Hash context details managed by OPTIGA. More... | |
typedef struct hash_data_from_host | hash_data_from_host_t |
Specifies the structure to provide the details of data to be hashed from host. More... | |
typedef struct hash_data_in_optiga | hash_data_in_optiga_t |
Specifies the structure to provide the details of data to be hashed from OPTIGA. More... | |
typedef struct public_key_from_host | public_key_from_host_t |
Specifies the data structure of the Public Key details (key, size and type) More... | |
typedef struct optiga_get_data_object | optiga_get_data_object_params_t |
Specifies the data structure for data to be read from OPTIGA. More... | |
typedef struct optiga_set_data_object | optiga_set_data_object_params_t |
Specifies the data structure for data to be written to OPTIGA. More... | |
typedef struct optiga_calc_hash | optiga_calc_hash_params_t |
Specifies the data structure of calculate hash. More... | |
typedef struct optiga_get_random | optiga_get_random_params_t |
Specifies the data structure of random generation. More... | |
typedef struct optiga_gen_keypair | optiga_gen_keypair_params_t |
Specifies the data structure for generate key pair. More... | |
typedef struct optiga_calc_sign | optiga_calc_sign_params_t |
Specifies the data structure for ECDSA signature. More... | |
typedef struct optiga_verify_sign | optiga_verify_sign_params_t |
Specifies the data structure for ECDSA signature verification. More... | |
typedef struct optiga_calc_ssec | optiga_calc_ssec_params_t |
Specifies the data structure for ecdh secret generation. More... | |
typedef struct optiga_derive_key | optiga_derive_key_params_t |
Specifies the structure for derivation of key using pseudo random function. More... | |
typedef struct optiga_enc_dec_asym | optiga_encrypt_asym_params_t |
Specifies the structure for asymmetric encryption and decryption. More... | |
typedef struct optiga_enc_dec_asym | optiga_decrypt_asym_params_t |
typedef struct optiga_set_object_protected_params | optiga_set_object_protected_params_t |
Specifies the data structure for protected update. More... | |
uint32_t | optiga_common_get_uint32 (const uint8_t *p_input_buffer) |
Prepares uint32 [Big endian] type value from the buffer and store. More... | |
void | optiga_common_set_uint16 (uint8_t *p_output_buffer, uint16_t two_byte_value) |
Copies 2 bytes of uint16 type value to the buffer. More... | |
void | optiga_common_set_uint32 (uint8_t *p_output_buffer, uint32_t four_byte_value) |
Copies 4 bytes of uint32 [Big endian] type value to the buffer and stores in the output pointer. More... | |
void | optiga_common_get_uint16 (const uint8_t *p_input_buffer, uint16_t *p_two_byte_value) |
Prepares uint16 [Big endian] type value from the buffer and stores in the output pointer. More... | |
This file provides the prototypes for the commonly used functions and structures of OPTIGA Library.
Copyright (c) 2019 Infineon Technologies AG
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
\endcopyright
#define OPTIGA_COMMS_COMMAND_PROTECTION (0x01) |
When command data is protected and response data is unprotected.
#define OPTIGA_COMMS_FULL_PROTECTION (0x03) |
Both command data and response data are protected.
#define OPTIGA_COMMS_NO_PROTECTION (0x00) |
When command data and response data is unprotected.
#define OPTIGA_COMMS_PROTECTION_LEVEL (0x01) |
Configure shielded connection protection level for instance.
#define OPTIGA_COMMS_PROTOCOL_VERSION (0x02) |
Configure shielded connection protocol version for instance.
#define OPTIGA_COMMS_PROTOCOL_VERSION_PRE_SHARED_SECRET (0x01) |
Pre shared secret protocol version.
#define OPTIGA_COMMS_RE_ESTABLISH (0x80) |
Re-establish shielded connection.
#define OPTIGA_COMMS_RESPONSE_PROTECTION (0x02) |
When command data is unprotected and response data is protected.
#define OPTIGA_CRYPT_HOST_DATA (0x01) |
Data is provided by host.
#define OPTIGA_CRYPT_OID_DATA (0x00) |
Data in internal to optiga OID.
#define OPTIGA_INSTANCE_ID_0 (0x00) |
Instance id of OPTIGA slave.
#define OPTIGA_LIB_INSTANCE_BUSY (0x0001) |
OPTIGA instance is busy.
#define OPTIGA_LIB_INSTANCE_FREE (0x0000) |
OPTIGA instance is free.
typedef struct hash_data_from_host hash_data_from_host_t |
Specifies the structure to provide the details of data to be hashed from host.
typedef struct hash_data_in_optiga hash_data_in_optiga_t |
Specifies the structure to provide the details of data to be hashed from OPTIGA.
typedef struct optiga_calc_hash optiga_calc_hash_params_t |
Specifies the data structure of calculate hash.
typedef struct optiga_calc_sign optiga_calc_sign_params_t |
Specifies the data structure for ECDSA signature.
typedef struct optiga_calc_ssec optiga_calc_ssec_params_t |
Specifies the data structure for ecdh secret generation.
typedef struct optiga_enc_dec_asym optiga_decrypt_asym_params_t |
typedef struct optiga_derive_key optiga_derive_key_params_t |
Specifies the structure for derivation of key using pseudo random function.
typedef enum optiga_ecc_curve optiga_ecc_curve_t |
Specifies the key curve type in OPTIGA.
typedef struct optiga_enc_dec_asym optiga_encrypt_asym_params_t |
Specifies the structure for asymmetric encryption and decryption.
typedef struct optiga_gen_keypair optiga_gen_keypair_params_t |
Specifies the data structure for generate key pair.
typedef struct optiga_get_data_object optiga_get_data_object_params_t |
Specifies the data structure for data to be read from OPTIGA.
typedef struct optiga_get_random optiga_get_random_params_t |
Specifies the data structure of random generation.
typedef struct optiga_hash_context optiga_hash_context_t |
Specifies the structure to the Hash context details managed by OPTIGA.
typedef enum optiga_hash_type optiga_hash_type_t |
Specifies the hashing algorithm type in OPTIGA.
typedef enum optiga_key_id optiga_key_id_t |
Specifies the key location in OPTIGA.
typedef enum optiga_key_usage optiga_key_usage_t |
Specifies the key usage type in OPTIGA.
typedef enum optiga_rng_type optiga_rng_type_t |
Specifies the random generation types.
Specifies the RSA encryption schemes.
typedef enum optiga_rsa_key_type optiga_rsa_key_type_t |
Specifies the RSA key type in OPTIGA.
typedef enum optiga_rsa_signature_scheme optiga_rsa_signature_scheme_t |
Specifies the RSA signature schemes type in OPTIGA.
typedef struct optiga_set_data_object optiga_set_data_object_params_t |
Specifies the data structure for data to be written to OPTIGA.
Specifies the set protected object tag.
Specifies the data structure for protected update.
typedef struct optiga_verify_sign optiga_verify_sign_params_t |
Specifies the data structure for ECDSA signature verification.
typedef struct public_key_from_host public_key_from_host_t |
Specifies the data structure of the Public Key details (key, size and type)
enum optiga_ecc_curve |
enum optiga_hash_type |
enum optiga_key_id |
Specifies the key location in OPTIGA.
enum optiga_key_usage |
Specifies the key usage type in OPTIGA.
enum optiga_rng_type |
enum optiga_rsa_key_type |
void optiga_common_get_uint16 | ( | const uint8_t * | p_input_buffer, |
uint16_t * | p_two_byte_value | ||
) |
Prepares uint16 [Big endian] type value from the buffer and stores in the output pointer.
Prepares uint16 [Big endian] type value from the buffer and store
[in] | p_input_buffer | Pointer to the buffer |
[in,out] | p_two_byte_value | Pointer to the value tobe assigne |
uint32_t optiga_common_get_uint32 | ( | const uint8_t * | p_input_buffer | ) |
Prepares uint32 [Big endian] type value from the buffer and store.
Prepares uint32 [Big endian] type value from the buffer and store
[in] | p_input_buffer | Pointer to the buffer |
return | 32 bit value |
void optiga_common_set_uint16 | ( | uint8_t * | p_output_buffer, |
uint16_t | two_byte_value | ||
) |
Copies 2 bytes of uint16 type value to the buffer.
Copies 2 bytes of uint16 type value to the buffer
[in,out] | p_output_buffer | Pointer to the buffer |
[in] | two_byte_value | 16 bit value |
void optiga_common_set_uint32 | ( | uint8_t * | p_output_buffer, |
uint32_t | four_byte_value | ||
) |
Copies 4 bytes of uint32 [Big endian] type value to the buffer and stores in the output pointer.
Copies 4 bytes of uint32 [Big endian] type value to the buffer and store
[in,out] | p_output_buffer | Pointer to the buffer |
[in] | four_byte_value | 32 bit value |