about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-08-17 07:42:01 -0700
committerbors <bors@rust-lang.org>2013-08-17 07:42:01 -0700
commit29a67d1dc2a171997902f847375ed684b8bdb32c (patch)
treebdeb5cbc8e18aa42782e8913b18f7ab765b4fc47 /src/rustllvm/PassWrapper.cpp
parent1942a7a3fb3eb860f225f491c0aa2eb93a7c6e90 (diff)
parentb00aa12374d01b1caadbcfc2b0de76d8bb884192 (diff)
downloadrust-29a67d1dc2a171997902f847375ed684b8bdb32c.tar.gz
rust-29a67d1dc2a171997902f847375ed684b8bdb32c.zip
auto merge of #8272 : DaGenix/rust/digest-md5-impl-not-unrolled, r=cmr
An MD5 implementation was originally included in #8097, but, since there are a couple different implementations of that digest algorithm (@alco mentioned his implementation on the mailing list just before I opened that PR), it was suggested that I remove it from that PR and open up a new PR to discuss the different implementations and the best way forward. If anyone wants to discuss a different implementation, feel free to present it here and discuss and compare it to this one. I'll just discuss my implementation and I'll leave it to others to present details of theirs.

This implementation relies on the FixedBuffer struct from cryptoutil.rs for managing the input buffer, just like the Sha1 and Sha2 digest implementations do. I tried manually unrolling the loops in the compression function, but I got slightly worse performance when I did that.

Outside of the #[test]s, I also tested the implementation by generating 1,000 inputs of up to 10MB in size and checking the MD5 digest calculated by this code against the MD5 digest calculated by Java's implementation.

On my computer, I'm getting the following performance:

```
test md5::bench::md5_10 ... bench: 52 ns/iter (+/- 1) = 192 MB/s
test md5::bench::md5_1k ... bench: 2819 ns/iter (+/- 44) = 363 MB/s
test md5::bench::md5_64k ... bench: 178566 ns/iter (+/- 4927) = 367 MB/s
```

Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions