Fossil SCM

Fix an #ifdef error in the sha3 implementation that caused suboptimal code for little-endian machines.

drh 2017-03-08 15:01 trunk
Commit e8b433321bbe4e2157358749cf0f52155f2755e0
1 file changed +1 -1
+1 -1
--- src/sha3.c
+++ src/sha3.c
@@ -428,11 +428,11 @@
428428
}
429429
}
430430
}
431431
#endif
432432
for(; i<nData; i++){
433
-#if SHA1_BYTEORDER==1234
433
+#if SHA3_BYTEORDER==1234
434434
p->u.x[p->nLoaded] ^= aData[i];
435435
#elif SHA3_BYTEORDER==4321
436436
p->u.x[p->nLoaded^0x07] ^= aData[i];
437437
#else
438438
p->u.x[p->nLoaded^p->ixMask] ^= aData[i];
439439
--- src/sha3.c
+++ src/sha3.c
@@ -428,11 +428,11 @@
428 }
429 }
430 }
431 #endif
432 for(; i<nData; i++){
433 #if SHA1_BYTEORDER==1234
434 p->u.x[p->nLoaded] ^= aData[i];
435 #elif SHA3_BYTEORDER==4321
436 p->u.x[p->nLoaded^0x07] ^= aData[i];
437 #else
438 p->u.x[p->nLoaded^p->ixMask] ^= aData[i];
439
--- src/sha3.c
+++ src/sha3.c
@@ -428,11 +428,11 @@
428 }
429 }
430 }
431 #endif
432 for(; i<nData; i++){
433 #if SHA3_BYTEORDER==1234
434 p->u.x[p->nLoaded] ^= aData[i];
435 #elif SHA3_BYTEORDER==4321
436 p->u.x[p->nLoaded^0x07] ^= aData[i];
437 #else
438 p->u.x[p->nLoaded^p->ixMask] ^= aData[i];
439

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button