about summary refs log tree commit diff
path: root/src/libextra/crypto/sha1.rs
AgeCommit message (Collapse)AuthorLines
2013-10-27Remove MD5 and Sha2. Move Sha1 and support code into librustpkg.Palmer Cox-332/+0
2013-08-17Crypto: update checked addition functions to use CheckedAdd intrinsic.Palmer Cox-2/+2
The shift_add_check_overflow and shift_add_check_overflow_tuple functions are re-written to be more efficient and to make use of the CheckedAdd instrinsic instead of manually checking for integer overflow. * The invokation leading_zeros() is removed and replaced with simple integer comparison. The leading_zeros() method results in a ctpop LLVM instruction and it may not be efficient on all architectures; integer comparisons, however, are efficient on just about any architecture. * The methods lose the ability for the caller to specify a particular shift value - that functionality wasn't being used and removing it allows for the code to be simplified. * Finally, the methods are renamed to add_bytes_to_bits and add_bytes_to_bits_tuple to reflect their very specific purposes.
2013-08-12Forbid pub/priv where it has no effectAlex Crichton-4/+4
Closes #5495
2013-08-03remove obsolete `foreach` keywordDaniel Micay-2/+2
this has been replaced by `for`
2013-08-02Sha1: Update Sha1 to use new functionality in cryptoutil.rsPalmer Cox-101/+37
2013-08-02Crypto: Add large input tests for all DigestsPalmer Cox-21/+10
Create a helper function in cryptoutil.rs which feeds 1,000,000 'a's into a Digest with varying input sizes and then checks the result. This is essentially the same as one of Sha1's existing tests, so, that test was re-implemented using this method. New tests were added using this method for Sha512 and Sha256.
2013-08-02Crypto: Remove DigestUtil and convert to default methods on the Digest trait.Palmer Cox-1/+1
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-4/+4
2013-07-19extra: add some microbenchmarksGraydon Hoare-0/+38
2013-07-17test: Fix tests.Patrick Walton-6/+7
2013-07-04Remove standalone comparison functions in vec, make the trait impls better.Huon Wilson-3/+2
2013-06-29Great renaming: propagate throughout the rest of the codebaseCorey Richardson-2/+1
2013-06-24Create a Digest trait for common methods on digests and convert the SHA-1 ↵Palmer Cox-31/+22
implementation to use it. The DigestUtil trait was created for helper methods since default methods still have issues.
2013-06-24Improve the SHA-1 implementationPalmer Cox-234/+203
* Rename struct Sha1State to Sha1 * Remove all use of @ types * Use fixed length vectors * Move all of the inner functions from inside sha1() to top level, private functions * Sha1 instances are now created via Sha1::new() * Update all constant names to uppercase * Remove unecessary assert_eq!s * Remove check_vec_eq() helper function; use vec::eq() instead
2013-06-23Create a crypto submodule and move the SHA-1 implementation into it.Palmer Cox-0/+410