[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cryptonite build failures



There are two sets of failures on the big-endian architectures:
KDF/Scrypt and ChaChaPoly1305. I think the first set could perhaps be
fixed with this, untested patch:

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, uint3
 
 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)


Does anyone have a big-endian system to test that?

I don't know about the other set of failures... What does stuff like
the following mean, anyway?

P.fill 16 (P.putStorable (LE aadLength) >> P.putStorable (LE plainLength))


Reply to: