![]() |
nRF Connect SDK API 3.4.99
|
| psa_status_t cracen_sw_ctr_xor | ( | struct sxblkcipher * | blkciph, |
| const struct sxkeyref * | key, | ||
| uint8_t * | counter, | ||
| size_t | counter_start_pos, | ||
| uint8_t * | keystream, | ||
| size_t * | keystream_offset, | ||
| const uint8_t * | input, | ||
| uint8_t * | output, | ||
| size_t | length ) |
#include <cracen_sw_common.h>
AES-CTR encryption or decryption of a byte stream.
Uses up the buffered keystream block first, then runs whole blocks with up to CRACEN_SW_AES_BATCH_BLOCKS blocks per CRACEN job, and buffers the keystream of a final partial block for the next call. The counter wraps modulo the size of its field. CRACEN must be reserved by the caller, as for cracen_sw_aes_primitive().
| blkciph | Block cipher struct. |
| key | The AES key reference. |
| counter | Counter block for the next keystream block, advanced as used. |
| counter_start_pos | Index of the first counter byte in counter. |
| keystream | Buffered keystream block (16 bytes). |
| keystream_offset | Bytes of keystream already used, 16 if none is left. |
| input | Input. |
| output | Output, may be the same as input. |
| length | Number of bytes. |
| psa_status_t | PSA_SUCCESS on success, error code otherwise. |