[zeromq-dev] big endian compatibility ?

Pieter Hintjens ph at imatix.com
Wed Oct 2 11:17:16 CEST 2013


1. The nonce is not interpreted in any way by the receiver; it's
treated as a chunk of memory. The encoding is irrelevant so long as
the value is unique.

2. NetMQ got it wrong initially; I believe this was fixed.

On Wed, Oct 2, 2013 at 10:27 AM, Laurent Alebarde <l.alebarde at free.fr> wrote:
> Hi Developpers,
>
> Is libzmq supposed to be big-endian compatible ? Or not ? In particular, is
> a big-endian box supposed to be able to talk with a little endian box ?
>
> I could find this which says it is compatible in the mailing list archive,
> but it is dated of 2008. In netmq, it looks like 0MQ standard is big endian.
> And here, the opposite. I am confused.
>
> For example, in curve, the nonce build process copies a uint64_t (cn_nonce)
> to a uint8_t* (hello_nonce) :
>
>     //  Prepare the full nonce
>     memcpy (hello_nonce, "CurveZMQHELLO---", 16);
>     memcpy (hello_nonce + 16, &cn_nonce, 8);
>
> Here, I think the message will not be encrypted the same on a big endian box
> and in a little endian one, since one will use the nonce, say
> "CurveZMQHELLO---12345678" and the other "CurveZMQHELLO---87654321". So it
> is not compatible. Elsewhere in libzmq, this kind of serialisation is
> implemented as a loop of shifts (>>8) and low byte copy, which is endian
> compatible.
>
> What is the status please ?
>
> Laurent.
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



More information about the zeromq-dev mailing list