Talk:SHA-2

From Second Life Wiki
Jump to navigation Jump to search

This script doesn't work.

Input:
"foo" (without the quotes)

SHA-256 hash according to UTF8_SHA_256("foo") in this script:
709E80C88487A2411E1EE4DFB9F22A861492D20C4765150C0C794ABD70F8147C

SHA-256 hash according to every other SHA-256 hasher I could find on the internet:
2C26B46B68FFC68FF99B453C1D30413413422D706483BFA0F98A5E886266E7AE

Soto Hax 10:09, 16 November 2013 (PST)

I'll work on it. Ob, thanks for the revert. -- Strife (talk|contribs) 21:16, 16 November 2013 (PST)
Ok, so the script passes it's self tests in LSLEditor, which is a good indication we are dealing with an order of operations bug or something that LSLEditor does differently than LSL. -- Strife (talk|contribs) 22:03, 18 November 2013 (PST)
If I had to guess without doing any real work it's probably a Base64 implementation issue with LSLEditor. -- Strife (talk|contribs) 22:19, 18 November 2013 (PST)
The major change is how the length at the beginning is calculated (god I wish I had written more comments), I'm going to roll that bit of code back seeing as the other changes aren't effected by order of operations and are related to speeding the code up. -- Strife (talk|contribs) 22:33, 18 November 2013 (PST)