Wednesday, October 21, 2009

Draft SHA-1 Implementation

I recently committed a draft implementation of the SHA-1 hash algorithm to the ACO repository. This implementation is only a draft because it currently lacks any test cases and documentation. I thus consider it to be incomplete at this time. However, this is the first activity in the ACO project in a while so I thought it would be good to post a message about it anyway. I am alive! Hopefully I will be able to make steady progress from now on.

My SHA-1 implementation follows as directly as possible the description of the primary algorithm given in FIPS 180-1. My idea was to create an implementation that could eventually be proved correct with respect to the specification. I assumed that would be easier if I followed the specification as literally as possible. Alas, constructing a proof of correctness will be complicated by the fact that the specification isn't as formal as one might like. I will worry about that problem later. In the meantime it is my hope that my implementation is at least easy to review manually.

Ultimately I would also like to provide an implementation of the low memory consuming "alternate" algorithm described in FIPS 180-1. Of course it will additionally be necessary to formally show that the alternate algorithm produces the same result as the primary algorithm (FIPS 180-1 doesn't really do this), and that my implementation of it is correct with respect to its specification. What fun!

0 comments: