Coda Distributed File System
Macros | Functions
rijndael-alg-fst.c File Reference
#include <assert.h>
#include <stdlib.h>
#include "rijndael-alg-fst.h"
Include dependency graph for rijndael-alg-fst.c:

Macros

#define ROTL(x, n)   (((x) << (n)) | ((x) >> (32 - (n))))
 
#define ROTR(x, n)   (((x) >> (n)) | ((x) << (32 - (n))))
 
#define BYTESWAP(x)
 
#define GETU32(p)   BYTESWAP(*((u32 *)(p)))
 
#define PUTU32(ct, st)   { *((u32 *)(ct)) = BYTESWAP(st); }
 

Functions

int rijndaelKeySetupEnc (u32 rk[], const u8 cipherKey[], int keyBits)
 
int rijndaelKeySetupDec (u32 rk[], const u8 cipherKey[], int keyBits)
 
void rijndaelEncrypt (const u32 rk[], int Nr, const u8 pt[16], u8 ct[16])
 
void rijndaelDecrypt (const u32 rk[], int Nr, const u8 ct[16], u8 pt[16])
 

Macro Definition Documentation

◆ BYTESWAP

#define BYTESWAP (   x)
Value:
((ROTR((x), 8) & 0xff00ff00L) | \
(ROTL((x), 8) & 0x00ff00ffL))
x
Definition: pwdtopdbtool.py:40
#define ROTR(x, n)
Definition: rijndael-alg-fst.c:728
#define ROTL(x, n)
Definition: rijndael-alg-fst.c:727

◆ GETU32

#define GETU32 (   p)    BYTESWAP(*((u32 *)(p)))

◆ PUTU32

#define PUTU32 (   ct,
  st 
)    { *((u32 *)(ct)) = BYTESWAP(st); }

◆ ROTL

#define ROTL (   x,
 
)    (((x) << (n)) | ((x) >> (32 - (n))))

◆ ROTR

#define ROTR (   x,
 
)    (((x) >> (n)) | ((x) << (32 - (n))))

Function Documentation

◆ rijndaelDecrypt()

void rijndaelDecrypt ( const u32  rk[],
int  Nr,
const u8  ct[16],
u8  pt[16] 
)

◆ rijndaelEncrypt()

void rijndaelEncrypt ( const u32  rk[],
int  Nr,
const u8  pt[16],
u8  ct[16] 
)

◆ rijndaelKeySetupDec()

int rijndaelKeySetupDec ( u32  rk[],
const u8  cipherKey[],
int  keyBits 
)

Expand the cipher key into the decryption key schedule.

Returns
the number of rounds for the given cipher key size.

◆ rijndaelKeySetupEnc()

int rijndaelKeySetupEnc ( u32  rk[],
const u8  cipherKey[],
int  keyBits 
)

Expand the cipher key into the encryption key schedule.

Returns
the number of rounds for the given cipher key size.