New submission from Kristján Valur Jónsson <krist...@ccpgames.com>:

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.

The specification (http://en.wikipedia.org/wiki/SHA-1) suggest that the digest 
should actually be big endian, so the standard implementation on most home 
machines is actually wrong

Actually, looking at the code, hexdigest() has the same problem!

----------
components: Extension Modules
messages: 121268
nosy: krisvale
priority: normal
severity: normal
status: open
title: _sha.sha().digest() method is endian-sensitive. and hexdigest()
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10430>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to