aes.h
author Ryan C. Gordon <icculus@icculus.org>
Sun, 18 Jun 2017 01:55:23 -0400
changeset 52 7f21abb9ff17
parent 0 d7ee4e2ed49d
permissions -rw-r--r--
Made the SHA1 code more stdint-friendly.
icculus@0
     1
#ifndef _INCL_AES_H_
icculus@0
     2
#define _INCL_AES_H_
icculus@0
     3
icculus@0
     4
#include <stdint.h>
icculus@0
     5
icculus@0
     6
// AES-128 only supports Nb=4
icculus@0
     7
#define aesNb 4			// number of columns in the state & expanded key
icculus@0
     8
#define aesNk 4			// number of columns in a key
icculus@0
     9
#define aesNr 10			// number of rounds in encryption
icculus@0
    10
icculus@0
    11
#define aesExpandedKeySize (4 * aesNb * (aesNr + 1))
icculus@0
    12
void aesExpandKey(const uint8_t *key, uint8_t *expkey);
icculus@0
    13
icculus@0
    14
// these do one 128-bit block at a time.
icculus@0
    15
void aesEncrypt (uint8_t *in, uint8_t *expkey, uint8_t *out);
icculus@0
    16
void aesDecrypt (uint8_t *in, uint8_t *expkey, uint8_t *out);
icculus@0
    17
icculus@0
    18
#endif