Skip to content

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_keys Pointer to expanded round keys.
  • nr Number of rounds (10, 12, or 14).
  • in Input 16-byte ciphertext block.
  • out Output 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_keys Pointer to expanded round keys.
  • nr Number of rounds (10, 12, or 14).
  • in Input 16-byte plaintext block.
  • out Output 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.

SYN_Status syn_port_aes_init (
    void
) 

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.

SYN_Status syn_port_ghash_mult (
    const uint8_t x,
    const uint8_t h,
    uint8_t out
) 

Parameters:

  • x Input 16-byte block.
  • h Input 16-byte subkey block.
  • out Output 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