[pycrypto] RIPEMD-160 self-test failure

Jeffery To jeffery.to at gmail.com
Fri Oct 30 09:27:53 PDT 2015


Thanks for your help - endianness was the issue. The tests all pass after
patching setup.py.

Thanks again!
Jeff

On Thu, Oct 29, 2015 at 9:50 PM, Legrandin <helderijs at gmail.com> wrote:

> Hi,
>
> You most probably get PyCrypto compiled in little-endian mode but your
> router is big endian. There is no clean way to solve this other than
> manually forcing 'PCT_BIG_ENDIAN' to be 1 in setup.py.
>
> L.
>
> 2015-10-28 12:03 GMT+01:00 Jeffery To <jeffery.to at gmail.com>:
> > Hi,
> >
> > I'm trying to cross-compile PyCrypto 2.6.1 for OpenWrt (Chaos Calmer
> 15.05,
> > targeting ar71xx). The library compiled without any fatal errors and I'm
> > able to package and install on my router (TP-Link TL-MR3020).
> >
> > To be sure it's working correctly, I transferred setup.py to my router
> and
> > ran the self-test. All the tests passed except for the 9 RIPEMD-160 hash
> > tests. The library function(s) seem to return normally, but the returned
> > hash is incorrect, e.g.:
> >
> > FAIL: runTest (Crypto.SelfTest.Hash.common.HashSelfTest)
> > RIPEMD #1: '' (empty string)
> > ----------------------------------------------------------------------
> > Traceback (most recent call last):
> >   File "/usr/lib/python2.7/site-packages/Crypto/SelfTest/Hash/common.py",
> > line 88, in runTest
> >     self.assertEqual(self.expected, out1)   # h = .new(); h.update(data);
> > h.digest()
> > AssertionError: '9c1185a5c5e9fc54612808977ee8f548b2258d31' !=
> > '7c7c0f550ddb9e5ebf157869ea147e65cb89bb0e'
> >
> > I'm unsure how to proceed at this point; my searches on Google haven't
> > returned any relevant results. What area/library/etc should I
> > investigate/debug to fix this? Any help would be appreciated.
> >
> > Thanks!
> > Jeff
> >
> >
> > _______________________________________________
> > pycrypto mailing list
> > pycrypto at lists.dlitz.net
> > http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto
> >
> _______________________________________________
> pycrypto mailing list
> pycrypto at lists.dlitz.net
> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dlitz.net/pipermail/pycrypto/attachments/20151031/158352f0/attachment.html>


More information about the pycrypto mailing list