COLUMN_0(clone) = COLUMN_0(pIn) ^ *roundkeyw++; COLUMN_1(clone) = COLUMN_1(pIn) ^ *roundkeyw++; COLUMN_2(clone) = COLUMN_2(pIn) ^ *roundkeyw++; COLUMN_3(clone) = COLUMN_3(pIn) ^ *roundkeyw++;
COLUMN_0(state) = *((PRUint32 *)(pIn     )) ^ *roundkeyw++; COLUMN_1(state) = *((PRUint32 *)(pIn + 4 )) ^ *roundkeyw++; COLUMN_2(state) = *((PRUint32 *)(pIn + 8 )) ^ *roundkeyw++; COLUMN_3(state) = *((PRUint32 *)(pIn + 12)) ^ *roundkeyw++;
rijndael_encryptBlock128(AESContext *cx,                          unsigned char *output,                         const unsigned char *input){    unsigned int r;    PRUint32 *roundkeyw;    PRUint8 clone[RIJNDAEL_MAX_STATE_SIZE];#if defined(_X86_)#define pIn input#define pOut output#else    unsigned char * pIn, *pOut;    PRUint32 inBuf[4], outBuf[4];    if ((ptrdiff_t)input & 0x3) {	memcpy(inBuf, input, sizeof inBuf);	pIn = (unsigned char *)inBuf;    } else {	pIn = (unsigned char *)input;    }    if ((ptrdiff_t)output & 0x3) {	pOut = (unsigned char *)outBuf;    } else {	pOut = (unsigned char *)output;    }#endif    roundkeyw = cx->expandedKey;    /* Step 1: Add Round Key 0 to initial state */    COLUMN_0(clone) = COLUMN_0(pIn) ^ *roundkeyw++;    COLUMN_1(clone) = COLUMN_1(pIn) ^ *roundkeyw++;    COLUMN_2(clone) = COLUMN_2(pIn) ^ *roundkeyw++;    COLUMN_3(clone) = COLUMN_3(pIn) ^ *roundkeyw++;    /* Step 2: Loop over rounds [1..NR-1] */    for (r=1; r<cx->Nr; ++r) {        /* Do ShiftRow, ByteSub, and MixColumn all at once */	COLUMN_0(pOut  ) = T0(STATE_BYTE(0))  ^	                   T1(STATE_BYTE(5))  ^	                   T2(STATE_BYTE(10)) ^	                   T3(STATE_BYTE(15));	COLUMN_1(pOut  ) = T0(STATE_BYTE(4))  ^	                   T1(STATE_BYTE(9))  ^	                   T2(STATE_BYTE(14)) ^	                   T3(STATE_BYTE(3));	COLUMN_2(pOut  ) = T0(STATE_BYTE(8))  ^	                   T1(STATE_BYTE(13)) ^	                   T2(STATE_BYTE(2))  ^	                   T3(STATE_BYTE(7));	COLUMN_3(pOut  ) = T0(STATE_BYTE(12)) ^	                   T1(STATE_BYTE(1))  ^	                   T2(STATE_BYTE(6))  ^	                   T3(STATE_BYTE(11));	/* Round key addition */	COLUMN_0(clone) = COLUMN_0(pOut  ) ^ *roundkeyw++;	COLUMN_1(clone) = COLUMN_1(pOut  ) ^ *roundkeyw++;	COLUMN_2(clone) = COLUMN_2(pOut  ) ^ *roundkeyw++;	COLUMN_3(clone) = COLUMN_3(pOut  ) ^ *roundkeyw++;    }    /* Step 3: Do the last round */    /* Final round does not employ MixColumn */    COLUMN_0(pOut  ) = ((BYTE0WORD(T2(STATE_BYTE(0))))   |                        (BYTE1WORD(T3(STATE_BYTE(5))))   |                        (BYTE2WORD(T0(STATE_BYTE(10))))  |                        (BYTE3WORD(T1(STATE_BYTE(15)))))  ^	                *roundkeyw++;    COLUMN_1(pOut  ) = ((BYTE0WORD(T2(STATE_BYTE(4))))   |                        (BYTE1WORD(T3(STATE_BYTE(9))))   |                        (BYTE2WORD(T0(STATE_BYTE(14))))  |                        (BYTE3WORD(T1(STATE_BYTE(3)))))   ^	                *roundkeyw++;    COLUMN_2(pOut  ) = ((BYTE0WORD(T2(STATE_BYTE(8))))   |                        (BYTE1WORD(T3(STATE_BYTE(13))))  |                        (BYTE2WORD(T0(STATE_BYTE(2))))   |                        (BYTE3WORD(T1(STATE_BYTE(7)))))   ^	                *roundkeyw++;    COLUMN_3(pOut  ) = ((BYTE0WORD(T2(STATE_BYTE(12))))  |                        (BYTE1WORD(T3(STATE_BYTE(1))))   |                        (BYTE2WORD(T0(STATE_BYTE(6))))   |                        (BYTE3WORD(T1(STATE_BYTE(11)))))  ^	                *roundkeyw++;#if defined(_X86_)#undef pIn#undef pOut#else    if ((ptrdiff_t)output & 0x3) {	memcpy(output, outBuf, sizeof outBuf);    }#endif    return SECSuccess;}