On 07/28/2013 09:18 AM, Alexei Sholik wrote:
Hi guys,
I have implemented Digest for MD4 and added an implementation of MD5.
I'm keeping the code in a separate repo so that I don't have to
rebuild Rust -- https://github.com/alco/rust-digest. There is also a
draft of HMAC and an additional utility trait to make it easy to get
one-off digests from vectors and strings.
I hope that at least MD4 and MD5 can make it into upstream. Can you
please take a look and give some advice on how I should integrate my
MD4 changes (just replace the old implementation?) and new MD5
implementation into libextra.
One thing in particular that I'm wary about is that the
implementations for MD4 and MD5 are almost identical -- only the inner
loop is different. Naturally, I would like to unify them as much as
possible by putting both into a single module. Any advice on that will
be appreciated.
Right now it looks like we an extra::crypto module that contains a
Digest trait, implemented by a number of SHA variants in crypto::sha1
and crypto::sha2. Curiously extra::md4 looks to be unrelated to
extra::crypto (I guess it's just old and unmaintained).
So I have a few questions:
* Can all digest functions implement Digest?
* Is it appropriate for all digests to live in extra::crypto? Not all
hashes are crypto hashes...
Based on what we have now I'd recommend deleting extra::md4, moving your
md4/5 into extra::crypto, and integrating them with the Digest trait.
Certainly though I've only given this cursory thought (and I haven't
read your code yet), so other opinions welcome.
-Brian
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev