diff --git a/Crypto/Cipher/ChaChaPoly1305.hs b/Crypto/Cipher/ChaChaPoly1305.hs index a2db972..cb16929 100644 --- a/Crypto/Cipher/ChaChaPoly1305.hs +++ b/Crypto/Cipher/ChaChaPoly1305.hs @@ -117,5 +117,5 @@ finalize :: State -> Poly1305.Auth finalize (State _ macState aadLength plainLength) = Poly1305.finalize $ Poly1305.updates macState [ pad16 plainLength - , either (error "finalize: internal error") id $ P.fill 16 (P.putStorable (LE aadLength) >> P.putStorable (LE plainLength)) + , either (error "finalize: internal error") id $ P.fill 16 (P.putStorable (toLE aadLength) >> P.putStorable (toLE plainLength)) ] 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)