(original) (raw)

changeset: 103220:68df416e94ba user: Christian Heimes christian@python.org date: Wed Sep 07 13:01:15 2016 +0200 files: Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c description: Issue #16113: take 2 on big endian machines. diff -r e8884dcace9f -r 68df416e94ba Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c --- a/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c Wed Sep 07 12:51:56 2016 +0200 +++ b/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c Wed Sep 07 13:01:15 2016 +0200 @@ -188,17 +188,18 @@ unsigned int lanePosition; for(lanePosition=0; lanePosition<lanecount; laneposition++)="" {="" uint8="" laneasbytes[8];="" +="" uint32="" low,="" high,="" temp,="" temp0,="" temp1;="" *stateashalflanes;="" memcpy(laneasbytes,="" data+laneposition*8,="" 8);="" -="" low="laneAsBytes[0]" |="" ((uint32)(laneasbytes[1])="" <<="" 8)="" ((uint32)(laneasbytes[2])="" 16)="" ((uint32)(laneasbytes[3])="" 24);="" high="laneAsBytes[4]" ((uint32)(laneasbytes[5])="" ((uint32)(laneasbytes[6])="" ((uint32)(laneasbytes[7])="" even,="" odd,="" *stateashalflanes="(UINT32*)state;" stateashalflanes="(UINT32*)state;" tobitinterleavingandxor(low,="" stateashalflanes[laneposition*2+0],="" stateashalflanes[laneposition*2+1],="" temp1);="" }="" #endif="" @@="" -243,17="" +244,18="" unsigned="" int="" laneposition;="" for(laneposition="0;" laneposition<lanecount;="" tobitinterleavingandset(low,="" -406,8="" +408,8="" frombitinterleaving(stateashalflanes[laneposition*2],="" laneasbytes[0]="low" &="" 0xff;="" laneasbytes[1]="(low">> 8) & 0xFF; laneAsBytes[2] = (low >> 16) & 0xFF; </lanecount;>/christian@python.org