[zeromq-dev] big endian compatibility ?

Laurent Alebarde l.alebarde at free.fr
Wed Oct 2 10:27:00 CEST 2013

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 <https://github.com/zeromq/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 

What is the status please ?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20131002/d9dba10d/attachment.htm>

More information about the zeromq-dev mailing list