[issue10430] _sha.sha().digest() method is endian-sensitive. and hexdigest()

2010-11-24 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Found the issue and it wasn't with sha1. Turned out that the code was doing somethign like sha1(buffer(unicode('str'))) which exposed the endianness of the unicode representation. Sorry for wasting your time. -- resolution: -> invalid status:

[issue10430] _sha.sha().digest() method is endian-sensitive. and hexdigest()

2010-11-19 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Yes, in my original myopic observation I was mistaken in thinking that we were reading the digest out of the 5 entry int32 "digest" field in the SHAobject. I´ve already verified that the "Endianness" field is correctly set. What I thought was an obvio

[issue10430] _sha.sha().digest() method is endian-sensitive. and hexdigest()

2010-11-19 Thread Nick Coghlan
Nick Coghlan added the comment: If I was looking for opportunities for a compiler to do something weird, I'd start with the TestEndianness macro (i.e. maybe it is incorrectly flagging the Cell as little endian when it is actually big endian) The endianness handling itself looks fine to me, th

[issue10430] _sha.sha().digest() method is endian-sensitive. and hexdigest()

2010-11-19 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue10430] _sha.sha().digest() method is endian-sensitive. and hexdigest()

2010-11-19 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Something is definietly weird on the PS3. I´ll give more concrete data soon. (and yes, I may have misread the code) -- ___ Python tracker __

[issue10430] _sha.sha().digest() method is endian-sensitive. and hexdigest()

2010-11-19 Thread Scott Dial
Scott Dial added the comment: Got a test case that demonstrates a failure? Looks like it works to me... $ uname -ip sparc SUNW,Sun-Fire-280R $ python -c 'import sys; print sys.byteorder' big $ python -c 'import sha; print sha.new(open("test", "rb").read()).hexdigest()' 851faf3199d27200abf2750c1

[issue10430] _sha.sha().digest() method is endian-sensitive. and hexdigest()

2010-11-16 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue10430] _sha.sha().digest() method is endian-sensitive. and hexdigest()

2010-11-15 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson : in shamodule.c, the digest() method just creates a simple bytes string of the digest. The digest is stored as an array of 32 bit integers in the native representation. Therefore, the digest will be different on big- and little-endian machines. T