aversive_10-03-12/modules/crypto/aes/aes_core.c File Reference

#include <assert.h>
#include <aversive.h>
#include "aes_locl.h"
#include "aes.h"
#include <aversive/pgmspace.h>

Go to the source code of this file.

Defines

#define USE_PGMMEM
#define ROR_U32_1(a)   ( (((a)&0xff)<<24) ^ ((((a)>>8)&0xff)<<0) ^ ((((a)>>16)&0xff)<<8) ^ (((a)>>24)<<16) )
#define ROR_U32_2(a)   ( (((a)&0xff)<<16) ^ ((((a)>>8)&0xff)<<24) ^ ((((a)>>16)&0xff)<<0) ^ (((a)>>24)<<8) )
#define ROR_U32_3(a)   ( (((a)&0xff)<<8) ^ ((((a)>>8)&0xff)<<16) ^ ((((a)>>16)&0xff)<<24)^ (((a)>>24)<<0) )

Functions

int AES_set_encrypt_key (const unsigned char *userKey, const int bits, AES_KEY *key)
int AES_set_decrypt_key (const unsigned char *userKey, const int bits, AES_KEY *key)
void AES_encrypt (const unsigned char *in, unsigned char *out, const AES_KEY *key)
void AES_decrypt (const unsigned char *in, unsigned char *out, const AES_KEY *key)

Variables

prog_uint32_t Te0_ [256]
prog_uint8_t Te4_ [256]
prog_uint32_t Td0_ [256]
prog_uint8_t Td4_ [256]


Define Documentation

#define ROR_U32_1 ( a   )     ( (((a)&0xff)<<24) ^ ((((a)>>8)&0xff)<<0) ^ ((((a)>>16)&0xff)<<8) ^ (((a)>>24)<<16) )

Definition at line 67 of file aes_core.c.

Referenced by AES_decrypt(), AES_encrypt(), and AES_set_decrypt_key().

#define ROR_U32_2 ( a   )     ( (((a)&0xff)<<16) ^ ((((a)>>8)&0xff)<<24) ^ ((((a)>>16)&0xff)<<0) ^ (((a)>>24)<<8) )

Definition at line 68 of file aes_core.c.

Referenced by AES_decrypt(), AES_encrypt(), and AES_set_decrypt_key().

#define ROR_U32_3 ( a   )     ( (((a)&0xff)<<8) ^ ((((a)>>8)&0xff)<<16) ^ ((((a)>>16)&0xff)<<24)^ (((a)>>24)<<0) )

Definition at line 69 of file aes_core.c.

Referenced by AES_decrypt(), AES_encrypt(), and AES_set_decrypt_key().

#define USE_PGMMEM

Definition at line 36 of file aes_core.c.


Function Documentation

void AES_decrypt ( const unsigned char *  in,
unsigned char *  out,
const AES_KEY key 
)

Definition at line 677 of file aes_core.c.

References GETU32, PUTU32, aes_key_st::rd_key, ROR_U32_1, ROR_U32_2, ROR_U32_3, and aes_key_st::rounds.

void AES_encrypt ( const unsigned char *  in,
unsigned char *  out,
const AES_KEY key 
)

Definition at line 560 of file aes_core.c.

References GETU32, PUTU32, aes_key_st::rd_key, ROR_U32_1, ROR_U32_2, ROR_U32_3, and aes_key_st::rounds.

Referenced by AES_ctr128_encrypt().

int AES_set_decrypt_key ( const unsigned char *  userKey,
const int  bits,
AES_KEY key 
)

Expand the cipher key into the decryption key schedule.

Definition at line 508 of file aes_core.c.

References AES_set_encrypt_key(), aes_key_st::rd_key, ROR_U32_1, ROR_U32_2, ROR_U32_3, and aes_key_st::rounds.

int AES_set_encrypt_key ( const unsigned char *  userKey,
const int  bits,
AES_KEY key 
)

Expand the cipher key into the encryption key schedule.

Definition at line 407 of file aes_core.c.

References GETU32, aes_key_st::rd_key, and aes_key_st::rounds.

Referenced by AES_set_decrypt_key().


Variable Documentation

prog_uint32_t Td0_[256]

Definition at line 237 of file aes_core.c.

prog_uint8_t Td4_[256]

Definition at line 318 of file aes_core.c.

prog_uint32_t Te0_[256]

Definition at line 73 of file aes_core.c.

prog_uint8_t Te4_[256]

Definition at line 155 of file aes_core.c.


Generated on Fri Mar 12 06:32:05 2010 for AVR by  doxygen 1.5.6