Salmon
Loading...
Searching...
No Matches
salmon-aes.h File Reference

Encrypt and decrypt data with AES-256 in CTR mode using pure C. More...

Go to the source code of this file.

Functions

void aes_key_expand (const unsigned char *key, unsigned char *expandedKey)
 
void aes_transform (const unsigned char *expandedKey, unsigned char *data)
 
int aes_transform_ctr (const unsigned char *expandedKey, unsigned char *counter, const unsigned char *srcBuffer, int srcOffset, unsigned char *destBuffer, int destOffset, int count)
 

Detailed Description

Encrypt and decrypt data with AES-256 in CTR mode using pure C.

Function Documentation

◆ aes_key_expand()

void aes_key_expand ( const unsigned char * key,
unsigned char * expandedKey )

Expand an AES-256 32-byte key to a 240-byte set of round keys.

Parameters
keyThe AES-256 (32-byte) key to expand.
expandedKeyThe expanded key (240-bytes).

◆ aes_transform()

void aes_transform ( const unsigned char * expandedKey,
unsigned char * data )

Transform a 16-byte block using AES-256.

Parameters
expandedKeyThe expandedKey 240 bytes, see aes_key_expand()
dataThe data to transform.

◆ aes_transform_ctr()

int aes_transform_ctr ( const unsigned char * expandedKey,
unsigned char * counter,
const unsigned char * srcBuffer,
int srcOffset,
unsigned char * destBuffer,
int destOffset,
int count )

Transform the data using AES-256 CTR mode.

Parameters
expandedKeyThe expanded AES-256 key (240 bytes), see aes_key_expand()
counterThe counter.
srcBufferThe source array to transform.
srcOffsetThe source offset.
destBufferThe source array to transform.
destOffsetThe destination offset
countThe number of bytes to transform
Returns
The number of bytes transformed.