libnx  v4.7.0
Data Structures | Macros | Functions
aes.h File Reference

Hardware accelerated AES-ECB implementation. More...

#include "../types.h"

Go to the source code of this file.

Data Structures

struct  Aes128Context
 Context for AES-128 operations. More...
 
struct  Aes192Context
 Context for AES-192 operations. More...
 
struct  Aes256Context
 Context for AES-256 operations. More...
 

Macros

#define AES_BLOCK_SIZE   0x10
 
#define AES_128_KEY_SIZE   0x10
 
#define AES_128_U32_PER_KEY   (AES_128_KEY_SIZE / sizeof(u32))
 
#define AES_128_NUM_ROUNDS   10
 
#define AES_192_KEY_SIZE   0x18
 
#define AES_192_U32_PER_KEY   (AES_192_KEY_SIZE / sizeof(u32))
 
#define AES_192_NUM_ROUNDS   12
 
#define AES_256_KEY_SIZE   0x20
 
#define AES_256_U32_PER_KEY   (AES_256_KEY_SIZE / sizeof(u32))
 
#define AES_256_NUM_ROUNDS   14
 

Functions

void aes128ContextCreate (Aes128Context *out, const void *key, bool is_encryptor)
 Initialize a 128-bit AES context.
 
void aes128EncryptBlock (const Aes128Context *ctx, void *dst, const void *src)
 Encrypt using an AES context (Requires is_encryptor when initializing)
 
void aes128DecryptBlock (const Aes128Context *ctx, void *dst, const void *src)
 Decrypt using an AES context (Requires !is_encryptor when initializing)
 
void aes192ContextCreate (Aes192Context *out, const void *key, bool is_encryptor)
 Initialize a 192-bit AES context.
 
void aes192EncryptBlock (const Aes192Context *ctx, void *dst, const void *src)
 Encrypt using an AES context (Requires is_encryptor when initializing)
 
void aes192DecryptBlock (const Aes192Context *ctx, void *dst, const void *src)
 Decrypt using an AES context (Requires !is_encryptor when initializing)
 
void aes256ContextCreate (Aes256Context *out, const void *key, bool is_encryptor)
 Initialize a 256-bit AES context.
 
void aes256EncryptBlock (const Aes256Context *ctx, void *dst, const void *src)
 Encrypt using an AES context (Requires is_encryptor when initializing)
 
void aes256DecryptBlock (const Aes256Context *ctx, void *dst, const void *src)
 Decrypt using an AES context (Requires !is_encryptor when initializing)
 

Detailed Description

Hardware accelerated AES-ECB implementation.