Skip to content

Commit 391f6d7

Browse files
Vge0rgerlubos
authored andcommitted
nrf_security: Refactor buffer size for block cipher in Cracen
In the sxsymcrypt driver of Cracen the block cipher was set as 64 because of the ChaCha20 support. This uses unecessary stack space when ChaCha20 is not enabled so make this buffer size configurable based on the enabled algorithms. Signed-off-by: Georgios Vasilakis <[email protected]>
1 parent 196d0eb commit 391f6d7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

subsys/nrf_security/src/drivers/cracen/cracenpsa/include/cracen_psa_primitives.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@
2020

2121
#define SX_BLKCIPHER_IV_SZ (16U)
2222
#define SX_BLKCIPHER_AES_BLK_SZ (16U)
23+
24+
#if defined(PSA_NEED_CRACEN_STREAM_CIPHER_CHACHA20)
2325
/* ChaCha20 has a 512 bit block size */
2426
#define SX_BLKCIPHER_MAX_BLK_SZ (64U)
27+
#else
28+
#define SX_BLKCIPHER_MAX_BLK_SZ SX_BLKCIPHER_AES_BLK_SZ
29+
#endif
2530

2631
#define CRACEN_MAX_AES_KEY_SIZE (32u)
2732

0 commit comments

Comments
 (0)