The SE RT Services Utilities Library is a set of utility code for the PSOC Edge E84 device to provide an interface to SE RT Services SysCalls including PSA cryptographic functions, rollback management and generic syscall functions.
Wrapper functions to call PSA Crypto API v1.1 are implemented in SE RT Services. All cryptographic functions are implemented according to the MbedTLS library version 3.6.0 interface. This version corresponds to the version which used in SE RT Services. Refer to the PSA Crypto API Reference Guide for the specific PSA Crypto functions:
SE RT Services Utilities Library follows all Mbed TLS PSA definitions and functions but SE RT Services has limited support of key types and algorithms:
Wrapper functions to call several syscalls which are implemented in SE RT Services:
{
CY_ALIGN(4) uint8_t message[] =
{
0x86,0x2c,0xf1,0x4c,0x65,0xff,0x85,0xf4,0xfd,0xd8,0xa3,0x93,0x02,0x05,0x63,0x55,
0xc8,0x9c,0x6e,0xa1,0x78,0x9c,0x05,0x62,0x62,0xb0,0x77,0xda,0xb3,0x3a,0xbb,0xfd,
0xa0,0x07,0x0f,0xce,0x18,0x8c,0x63,0x30,0xde,0x84,0xdf,0xc5,0x12,0x74,0x4e,0x9f,
0xa0,0xf7,0xb0,0x3c,0xe0,0xc1,0x48,0x58,0xdb,0x19,0x52,0x75,0x0d,0x7b,0xbe,0x6b,
0xd9,0xc8,0x72,0x6c,0x0e,0xae,0x61,0xe6,0xcf,0x28,0x77,0xc6,0x55,0xb1,0xf0,0xe0,
0xce,0x82,0x54,0x30,0xa9,0x79,0x6e,0x74,0x20,0xe5,0xc1,0x74,0xea,0xb7,0xa5,0x04,
0x59,0xe2,0x91,0x51,0x0b,0xc5,0x15,0x14,0x17,0x38,0x90,0x0d,0x39,0x02,0x17,0xc5,
0xa5,0x22,0xe4,0xbd,0xe5,0x47,0xe5,0x72,0x87,0xd8,0x13,0x9d,0xc9,0x16,0x50,0x4e
};
CY_ALIGN(4) uint8_t signature[] =
{
0x79,0x80,0x65,0xf1,0xd1,0xcb,0xd3,0xa1,0x89,0x77,0x94,0xf4,0xa0,0x25,0xed,0x47,
0x56,0x5d,0xf7,0x73,0x84,0x3f,0x4f,0xa7,0x4c,0x85,0xfe,0x4d,0x30,0xe3,0xa3,0x94,
0x78,0x3e,0xc5,0x72,0x3b,0x53,0x0f,0xc5,0xf5,0x79,0x06,0xf9,0x46,0xce,0x15,0xe8,
0xb5,0x71,0x66,0x04,0x4c,0x57,0xc7,0xd9,0x58,0x20,0x66,0x80,0x5b,0x58,0x85,0xab,
0xc0,0x6e,0x0b,0xfc,0x02,0x43,0x38,0x50,0xc2,0xb7,0x49,0x73,0x20,0x5c,0xa3,0x57,
0xa2,0xda,0x94,0xa6,0x51,0x72,0x08,0x6f,0x5a,0x15,0x80,0xba,0xa6,0x97,0x40,0x0b
};
}
ifx_se_status_t ifx_se_verify_message(ifx_se_key_id_fih_t key, ifx_se_alg_fih_t alg, const ifx_se_fih_ptr_t input, ifx_se_fih_t input_length, const ifx_se_fih_ptr_t signature, ifx_se_fih_t signature_length, void *ctx)
Verify the signature of a message with a public key, using a hash-and-sign verification algorithm.
Definition: ifx_se_psacrypto.c:130
#define IFX_SE_KEY_ID_BUILTIN_TEST_ECC384
ECC P384 public key for signature verify NIST test.
Definition: ifx_se_psacrypto_values.h:2853
#define IFX_SE_ALG_ECDSA(hash_alg)
ECDSA signature with hashing.
Definition: ifx_se_psacrypto_values.h:1529
#define IFX_SE_KEY_ID_FIH_INIT_VALUE(owner, id)
The initial value of the keys identifier transfer data with specified key id and owner.
Definition: ifx_se_psacrypto_struct.h:497
struct ifx_se_key_id_fih_s ifx_se_key_id_fih_t
The type of the of keys identifier transfer data.
Definition: ifx_se_psacrypto_types.h:339
{
#define AES_KEY_SIZE (16)
{
#define DATA_LEN (16)
CY_ALIGN(4) const uint8_t inData[DATA_LEN] = "1234567890";
size_t outSize = 0;
}}
ifx_se_status_t ifx_se_cipher_decrypt(ifx_se_key_id_fih_t key, ifx_se_alg_fih_t alg, const ifx_se_fih_ptr_t input, ifx_se_fih_t input_length, ifx_se_fih_ptr_t output, ifx_se_fih_t output_size, ifx_se_fih_ptr_t output_length, void *ctx)
Decrypt a message using a symmetric cipher.
Definition: ifx_se_psacrypto.c:528
ifx_se_status_t ifx_se_cipher_encrypt(ifx_se_key_id_fih_t key, ifx_se_alg_fih_t alg, const ifx_se_fih_ptr_t iv, ifx_se_fih_t iv_length, const ifx_se_fih_ptr_t input, ifx_se_fih_t input_length, ifx_se_fih_ptr_t output, ifx_se_fih_t output_size, ifx_se_fih_ptr_t output_length, void *ctx)
Encrypt a message using a symmetric cipher with provided IV.
Definition: ifx_se_psacrypto.c:491
#define IFX_SE_CIPHER_ENCRYPT_OUTPUT_SIZE(key_type, alg, input_length)
The maximum size of the output of ifx_se_cipher_encrypt(), in bytes.
Definition: ifx_se_psacrypto_sizes.h:823
#define IFX_SE_CIPHER_IV_MAX_SIZE
The maximum IV size for all supported cipher algorithms, in bytes.
Definition: ifx_se_psacrypto_sizes.h:798
#define IFX_SE_CIPHER_DECRYPT_OUTPUT_SIZE(key_type, alg, input_length)
The maximum size of the output of ifx_se_cipher_decrypt(), in bytes.
Definition: ifx_se_psacrypto_sizes.h:868
static void ifx_se_set_key_algorithm(ifx_se_key_attributes_t *attributes, ifx_se_algorithm_t alg)
Sets key algorithm in key attributes structure.
Definition: ifx_se_psacrypto_struct.h:382
#define IFX_SE_ALG_CBC_NO_PADDING
The CBC block cipher chaining mode, with no padding.
Definition: ifx_se_psacrypto_values.h:1220
#define IFX_SE_KEY_TYPE_AES
Key for a cipher, AEAD or MAC algorithm based on the AES block cipher.
Definition: ifx_se_psacrypto_values.h:482
static void ifx_se_set_key_type(ifx_se_key_attributes_t *attributes, ifx_se_key_type_t type)
Sets key type in key attributes structure.
Definition: ifx_se_psacrypto_struct.h:443
static void ifx_se_set_key_bits(ifx_se_key_attributes_t *attributes, size_t bits)
Sets key length in bits in key attributes structure.
Definition: ifx_se_psacrypto_struct.h:465
ifx_se_status_t ifx_se_generate_key(const ifx_se_key_attributes_t *attributes, ifx_se_fih_ptr_t key, void *ctx)
Generate a key or key pair.
Definition: ifx_se_psacrypto.c:773
ifx_se_status_t ifx_se_destroy_key(ifx_se_key_id_fih_t key, void *ctx)
Destroy a key.
Definition: ifx_se_psacrypto.c:734
#define IFX_SE_KEY_ATTRIBUTES_INIT
The initial value of the key attributes.
Definition: ifx_se_psacrypto_struct.h:239
struct ifx_se_key_attributes_s ifx_se_key_attributes_t
The type of a structure containing key attributes.
Definition: ifx_se_psacrypto_types.h:465
static void ifx_se_set_key_lifetime(ifx_se_key_attributes_t *attributes, ifx_se_key_lifetime_t lifetime)
Sets key lifetime in key attributes structure.
Definition: ifx_se_psacrypto_struct.h:300
#define IFX_SE_KEY_PERSISTENCE_VOLATILE
The persistence level of volatile keys.
Definition: ifx_se_psacrypto_values.h:2339
#define IFX_SE_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(persistence, location)
Construct a lifetime from a persistence level and a location.
Definition: ifx_se_psacrypto_values.h:2411
#define IFX_SE_KEY_LOCATION_SE
The SE RT Services storage area.
Definition: ifx_se_psacrypto_values.h:2431
static void ifx_se_set_key_usage_flags(ifx_se_key_attributes_t *attributes, ifx_se_key_usage_t usage_flags)
Sets key usage flags in key attributes structure.
Definition: ifx_se_psacrypto_struct.h:353
#define IFX_SE_KEY_USAGE_DECRYPT
Whether the key may be used to decrypt a message.
Definition: ifx_se_psacrypto_values.h:2530
#define IFX_SE_KEY_USAGE_ENCRYPT
Whether the key may be used to encrypt a message.
Definition: ifx_se_psacrypto_values.h:2519
ifx_se_status_t ifx_se_generate_random(ifx_se_fih_ptr_t output, ifx_se_fih_t output_size, void *ctx)
Generate random bytes.
Definition: ifx_se_psacrypto.c:794
SE RT Services can process data from different memory regions.
User key storage allows to import and store up to 12 keys according to it size and type:
Vendor keys storage allows to provision up to 16 keys.
Persistent AES keys have usage limitation up to 100k times per key implemented using internal rollback counters. These counters can be red by ifx_se_get_usage_limit_counter. After using limit key should be destroyed by ifx_se_destroy_key.
PSA Crypto API benchmark for the PSOC Edge E84 device with the SE core frequency set to 100 Mhz:
© Cypress Semiconductor Corporation (an Infineon company), 2023-2025.