2323
2424#include "cracen_psa_primitives.h"
2525
26- #if defined(CONFIG_SOC_NRF54LV10A ) && defined(PSA_NEED_CRACEN_CTR_AES )
26+ #if defined(CONFIG_PSA_NEED_CRACEN_CTR_SIZE_WORKAROUNDS ) && defined(PSA_NEED_CRACEN_CTR_AES )
2727#include <cracen_sw_aes_ctr.h>
2828#endif
2929
@@ -288,7 +288,7 @@ psa_status_t cracen_cipher_encrypt(const psa_key_attributes_t *attributes,
288288 cracen_cipher_operation_t operation = {0 };
289289 * output_length = 0 ;
290290
291- #if defined(CONFIG_SOC_NRF54LV10A ) && defined(PSA_NEED_CRACEN_CTR_AES )
291+ #if defined(CONFIG_PSA_NEED_CRACEN_CTR_SIZE_WORKAROUNDS ) && defined(PSA_NEED_CRACEN_CTR_AES )
292292 /* Route AES_CTR to software implementation due to 16-bit counter limitation */
293293 if (alg == PSA_ALG_CTR ) {
294294 if (output_size < input_length ) {
@@ -364,7 +364,7 @@ psa_status_t cracen_cipher_decrypt(const psa_key_attributes_t *attributes,
364364 const size_t iv_size = (alg == PSA_ALG_STREAM_CIPHER ) ? 12 : SX_BLKCIPHER_IV_SZ ;
365365 * output_length = 0 ;
366366
367- #if defined(CONFIG_SOC_NRF54LV10A ) && defined(PSA_NEED_CRACEN_CTR_AES )
367+ #if defined(CONFIG_PSA_NEED_CRACEN_CTR_SIZE_WORKAROUNDS ) && defined(PSA_NEED_CRACEN_CTR_AES )
368368 /* Route AES_CTR to software implementation due to 16-bit counter limitation */
369369 if (alg == PSA_ALG_CTR ) {
370370 return cracen_sw_aes_ctr_crypt (attributes , key_buffer , key_buffer_size , input ,
@@ -480,7 +480,7 @@ psa_status_t cracen_cipher_encrypt_setup(cracen_cipher_operation_t *operation,
480480 const uint8_t * key_buffer , size_t key_buffer_size ,
481481 psa_algorithm_t alg )
482482{
483- #if defined(CONFIG_SOC_NRF54LV10A ) && defined(PSA_NEED_CRACEN_CTR_AES )
483+ #if defined(CONFIG_PSA_NEED_CRACEN_CTR_SIZE_WORKAROUNDS ) && defined(PSA_NEED_CRACEN_CTR_AES )
484484 /* Route AES_CTR to software implementation due to 16-bit counter limitation */
485485 if (alg == PSA_ALG_CTR ) {
486486 return cracen_sw_aes_ctr_setup (operation , attributes , key_buffer , key_buffer_size );
@@ -496,7 +496,7 @@ psa_status_t cracen_cipher_decrypt_setup(cracen_cipher_operation_t *operation,
496496 psa_algorithm_t alg )
497497{
498498
499- #if defined(CONFIG_SOC_NRF54LV10A ) && defined(PSA_NEED_CRACEN_CTR_AES )
499+ #if defined(CONFIG_PSA_NEED_CRACEN_CTR_SIZE_WORKAROUNDS ) && defined(PSA_NEED_CRACEN_CTR_AES )
500500 /* Route AES_CTR to software implementation due to 16-bit counter limitation */
501501 if (alg == PSA_ALG_CTR ) {
502502 return cracen_sw_aes_ctr_setup (operation , attributes , key_buffer , key_buffer_size );
@@ -511,7 +511,7 @@ psa_status_t cracen_cipher_set_iv(cracen_cipher_operation_t *operation, const ui
511511{
512512 __ASSERT_NO_MSG (iv != NULL );
513513
514- #if defined(CONFIG_SOC_NRF54LV10A ) && defined(PSA_NEED_CRACEN_CTR_AES )
514+ #if defined(CONFIG_PSA_NEED_CRACEN_CTR_SIZE_WORKAROUNDS ) && defined(PSA_NEED_CRACEN_CTR_AES )
515515 /* Route AES_CTR to software implementation due to 16-bit counter limitation */
516516 if (operation -> alg == PSA_ALG_CTR ) {
517517 return cracen_sw_aes_ctr_set_iv (operation , iv , iv_length );
@@ -554,7 +554,7 @@ psa_status_t cracen_cipher_update(cracen_cipher_operation_t *operation, const ui
554554 __ASSERT_NO_MSG (input != NULL || input_length == 0 );
555555 __ASSERT_NO_MSG (output_length != NULL );
556556
557- #if defined(CONFIG_SOC_NRF54LV10A ) && defined(PSA_NEED_CRACEN_CTR_AES )
557+ #if defined(CONFIG_PSA_NEED_CRACEN_CTR_SIZE_WORKAROUNDS ) && defined(PSA_NEED_CRACEN_CTR_AES )
558558 /* Route AES_CTR to software implementation due to 16-bit counter limitation */
559559 if (operation -> alg == PSA_ALG_CTR ) {
560560 return cracen_sw_aes_ctr_update (operation , input , input_length , output , output_size ,
@@ -712,7 +712,7 @@ psa_status_t cracen_cipher_finish(cracen_cipher_operation_t *operation, uint8_t
712712{
713713 __ASSERT_NO_MSG (output_length != NULL );
714714
715- #if defined(CONFIG_SOC_NRF54LV10A ) && defined(PSA_NEED_CRACEN_CTR_AES )
715+ #if defined(CONFIG_PSA_NEED_CRACEN_CTR_SIZE_WORKAROUNDS ) && defined(PSA_NEED_CRACEN_CTR_AES )
716716 /* Route AES_CTR to software implementation due to 16-bit counter limitation */
717717 if (operation -> alg == PSA_ALG_CTR ) {
718718 return cracen_sw_aes_ctr_finish (operation , output_length );
@@ -859,7 +859,7 @@ psa_status_t cracen_cipher_finish(cracen_cipher_operation_t *operation, uint8_t
859859
860860psa_status_t cracen_cipher_abort (cracen_cipher_operation_t * operation )
861861{
862- #if defined(CONFIG_SOC_NRF54LV10A ) && defined(PSA_NEED_CRACEN_CTR_AES )
862+ #if defined(CONFIG_PSA_NEED_CRACEN_CTR_SIZE_WORKAROUNDS ) && defined(PSA_NEED_CRACEN_CTR_AES )
863863 /* Route AES_CTR to software implementation due to 16-bit counter limitation */
864864 if (operation -> alg == PSA_ALG_CTR ) {
865865 /* Software AES CTR implementation doesn't allocate hardware resources to free */
0 commit comments