13#include "mvAesBoxes.dat"
25#define mul(aa, bb) (mask[bb] & Alogtable[aa + Logtable[bb]])
29 return mask[bb] & Alogtable[aa + Logtable[bb]];
140 for(
i = 0;
i < 4;
i++)
150 for(
j = 0;
j < 4;
j++){
156 for(
i = 0;
i < 4;
i++)
168 for(
j = 0;
j < 4;
j++){
174 for(
i = 0;
i < 4;
i++)
185 int i,
j,
t, rconpointer = 0;
189 case 128: KC = 4;
break;
190 case 192: KC = 6;
break;
191 case 256: KC = 8;
break;
192 default :
return (-1);
196 case 128: BC = 4;
break;
197 case 192: BC = 6;
break;
198 case 256: BC = 8;
break;
199 default :
return (-2);
202 switch (keyBits >= blockBits ? keyBits : blockBits) {
203 case 128: ROUNDS = 10;
break;
204 case 192: ROUNDS = 12;
break;
205 case 256: ROUNDS = 14;
break;
206 default :
return (-3);
210 for(
j = 0;
j < KC;
j++)
211 for(
i = 0;
i < 4;
i++)
215 for(
j = 0; (
j < KC) && (
t < (ROUNDS+1)*BC);
j++,
t++)
216 for(
i = 0;
i < 4;
i++)
W[
t / BC][
i][
t % BC] = tk[
i][
j];
218 while (
t < (ROUNDS+1)*BC) {
220 for(
i = 0;
i < 4;
i++)
221 tk[
i][0] ^=
S[tk[(
i+1)%4][KC-1]];
222 tk[0][0] ^=
rcon[rconpointer++];
225 for(
j = 1;
j < KC;
j++)
226 for(
i = 0;
i < 4;
i++) tk[
i][
j] ^= tk[
i][
j-1];
228 for(
j = 1;
j < KC/2;
j++)
229 for(
i = 0;
i < 4;
i++) tk[
i][
j] ^= tk[
i][
j-1];
230 for(
i = 0;
i < 4;
i++) tk[
i][KC/2] ^=
S[tk[
i][KC/2 - 1]];
231 for(
j = KC/2 + 1;
j < KC;
j++)
232 for(
i = 0;
i < 4;
i++) tk[
i][
j] ^= tk[
i][
j-1];
235 for(
j = 0; (
j < KC) && (
t < (ROUNDS+1)*BC);
j++,
t++)
236 for(
i = 0;
i < 4;
i++)
W[
t / BC][
i][
t % BC] = tk[
i][
j];
260 for(
r = 1;
r < ROUNDS;
r++) {
302 for(
r = ROUNDS-1;
r > 0;
r--) {
static const ulong32 rcon[]
GLdouble GLdouble GLdouble r
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
int rijndaelKeySched(MV_U8 k[4][MAXKC], int keyBits, int blockBits, MV_U8 W[MAXROUNDS+1][4][MAXBC])
void ShiftRow128Dec(MV_U8 a[4][MAXBC])
void ShiftRow128Enc(MV_U8 a[4][MAXBC])
int rijndaelEncrypt128(MV_U8 a[4][MAXBC], MV_U8 rk[MAXROUNDS+1][4][MAXBC], int rounds)
void Substitution(MV_U8 a[4][MAXBC], MV_U8 box[256])
void MixColumn(MV_U8 a[4][MAXBC], MV_U8 rk[4][MAXBC])
MV_U8 mul1(MV_U8 aa, MV_U8 bb)
int rijndaelDecrypt128(MV_U8 a[4][MAXBC], MV_U8 rk[MAXROUNDS+1][4][MAXBC], int rounds)
void InvMixColumn(MV_U8 a[4][MAXBC])
void KeyAddition(MV_U8 a[4][MAXBC], MV_U8 rk[4][MAXBC], MV_U8 BC)