diff options
author | Stephen Hines <srhines@google.com> | 2014-12-04 19:51:48 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-12-04 19:51:48 +0000 |
commit | a21bbdfad461e957fa42ac9d6860ddc9de2da3e9 (patch) | |
tree | 8d32ff2094b47e15a8def30d62fd7dee6e009de3 /lib/Support/MD5.cpp | |
parent | 6b8c6a5088c221af2b25065b8b6b8b0fec8a116f (diff) | |
parent | 876d6995443e99d13696f3941c3a789a4daa7c7a (diff) | |
download | external_llvm-a21bbdfad461e957fa42ac9d6860ddc9de2da3e9.zip external_llvm-a21bbdfad461e957fa42ac9d6860ddc9de2da3e9.tar.gz external_llvm-a21bbdfad461e957fa42ac9d6860ddc9de2da3e9.tar.bz2 |
am 876d6995: Merge "Update aosp/master LLVM for rebase to r222494."
* commit '876d6995443e99d13696f3941c3a789a4daa7c7a':
Update aosp/master LLVM for rebase to r222494.
Diffstat (limited to 'lib/Support/MD5.cpp')
-rw-r--r-- | lib/Support/MD5.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/lib/Support/MD5.cpp b/lib/Support/MD5.cpp index 514466c..ceab580 100644 --- a/lib/Support/MD5.cpp +++ b/lib/Support/MD5.cpp @@ -208,11 +208,11 @@ void MD5::update(ArrayRef<uint8_t> Data) { memcpy(&buffer[used], Ptr, free); Ptr = Ptr + free; Size -= free; - body(ArrayRef<uint8_t>(buffer, 64)); + body(makeArrayRef(buffer, 64)); } if (Size >= 64) { - Ptr = body(ArrayRef<uint8_t>(Ptr, Size & ~(unsigned long) 0x3f)); + Ptr = body(makeArrayRef(Ptr, Size & ~(unsigned long) 0x3f)); Size &= 0x3f; } @@ -229,7 +229,7 @@ void MD5::update(StringRef Str) { /// \brief Finish the hash and place the resulting hash into \p result. /// \param result is assumed to be a minimum of 16-bytes in size. -void MD5::final(MD5Result &result) { +void MD5::final(MD5Result &Result) { unsigned long used, free; used = lo & 0x3f; @@ -240,7 +240,7 @@ void MD5::final(MD5Result &result) { if (free < 8) { memset(&buffer[used], 0, free); - body(ArrayRef<uint8_t>(buffer, 64)); + body(makeArrayRef(buffer, 64)); used = 0; free = 64; } @@ -257,30 +257,30 @@ void MD5::final(MD5Result &result) { buffer[62] = hi >> 16; buffer[63] = hi >> 24; - body(ArrayRef<uint8_t>(buffer, 64)); - - result[0] = a; - result[1] = a >> 8; - result[2] = a >> 16; - result[3] = a >> 24; - result[4] = b; - result[5] = b >> 8; - result[6] = b >> 16; - result[7] = b >> 24; - result[8] = c; - result[9] = c >> 8; - result[10] = c >> 16; - result[11] = c >> 24; - result[12] = d; - result[13] = d >> 8; - result[14] = d >> 16; - result[15] = d >> 24; + body(makeArrayRef(buffer, 64)); + + Result[0] = a; + Result[1] = a >> 8; + Result[2] = a >> 16; + Result[3] = a >> 24; + Result[4] = b; + Result[5] = b >> 8; + Result[6] = b >> 16; + Result[7] = b >> 24; + Result[8] = c; + Result[9] = c >> 8; + Result[10] = c >> 16; + Result[11] = c >> 24; + Result[12] = d; + Result[13] = d >> 8; + Result[14] = d >> 16; + Result[15] = d >> 24; } -void MD5::stringifyResult(MD5Result &result, SmallString<32> &Str) { +void MD5::stringifyResult(MD5Result &Result, SmallString<32> &Str) { raw_svector_ostream Res(Str); for (int i = 0; i < 16; ++i) - Res << format("%.2x", result[i]); + Res << format("%.2x", Result[i]); } } |