PandA-2024.02
Macros | Functions | Variables
aes.c File Reference
#include "aes.h"
Include dependency graph for aes.c:

Go to the source code of this file.

Macros

#define F(x)   (((x)<<1) ^ ((((x)>>7) & 1) * 0x1b))
 
#define FD(x)   (((x) >> 1) ^ (((x) & 1) ? 0x8d : 0))
 
#define BACK_TO_TABLES
 
#define rj_sbox(x)   sbox[(x)]
 

Functions

uint8_t rj_xtime (uint8_t x)
 
void aes_subBytes (uint8_t *buf)
 
void aes_addRoundKey (uint8_t *buf, uint8_t *key)
 
void aes_addRoundKey_cpy (uint8_t *buf, uint8_t *key, uint8_t *cpk)
 
void aes_shiftRows (uint8_t *buf)
 
void aes_mixColumns (uint8_t *buf)
 
void aes_expandEncKey (uint8_t *k, uint8_t *rc)
 
void aes256_encrypt_ecb (aes256_context *ctx, uint8_t k[32], uint8_t buf[16])
 

Variables

const uint8_t sbox [256]
 

Macro Definition Documentation

◆ BACK_TO_TABLES

#define BACK_TO_TABLES

Definition at line 10 of file aes.c.

◆ F

#define F (   x)    (((x)<<1) ^ ((((x)>>7) & 1) * 0x1b))

Definition at line 7 of file aes.c.

Referenced by __attribute__(), aes_expandEncKey(), and main().

◆ FD

#define FD (   x)    (((x) >> 1) ^ (((x) & 1) ? 0x8d : 0))

Definition at line 8 of file aes.c.

Referenced by getFunctionType(), and HWCallInjection::InternalExec().

◆ rj_sbox

#define rj_sbox (   x)    sbox[(x)]

Definition at line 48 of file aes.c.

Referenced by aes_expandEncKey(), and aes_subBytes().

Function Documentation

◆ aes256_encrypt_ecb()

void aes256_encrypt_ecb ( aes256_context ctx,
uint8_t  k[32],
uint8_t  buf[16] 
)

Definition at line 176 of file aes.c.

References aes_addRoundKey(), aes_addRoundKey_cpy(), aes_expandEncKey(), aes_mixColumns(), aes_shiftRows(), aes_subBytes(), aes256_context::deckey, aes256_context::enckey, and aes256_context::key.

Referenced by main(), and run_benchmark().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aes_addRoundKey()

void aes_addRoundKey ( uint8_t *  buf,
uint8_t *  key 
)

Definition at line 110 of file aes.c.

Referenced by aes256_encrypt_ecb().

Here is the caller graph for this function:

◆ aes_addRoundKey_cpy()

void aes_addRoundKey_cpy ( uint8_t *  buf,
uint8_t *  key,
uint8_t *  cpk 
)

Definition at line 118 of file aes.c.

Referenced by aes256_encrypt_ecb().

Here is the caller graph for this function:

◆ aes_expandEncKey()

void aes_expandEncKey ( uint8_t *  k,
uint8_t *  rc 
)

Definition at line 153 of file aes.c.

References 15_onnx_build::exp2, F, and rj_sbox.

Referenced by aes256_encrypt_ecb().

Here is the caller graph for this function:

◆ aes_mixColumns()

void aes_mixColumns ( uint8_t *  buf)

Definition at line 139 of file aes.c.

References rj_xtime().

Referenced by aes256_encrypt_ecb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aes_shiftRows()

void aes_shiftRows ( uint8_t *  buf)

Definition at line 127 of file aes.c.

Referenced by aes256_encrypt_ecb().

Here is the caller graph for this function:

◆ aes_subBytes()

void aes_subBytes ( uint8_t *  buf)

Definition at line 102 of file aes.c.

References rj_sbox.

Referenced by aes256_encrypt_ecb().

Here is the caller graph for this function:

◆ rj_xtime()

uint8_t rj_xtime ( uint8_t  x)

Definition at line 96 of file aes.c.

Referenced by aes_mixColumns().

Here is the caller graph for this function:

Variable Documentation

◆ sbox

const uint8_t sbox[256]

Definition at line 13 of file aes.c.


Generated on Mon Feb 12 2024 13:03:06 for PandA-2024.02 by doxygen 1.8.13