File syn_port_aes.h¶
FileList > port > syn_port_aes.h
Go to the source code of this file
AES / GCM hardware acceleration port interface. More...
#include "../common/syn_defs.h"#include <stddef.h>#include <stdint.h>
Public Functions¶
| Type | Name |
|---|---|
| SYN_Status | syn_port_aes_decrypt_block (const uint8_t * round_keys, uint8_t nr, const uint8_t in, uint8_t out) Offload a single 16-byte block decryption to hardware. |
| SYN_Status | syn_port_aes_encrypt_block (const uint8_t * round_keys, uint8_t nr, const uint8_t in, uint8_t out) Offload a single 16-byte block encryption to hardware. |
| SYN_Status | syn_port_aes_init (void) Initialize the hardware AES/crypto accelerator. |
| SYN_Status | syn_port_ghash_mult (const uint8_t x, const uint8_t h, uint8_t out) Offload GHASH Galois field GF(2^128) multiplication to hardware. |
Detailed Description¶
Implement these functions to offload AES block cipher and GHASH field multiplication to microcontroller hardware security / cryptographic accelerators (e.g. STM32 CRYP, ESP32 hardware AES).
Enable via SYN_USE_PORT_AES in syn_config.h. When disabled or returning SYN_NOT_IMPLEMENTED, SyntropicOS automatically falls back to software calculation.
Public Functions Documentation¶
function syn_port_aes_decrypt_block¶
Offload a single 16-byte block decryption to hardware.
SYN_Status syn_port_aes_decrypt_block (
const uint8_t * round_keys,
uint8_t nr,
const uint8_t in,
uint8_t out
)
Parameters:
round_keysPointer to expanded round keys.nrNumber of rounds (10, 12, or 14).inInput 16-byte ciphertext block.outOutput 16-byte plaintext block.
Returns:
SYN_OK on success, SYN_NOT_IMPLEMENTED to use software AES.
function syn_port_aes_encrypt_block¶
Offload a single 16-byte block encryption to hardware.
SYN_Status syn_port_aes_encrypt_block (
const uint8_t * round_keys,
uint8_t nr,
const uint8_t in,
uint8_t out
)
Parameters:
round_keysPointer to expanded round keys.nrNumber of rounds (10, 12, or 14).inInput 16-byte plaintext block.outOutput 16-byte ciphertext block.
Returns:
SYN_OK on success, SYN_NOT_IMPLEMENTED to use software AES.
function syn_port_aes_init¶
Initialize the hardware AES/crypto accelerator.
Returns:
SYN_OK on success, SYN_NOT_IMPLEMENTED if hardware crypto is not available.
function syn_port_ghash_mult¶
Offload GHASH Galois field GF(2^128) multiplication to hardware.
Parameters:
xInput 16-byte block.hInput 16-byte subkey block.outOutput 16-byte product block.
Returns:
SYN_OK on success, SYN_NOT_IMPLEMENTED to use software GHASH.
The documentation for this class was generated from the following file src/syntropic/port/syn_port_aes.h