SHA1 reversed bytes?

Ned Konz ned at squeakland.org
Thu Mar 10 14:49:06 UTC 2005


On Thursday 10 March 2005 6:23 am, Avi Bryant wrote:
> On Thu, 10 Mar 2005 06:19:41 -0800, Ned Konz <ned at squeakland.org> wrote:
> > On Thursday 10 March 2005 6:00 am, Tony Garnock-Jones wrote:
> > > Ned Konz wrote:
> > > > Where is the SHA1 code?
> > >
> > > In the "Cryptography" package on SM.
> >
> > What happens when you use the SecureHashAlgorithm code in the stock
> > image, which looks like a newer copy of the SHA1 code in that package?
>
> It outputs the correct, unreversed bytes, at least on my (big-endian)
> machine,

Well, there you go... So use SecureHashAlgorithm instead. On my little-endian 
machine, BTW, this is what happens:

(SHA1 new hashMessage: 'ede8557d-8e2f-11d9-8a80-000a95e87d06tonyg') hex  
'52FBE248257F325B5CEEBA8B2278A9A28442F8D6'

 (SecureHashAlgorithm new hashMessage: 
'ede8557d-8e2f-11d9-8a80-000a95e87d06tonyg') hex 
'16rD6F84284A2A978228BBAEE5C5B327F2548E2FB52'

-- 
Ned Konz
http://bike-nomad.com/squeak/



More information about the Squeak-dev mailing list