We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6617863 + 296148b commit 3e0679eCopy full SHA for 3e0679e
1 file changed
wolfcrypt/src/sha3.c
@@ -615,19 +615,8 @@ static word64 Load64BitLittleEndian(const byte* a)
615
return n;
616
}
617
#elif defined(WC_SHA3_FAULT_HARDEN)
618
-static WC_INLINE word64 Load64Unaligned(const unsigned char *a)
619
-{
620
-#ifdef WC_64BIT_CPU
621
- return *(word64*)a;
622
-#elif defined(WC_32BIT_CPU)
623
- return (((word64)((word32*)a)[1]) << 32) |
624
- ((word32*)a)[0];
625
-#else
626
- return (((word64)((word16*)a)[3]) << 48) |
627
- (((word64)((word16*)a)[2]) << 32) |
628
- (((word64)((word16*)a)[1]) << 16) |
629
- ((word16*)a)[0];
630
-#endif
+static WC_INLINE word64 Load64Unaligned(const unsigned char *a) {
+ return readUnalignedWord64(a);
631
632
633
/* Convert the array of bytes, in little-endian order, to a 64-bit integer.
0 commit comments