This example uses the PSA Crypto API to perform symmetric key operations on the supported device.
The example redirects standard I/O to the virtual serial port (VCOM) of the kit. By default, the serial port setting is 115200 bps and 8-N-1 configuration.
Except for the Series 1 Cortex-M0+ device, the example has been instrumented with code to count the number of clock cycles spent in different operations. The results are printed on the VCOM serial port console. This feature can be disabled by defining PSA_CRYPTO_PRINT=0 (default is 1) in the IDE setting (Preprocessor->Defined symbols).
The following key storages are supported in this example:
The following key sizes are supported in this example:
The following key usages can be selected in this example:
PSA_KEY_USAGE_EXPORTPSA_KEY_USAGE_COPYThe following symmetric key algorithms are supported in this example:
PSA_ALG_ECB_NO_PADDINGPSA_ALG_CBC_NO_PADDINGPSA_ALG_CFBPSA_ALG_CTRPSA_ALG_CCMPSA_ALG_GCMPSA_ALG_CHACHA20PSA_ALG_CHACHA20_POLY1305PSA_ALG_CMACPSA_ALG_HMAC(hash_alg)PSA_ALG_HKDF(hash_alg)The default derived key algorithm is PSA_ALG_CTR, it is defined in app_process.h.<br>
The PSA_ALG_CHACHA20 and PSA_ALG_CHACHA20_POLY1305 can only use a 256-bit key.
The following PSA Crypto APIs are used in this example:
psa_crypto_initpsa_key_attributes_initpsa_set_key_typepsa_set_key_bitspsa_set_key_usage_flagspsa_set_key_algorithmpsa_set_key_idpsa_set_key_lifetimepsa_generate_keypsa_import_keypsa_copy_keypsa_reset_key_attributespsa_export_keypsa_destroy_keymbedtls_psa_crypto_freeAdapter Firmware under General Device Information in Simplicity Studio 5 Users Guide).Secure Firmware under General Device Information in Simplicity Studio 5 Users Guide).Device Console in Simplicity Studio 5, Line terminator: must be set to None).Platform() checkbox to browse the platform examples).PERSISTENT_KEY_ID and PERSISTENT_COPY_KEY_ID values in app_process.h if these key IDs had already existed in NVM3.PSA_KEY_USAGE_COPY policy does not apply to the wrapped key.Optimize for debugging (-Og) on Simplicity IDE and None on IAR Embedded Workbench.