4.5 Custom Profile
If the predefined profiles do not match your specific requirements, create a custom configuration by modifying the PSA crypto configuration macros. This approach requires building the library from the source files using the provided build scripts.
Custom configuration is useful when you need a specific combination of algorithms not covered by standard profiles, want to minimize footprint by enabling only the exact algorithms your application uses, need to enable experimental or less common algorithms, or require specific key size restrictions.
To create a custom profile, start with the configuration header closest to your needs
(typically crypto-config-small.h or
crypto-config-medium.h) and modify the PSA_WANT_*
macros to enable or disable specific algorithms. Each algorithm family has associated
macros for algorithm variants and key types. For example, to enable only SHA-256 and
SHA-512 while disabling SHA-224 and SHA-384, you define
PSA_WANT_ALG_SHA_256 and PSA_WANT_ALG_SHA_512
while leaving the others undefined.
When creating custom configurations, be aware of algorithm dependencies. Some algorithms require specific key types to be enabled and some operations have implicit dependencies on hash algorithms.It is user's responsibility to ensure the correctness of the configuration macros.
