From 4beda3a49d22af890ce1aacb0f7c114767c8a17b Mon Sep 17 00:00:00 2001 From: Edmund Grimley Evans Date: Thu, 27 Aug 2015 14:50:57 +0200 Subject: [PATCH] Avoid endianess problems in integerify() This fixes a build failure in KDF/Scrypt. Fixes #30. --- cbits/cryptonite_scrypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cbits/cryptonite_scrypt.c b/cbits/cryptonite_scrypt.c index fc3fd04..eaf28ac 100644 --- a/cbits/cryptonite_scrypt.c +++ b/cbits/cryptonite_scrypt.c @@ -46,7 +46,7 @@ static void blockmix_salsa8(uint32_t *in, uint32_t *out, uint32_t *X, const uint static inline uint64_t integerify(uint32_t *B, const uint32_t r) { - return le64_to_cpu(*((uint64_t *) (B + (2*r-1) * 16))); + return B[(2*r-1) * 16] | (uint64_t)B[(2*r-1) * 16 + 1] << 32; } static inline uint32_t load32(const uint8_t *p)