Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

Macros | Typedefs | Functions
AES.c File Reference

Macros

#define byte3(x)   (x & 0xff) /*Primo byte di dx*/
 
#define byte2(x)   ((x >> 8) & 0xff) /*Secondo byte da dx*/
 
#define byte1(x)   ((x >> 16) & 0xff) /*Secondo byte da sx*/
 
#define byte0(x)   (x >> 24) /*il byte più significativo*/
 
#define WORD8_TO_WORD32(b0, b1, b2, b3)   ((WORD32)(b0) << 24 | (WORD32)(b1) << 16 | (WORD32)(b2) << 8 | (b3))
 
#define Xtime(x)   ((((x) & 0x7f7f7f7f) << 1) ^ ((((x) & 0x80808080) >> 7) * 0x0000001b))
 

Typedefs

typedef unsigned char WORD8
 
typedef unsigned int WORD32
 

Functions

void keyschedule (WORD32 *key, WORD32 *exp)
 
void encryptblock (WORD32 *input_pointer, WORD32 *output_pointer, WORD32 *expkey)
 
void decryptblock (WORD32 *input_pointer, WORD32 *output_pointer, WORD32 *expkey)
 
int main ()
 

Macro Definition Documentation

#define byte0 (   x)    (x >> 24) /*il byte più significativo*/

Referenced by decryptblock(), and encryptblock().

#define byte1 (   x)    ((x >> 16) & 0xff) /*Secondo byte da sx*/

Referenced by decryptblock(), and encryptblock().

#define byte2 (   x)    ((x >> 8) & 0xff) /*Secondo byte da dx*/

Referenced by decryptblock(), and encryptblock().

#define byte3 (   x)    (x & 0xff) /*Primo byte di dx*/
#define WORD8_TO_WORD32 (   b0,
  b1,
  b2,
  b3 
)    ((WORD32)(b0) << 24 | (WORD32)(b1) << 16 | (WORD32)(b2) << 8 | (b3))

Referenced by decryptblock(), and encryptblock().

#define Xtime (   x)    ((((x) & 0x7f7f7f7f) << 1) ^ ((((x) & 0x80808080) >> 7) * 0x0000001b))

Referenced by decryptblock(), and encryptblock().

Typedef Documentation

typedef unsigned int WORD32
typedef unsigned char WORD8

Function Documentation

void decryptblock ( WORD32 input_pointer,
WORD32 output_pointer,
WORD32 expkey 
)

References byte0, byte1, byte2, byte3, r, s1, s3, WORD8_TO_WORD32, and Xtime.

void encryptblock ( WORD32 input_pointer,
WORD32 output_pointer,
WORD32 expkey 
)

References byte0, byte1, byte2, byte3, r, s1, s3, WORD8_TO_WORD32, and Xtime.

void keyschedule ( WORD32 key,
WORD32 exp 
)

References byte3, and i.

int main ( void  )

References decryptblock(), encryptblock(), i, and keyschedule().

Here is the call graph for this function: