From 1a3fd5eeb9a5859aefedb9302adb6ecd6a1873a7 Mon Sep 17 00:00:00 2001 From: Ben Fuhrmannek Date: Wed, 12 Oct 2016 14:57:47 +0200 Subject: comments and whitespace cleanup --- aes.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'aes.c') diff --git a/aes.c b/aes.c index b44d88b..ca56cd9 100644 --- a/aes.c +++ b/aes.c @@ -2,7 +2,7 @@ Written by Mike Scott 21st April 1999 mike@compapp.dcu.ie - An alternative faster version is implemented in MIRACL + An alternative faster version is implemented in MIRACL ftp://ftp.computing.dcu.ie/pub/crypto/miracl.zip Copyright (c) 1999 Mike Scott @@ -18,15 +18,15 @@ See rijndael documentation. The code follows the documentation as closely as possible, and where possible uses the same function and variable names. - Permission for free direct or derivative use is granted subject - to compliance with any conditions that the originators of the - algorithm place on its exploitation. + Permission for free direct or derivative use is granted subject + to compliance with any conditions that the originators of the + algorithm place on its exploitation. Inspiration from Brian Gladman's implementation is acknowledged. Written for clarity, rather than speed. Assumes long is 32 bit quantity. - Full implementation. + Full implementation. Endian indifferent. */ @@ -95,14 +95,14 @@ static WORD SubByte(WORD a) b[1]=fbsub[b[1]]; b[2]=fbsub[b[2]]; b[3]=fbsub[b[3]]; - return pack(b); + return pack(b); } static BYTE product(WORD x,WORD y) { /* dot product of two 4-byte arrays */ BYTE xb[4],yb[4]; unpack(x,xb); - unpack(y,yb); + unpack(y,yb); return bmul(xb[0],yb[0])^bmul(xb[1],yb[1])^bmul(xb[2],yb[2])^bmul(xb[3],yb[3]); } @@ -143,13 +143,13 @@ void suhosin_aes_gentables() ltab[0]=0; ptab[0]=1; ltab[1]=0; - ptab[1]=3; ltab[3]=1; + ptab[1]=3; ltab[3]=1; for (i=2;i<256;i++) { ptab[i]=ptab[i-1]^xtime(ptab[i-1]); ltab[ptab[i]]=i; } - + /* affine transformation:- each bit is xored with itself shifted one bit */ fbsub[0]=0x63; @@ -212,7 +212,7 @@ void suhosin_aes_gkey(int nb,int nk,char *key) } N=Nb*(Nr+1); - + for (i=j=0;i>8)])^ ROTL16((WORD)fbsub[(BYTE)(x[SUHOSIN7_G(fi)[m+1]]>>16)])^ ROTL24((WORD)fbsub[x[SUHOSIN7_G(fi)[m+2]]>>24]); - } + } for (i=j=0;i>8)])^ ROTL16((WORD)rbsub[(BYTE)(x[SUHOSIN7_G(ri)[m+1]]>>16)])^ ROTL24((WORD)rbsub[x[SUHOSIN7_G(ri)[m+2]]>>24]); - } + } for (i=j=0;i