[q-lang-users] A little help for a functional newbie?
Brought to you by:
agraef
From: Andrew B. <and...@ya...> - 2004-10-26 07:08:43
|
From the documentation on the website and the idea that Q is a little like Haskell, but friendlier, I've implemented SHA-1 in Q. Well, almost implemented it. I've got it working fine for messages that fit into a single 512 byte block, but somehow it seems to get confused when spanning the blocks. I rewrote the block spanning code because I thought maybe I was doing the recursion wrong, but still I'm getting answers that don't match the sample data from http://www.faqs.org/rfcs/rfc3174.html . I've attached my code in case someone would like to take a look at it and tell me what I'm doing wrong. I tried to use the debugger, but I could never make sense of its output. Also, I know that it is really slow. The bulk of the time is spent calculating the final value of the A-E registers. I don't see obvious repeated computation of the same values in sha_aet, but there might be some way to write that which would not require building all the little arrays. Thanks, -andrew |