Dtls13GetRnMask: Correctly get chacha counter on BE systems

The issue was that BIG_ENDIAN is defined in endian.h (on linux). Our define is BIG_ENDIAN_ORDER.
This commit is contained in:
Juliusz Sosinowicz
2023-07-21 14:48:28 +02:00
parent d3202600a4
commit 56fc5bbf87
3 changed files with 17 additions and 13 deletions

View File

@@ -472,6 +472,15 @@ WC_MISC_STATIC WC_INLINE void ato32(const byte* c, word32* wc_u32)
(word32)c[3];
}
/* convert opaque to 32 bit integer. Interpret as little endian. */
WC_MISC_STATIC WC_INLINE void ato32le(const byte* c, word32* wc_u32)
{
*wc_u32 = (word32)c[0] |
((word32)c[1] << 8) |
((word32)c[2] << 16) |
((word32)c[3] << 24);
}
WC_MISC_STATIC WC_INLINE word32 btoi(byte b)
{