Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nrf noup] crypto_adjust_config_dependencies: auto-enable ECB when using builtin CCM/GCM #40

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions include/psa/crypto_adjust_config_dependencies.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,16 @@
#define PSA_WANT_ALG_CMAC 1
#endif

/* When at least one block cipher (AES, ARIA, Camellia) is accelerated, the
* builtin implementation of GCM/CCM calls into legacy gcm/ccm modules first
* and then into block_cipher module. The latter will
* then dispatch to PSA again to encypt data using block ciphers in ECB mode,
* which means we need PSA_WANT_ALG_ECB_NO_PADDING to allow this.
*/
#if (defined(PSA_WANT_ALG_GCM) || defined(PSA_WANT_ALG_CCM)) && \
(defined(PSA_WANT_KEY_TYPE_AES) || defined(PSA_WANT_KEY_TYPE_ARIA) || \
defined(PSA_WANT_KEY_TYPE_CAMELLIA))
#define PSA_WANT_ALG_ECB_NO_PADDING 1
#endif

#endif /* PSA_CRYPTO_ADJUST_CONFIG_DEPENDENCIES_H */