37 #ifndef NETTLE_AES_INTERNAL_H_INCLUDED
38 #define NETTLE_AES_INTERNAL_H_INCLUDED
48 # define AES_TABLE_SIZE 1
50 # define AES_TABLE_SIZE 4
80 #define B0(x) ((x) & 0xff)
81 #define B1(x) (((x) >> 8) & 0xff)
82 #define B2(x) (((x) >> 16) & 0xff)
83 #define B3(x) (((x) >> 24) & 0xff)
85 #define SUBBYTE(x, box) ((uint32_t)(box)[B0(x)] \
86 | ((uint32_t)(box)[B1(x)] << 8) \
87 | ((uint32_t)(box)[B2(x)] << 16) \
88 | ((uint32_t)(box)[B3(x)] << 24))
90 #define AES_ROUND(T, w0, w1, w2, w3, k) \
91 (( T->table[0][ B0(w0) ] \
92 ^ T->table[1][ B1(w1) ] \
93 ^ T->table[2][ B2(w2) ] \
94 ^ T->table[3][ B3(w3) ]) ^ (k))
96 #define AES_FINAL_ROUND(T, w0, w1, w2, w3, k) \
97 (( (uint32_t) T->sbox[ B0(w0) ] \
98 | ((uint32_t) T->sbox[ B1(w1) ] << 8) \
99 | ((uint32_t) T->sbox[ B2(w2) ] << 16) \
100 | ((uint32_t) T->sbox[ B3(w3) ] << 24)) ^ (k))
103 #define aes_sbox (_nettle_aes_encrypt_table.sbox)
const struct aes_table _nettle_aes_decrypt_table
void _nettle_aes_encrypt(unsigned rounds, const uint32_t *keys, const struct aes_table *T, size_t length, uint8_t *dst, const uint8_t *src)
const struct aes_table _nettle_aes_encrypt_table
void _nettle_aes_decrypt(unsigned rounds, const uint32_t *keys, const struct aes_table *T, size_t length, uint8_t *dst, const uint8_t *src)
void _nettle_aes_invert(unsigned rounds, uint32_t *dst, const uint32_t *src)
void _nettle_aes_set_key(unsigned nr, unsigned nk, uint32_t *subkeys, const uint8_t *key)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len key
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
static struct @218 keys[]
uint32_t table[AES_TABLE_SIZE][0x100]