17#ifndef CRACEN_SW_COMMON_H
18#define CRACEN_SW_COMMON_H
23#include <psa/crypto.h>
24#include <sxsymcrypt/keyref.h>
29#define CRACEN_SW_AES_BATCH_BLOCKS 8
48 const uint8_t *input,
size_t input_length, uint8_t *output,
49 size_t output_size,
size_t *output_length);
67 const uint8_t *input,
size_t input_length, uint8_t *output,
68 size_t output_size,
size_t *output_length);
85 const uint8_t *input, uint8_t *output);
108 uint8_t *counter,
size_t counter_start_pos, uint8_t *keystream,
109 size_t *keystream_offset,
const uint8_t *input, uint8_t *output,
132 uint8_t *mac_state, uint8_t *partial,
size_t *partial_len,
133 const uint8_t *input,
size_t length,
bool keep_last);
psa_status_t cracen_sw_increment_counter_be(uint8_t *ctr_buf, size_t ctr_buf_size, size_t start_pos)
Increment counter value stored as a big endian buffer.
psa_status_t cracen_sw_aes_ecb_decrypt(struct sxblkcipher *blkciph, const struct sxkeyref *key, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length)
Decrypt a single AES block using ECB mode.
void cracen_sw_encode_value_be(uint8_t *buffer, size_t buffer_size, size_t value, size_t value_size)
Encode value as big-endian, right-aligned in buffer.
psa_status_t cracen_sw_aes_ecb_encrypt(struct sxblkcipher *blkciph, const struct sxkeyref *key, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length)
Encrypt a single AES block using ECB mode.
psa_status_t cracen_sw_cbc_mac_update(struct sxblkcipher *blkciph, const struct sxkeyref *key, uint8_t *mac_state, uint8_t *partial, size_t *partial_len, const uint8_t *input, size_t length, bool keep_last)
CBC-MAC over a byte stream.
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)
AES-CTR encryption or decryption of a byte stream.
psa_status_t cracen_sw_aes_primitive(struct sxblkcipher *blkciph, const struct sxkeyref *key, const uint8_t *input, uint8_t *output)
Perform a single AES block encryption operation.