| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 393b82e commit fa15c85
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -188,17 +188,18 @@ void KeccakP1600_AddLanes(void *state, const unsigned char *data, unsigned int l | |||
| 188 | 188 | unsigned int lanePosition; | |
| 189 | 189 | for(lanePosition=0; lanePosition<laneCount; lanePosition++) { | |
| 190 | 190 | UINT8 laneAsBytes[8]; | |
| 191 | + UINT32 low, high, temp, temp0, temp1; | ||
| 192 | + UINT32 *stateAsHalfLanes; | ||
| 191 | 193 | memcpy(laneAsBytes, data+lanePosition*8, 8); | |
| 192 | - UINT32 low = laneAsBytes[0] | ||
| 194 | + low = laneAsBytes[0] | ||
| 193 | 195 | | ((UINT32)(laneAsBytes[1]) << 8) | |
| 194 | 196 | | ((UINT32)(laneAsBytes[2]) << 16) | |
| 195 | 197 | | ((UINT32)(laneAsBytes[3]) << 24); | |
| 196 | - UINT32 high = laneAsBytes[4] | ||
| 198 | + high = laneAsBytes[4] | ||
| 197 | 199 | | ((UINT32)(laneAsBytes[5]) << 8) | |
| 198 | 200 | | ((UINT32)(laneAsBytes[6]) << 16) | |
| 199 | 201 | | ((UINT32)(laneAsBytes[7]) << 24); | |
| 200 | - UINT32 even, odd, temp, temp0, temp1; | ||
| 201 | - UINT32 *stateAsHalfLanes = (UINT32*)state; | ||
| 202 | + stateAsHalfLanes = (UINT32*)state; | ||
| 202 | 203 | toBitInterleavingAndXOR(low, high, stateAsHalfLanes[lanePosition*2+0], stateAsHalfLanes[lanePosition*2+1], temp, temp0, temp1); | |
| 203 | 204 | } | |
| 204 | 205 | #endif | |
@@ -243,17 +244,18 @@ void KeccakP1600_OverwriteLanes(void *state, const unsigned char *data, unsigned | |||
| 243 | 244 | unsigned int lanePosition; | |
| 244 | 245 | for(lanePosition=0; lanePosition<laneCount; lanePosition++) { | |
| 245 | 246 | UINT8 laneAsBytes[8]; | |
| 247 | + UINT32 low, high, temp, temp0, temp1; | ||
| 248 | + UINT32 *stateAsHalfLanes; | ||
| 246 | 249 | memcpy(laneAsBytes, data+lanePosition*8, 8); | |
| 247 | - UINT32 low = laneAsBytes[0] | ||
| 250 | + low = laneAsBytes[0] | ||
| 248 | 251 | | ((UINT32)(laneAsBytes[1]) << 8) | |
| 249 | 252 | | ((UINT32)(laneAsBytes[2]) << 16) | |
| 250 | 253 | | ((UINT32)(laneAsBytes[3]) << 24); | |
| 251 | - UINT32 high = laneAsBytes[4] | ||
| 254 | + high = laneAsBytes[4] | ||
| 252 | 255 | | ((UINT32)(laneAsBytes[5]) << 8) | |
| 253 | 256 | | ((UINT32)(laneAsBytes[6]) << 16) | |
| 254 | 257 | | ((UINT32)(laneAsBytes[7]) << 24); | |
| 255 | - UINT32 even, odd, temp, temp0, temp1; | ||
| 256 | - UINT32 *stateAsHalfLanes = (UINT32*)state; | ||
| 258 | + stateAsHalfLanes = (UINT32*)state; | ||
| 257 | 259 | toBitInterleavingAndSet(low, high, stateAsHalfLanes[lanePosition*2+0], stateAsHalfLanes[lanePosition*2+1], temp, temp0, temp1); | |
| 258 | 260 | } | |
| 259 | 261 | #endif | |
@@ -406,8 +408,8 @@ void KeccakP1600_ExtractAndAddLanes(const void *state, const unsigned char *inpu | |||
| 406 | 408 | for(lanePosition=0; lanePosition<laneCount; lanePosition++) { | |
| 407 | 409 | UINT32 *stateAsHalfLanes = (UINT32*)state; | |
| 408 | 410 | UINT32 low, high, temp, temp0, temp1; | |
| 409 | - fromBitInterleaving(stateAsHalfLanes[lanePosition*2], stateAsHalfLanes[lanePosition*2+1], low, high, temp, temp0, temp1); | ||
| 410 | 411 | UINT8 laneAsBytes[8]; | |
| 412 | + fromBitInterleaving(stateAsHalfLanes[lanePosition*2], stateAsHalfLanes[lanePosition*2+1], low, high, temp, temp0, temp1); | ||
| 411 | 413 | laneAsBytes[0] = low & 0xFF; | |
| 412 | 414 | laneAsBytes[1] = (low >> 8) & 0xFF; | |
| 413 | 415 | laneAsBytes[2] = (low >> 16) & 0xFF; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments