[rust-dev] Implement Digest trait for MD4 and MD5

Alexei Sholik alcosholik at gmail.com
Mon Jul 29 02:05:33 PDT 2013

I mentioned checksum algorithms because I have a motivation to work on them
and thought Rust could have the most popular ones in stdlib. I wasn't
suggesting to put them into the same category as digests.

For the record, I'm looking at Go's crypto[1] and hash[2] packages as an
indicator of what could find its way into the standard lib.

  [1]: http://golang.org/pkg/crypto/  (scroll to the bottom to see
  [2]: http://golang.org/pkg/hash/

On Mon, Jul 29, 2013 at 9:53 AM, Graydon Hoare <graydon at mozilla.com> wrote:

> On 13-07-28 05:27 PM, Kevin Cantu wrote:
>> AFAIK new algorithms using MD4 (and probably MD5) would also be simply
>> wrong, too.
> They were designed as CHFs; they are now weak-or-broken but code that's
> interoperating with old cryptosystems do need them from time to time.
> CRCs and Checksums aren't CHFs and shouldn't be put anywhere near them.
> I'd be somewhat cautious even calling them hash functions, but I guess it's
> a short enough name.
> I suggest (humbly and willing to listen to counterarguments) that we have
> a trait std::crypto::Digest and a trait std::hash::Hash, with default
> implementations of each that we consider state of the art, in std; and then
> a bucket of "extra" named algorithms that satisfy the same trait in
> extra::crypto and extra::hash.
> In general I _think_ I'd like important / widely-used traits to be
> specified in std, even if "most" implementations don't live in std. There's
> value to getting the interface widely standardized.
> The same issue comes up with a lot of other interfaces: the container
> types (hashtables and balanced trees), random number generators,
> serialization schemes, compressors and such are all like this: there are 95
> different known, named variants someone _might_ want to use for some
> particular interoperability or taste reason, but I suggest that the
> interface and a promise of at least 1 "reasonably good" implementation --
> hidden behind &Trait or a non-specified typedef or something -- ought to be
> standardized.
> -Graydon
> ______________________________**_________________
> Rust-dev mailing list
> Rust-dev at mozilla.org
> https://mail.mozilla.org/**listinfo/rust-dev<https://mail.mozilla.org/listinfo/rust-dev>

Best regards
Alexei Sholik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20130729/13e7cf31/attachment.html>

More information about the Rust-dev mailing list