COLUMN_3(clone) = COLUMN_3(pIn) ^ *roundkeyw--; COLUMN_2(clone) = COLUMN_2(pIn) ^ *roundkeyw--; COLUMN_1(clone) = COLUMN_1(pIn) ^ *roundkeyw--; COLUMN_0(clone) = COLUMN_0(pIn) ^ *roundkeyw--;
COLUMN_3(state) = *((PRUint32 *)(pIn + 12)) ^ *roundkeyw--; COLUMN_2(state) = *((PRUint32 *)(pIn +  8)) ^ *roundkeyw--; COLUMN_1(state) = *((PRUint32 *)(pIn +  4)) ^ *roundkeyw--; COLUMN_0(state) = *((PRUint32 *)(pIn     )) ^ *roundkeyw--;
rijndael_decryptBlock128(AESContext *cx,                          unsigned char *output,                         const unsigned char *input){    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 + cx->Nb * cx->Nr + 3;    /* reverse the final key addition */    COLUMN_3(clone) = COLUMN_3(pIn) ^ *roundkeyw--;    COLUMN_2(clone) = COLUMN_2(pIn) ^ *roundkeyw--;    COLUMN_1(clone) = COLUMN_1(pIn) ^ *roundkeyw--;    COLUMN_0(clone) = COLUMN_0(pIn) ^ *roundkeyw--;    /* Loop over rounds in reverse [NR..1] */    for (r=cx->Nr; r>1; --r) {	/* Invert the (InvByteSub*InvMixColumn)(InvShiftRow(state)) */	COLUMN_0(pOut)   = TInv0(STATE_BYTE(0))  ^	                   TInv1(STATE_BYTE(13)) ^	                   TInv2(STATE_BYTE(10)) ^	                   TInv3(STATE_BYTE(7));	COLUMN_1(pOut)   = TInv0(STATE_BYTE(4))  ^	                   TInv1(STATE_BYTE(1))  ^	                   TInv2(STATE_BYTE(14)) ^	                   TInv3(STATE_BYTE(11));	COLUMN_2(pOut)   = TInv0(STATE_BYTE(8))  ^	                   TInv1(STATE_BYTE(5))  ^	                   TInv2(STATE_BYTE(2))  ^	                   TInv3(STATE_BYTE(15));	COLUMN_3(pOut)   = TInv0(STATE_BYTE(12)) ^	                   TInv1(STATE_BYTE(9))  ^	                   TInv2(STATE_BYTE(6))  ^	                   TInv3(STATE_BYTE(3));	/* Invert the key addition step */	COLUMN_3(clone) = COLUMN_3(pOut) ^ *roundkeyw--;	COLUMN_2(clone) = COLUMN_2(pOut) ^ *roundkeyw--;	COLUMN_1(clone) = COLUMN_1(pOut) ^ *roundkeyw--;	COLUMN_0(clone) = COLUMN_0(pOut) ^ *roundkeyw--;    }    /* inverse sub */    pOut[ 0] = SINV(clone[ 0]);    pOut[ 1] = SINV(clone[13]);    pOut[ 2] = SINV(clone[10]);    pOut[ 3] = SINV(clone[ 7]);    pOut[ 4] = SINV(clone[ 4]);    pOut[ 5] = SINV(clone[ 1]);    pOut[ 6] = SINV(clone[14]);    pOut[ 7] = SINV(clone[11]);    pOut[ 8] = SINV(clone[ 8]);    pOut[ 9] = SINV(clone[ 5]);    pOut[10] = SINV(clone[ 2]);    pOut[11] = SINV(clone[15]);    pOut[12] = SINV(clone[12]);    pOut[13] = SINV(clone[ 9]);    pOut[14] = SINV(clone[ 6]);    pOut[15] = SINV(clone[ 3]);    /* final key addition */    COLUMN_3(pOut) ^= *roundkeyw--;    COLUMN_2(pOut) ^= *roundkeyw--;    COLUMN_1(pOut) ^= *roundkeyw--;    COLUMN_0(pOut) ^= *roundkeyw--;#if defined(_X86_)#undef pIn#undef pOut#else    if ((ptrdiff_t)output & 0x3) {	memcpy(output, outBuf, sizeof outBuf);    }#endif    return SECSuccess;}