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

Re: cryptonite build failures



Hi Edmund,

your research is greatly appreciated! But I wonder why you don’t choose
upstream’s issue tracker to discuss this. Clearly upstream will have a
more educated opinion on such patches.

If you mention me (@nomeata) in the tickets, I’ll comment as well, or
try things out on porter boxes.

If you boycott GitHub, then that’s of course ok, and I’ll proxy the
communication with upstream.

Am Mittwoch, den 26.08.2015, 23:58 +0100 schrieb Edmund Grimley Evans:
> 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’ll try on a s390x porter box.

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

P seems to stand for Data.ByteArray.Pack, so see
http://hackage.haskell.org/package/memory-0.8/docs/Data-ByteArray-Pack.html
for what these functions do. It seems it fills a bytestring with 16
copies of the aadLength and the plainLength. The LE comes from 
http://hackage.haskell.org/package/memory-0.8/docs/Data-Memory-Endian.html
and marks the values to be encoded as little endian. Maybe this should
be "toLE" instead? I guess I can simply try that.



Greetings,
Joachim


-- 
Joachim "nomeata" Breitner
Debian Developer
  nomeata@debian.org | ICQ# 74513189 | GPG-Keyid: F0FBF51F
  JID: nomeata@joachim-breitner.de | http://people.debian.org/~nomeata

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: