mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
@@ -187,11 +187,32 @@ WC_STATIC WC_INLINE word32 ByteReverseWord32(word32 value)
|
|||||||
WC_STATIC WC_INLINE void ByteReverseWords(word32* out, const word32* in,
|
WC_STATIC WC_INLINE void ByteReverseWords(word32* out, const word32* in,
|
||||||
word32 byteCount)
|
word32 byteCount)
|
||||||
{
|
{
|
||||||
word32 count = byteCount/(word32)sizeof(word32), i;
|
word32 count, i;
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
#ifdef WOLFSSL_USE_ALIGN
|
||||||
out[i] = ByteReverseWord32(in[i]);
|
if ((((size_t)in & 0x3) == 0) &&
|
||||||
|
(((size_t)out & 0x3) == 0))
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
count = byteCount/(word32)sizeof(word32);
|
||||||
|
for (i = 0; i < count; i++)
|
||||||
|
out[i] = ByteReverseWord32(in[i]);
|
||||||
|
#ifdef WOLFSSL_USE_ALIGN
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
byte *in_bytes = (byte *)in;
|
||||||
|
byte *out_bytes = (byte *)out;
|
||||||
|
word32 scratch;
|
||||||
|
|
||||||
|
byteCount &= ~0x3U;
|
||||||
|
|
||||||
|
for (i = 0; i < byteCount; i += sizeof(word32)) {
|
||||||
|
XMEMCPY(&scratch, in_bytes + i, sizeof(scratch));
|
||||||
|
scratch = ByteReverseWord32(scratch);
|
||||||
|
XMEMCPY(out_bytes + i, &scratch, sizeof(scratch));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WORD64_AVAILABLE) && !defined(WOLFSSL_NO_WORD64_OPS)
|
#if defined(WORD64_AVAILABLE) && !defined(WOLFSSL_NO_WORD64_OPS)
|
||||||
|
@@ -766,10 +766,10 @@ WOLFSSL_ABI WOLFSSL_API int wolfCrypt_Cleanup(void);
|
|||||||
|
|
||||||
#elif defined(WOLFSSL_DEOS) || defined(WOLFSSL_DEOS_RTEMS)
|
#elif defined(WOLFSSL_DEOS) || defined(WOLFSSL_DEOS_RTEMS)
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#ifndef XTIME
|
#ifndef XTIME
|
||||||
extern time_t deos_time(time_t* timer);
|
extern time_t deos_time(time_t* timer);
|
||||||
#define XTIME(t1) deos_time((t1))
|
#define XTIME(t1) deos_time((t1))
|
||||||
#endif
|
#endif
|
||||||
#elif defined(MICRIUM)
|
#elif defined(MICRIUM)
|
||||||
#include <clk.h>
|
#include <clk.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
Reference in New Issue
Block a user