Thiago Farina aaf61e460b Cleanup: Remove MD5_CTX typedef.
Instead just use MD5Context type directly. In C++ it is unnecessary to
alias the types using typedef, unline C (where if you don't you have to
spell out struct or enum infront of the user-type everytime you want to make a
variable).

So since WebRTC's base API is C++, it seems unnecessay to keep this
typedef around.

BUG=None
TEST=rtc_unittests --gtest_filter=Md5*
R=tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/46799004

Patch from Thiago Farina <tfarina@chromium.org>.

Cr-Commit-Position: refs/heads/master@{#8916}
2015-04-01 22:25:29 +00:00

43 lines
1.3 KiB
C++

/*
* This is the header file for the MD5 message-digest algorithm.
* The algorithm is due to Ron Rivest. This code was
* written by Colin Plumb in 1993, no copyright is claimed.
* This code is in the public domain; do with it what you wish.
*
* Equivalent code is available from RSA Data Security, Inc.
* This code has been tested against that, and is equivalent,
* except that you don't need to include two pages of legalese
* with every copy.
* To compute the message digest of a chunk of bytes, declare an
* MD5Context structure, pass it to MD5Init, call MD5Update as
* needed on buffers full of bytes, and then call MD5Final, which
* will fill a supplied 16-byte array with the digest.
*
*/
// Changes(fbarchard): Ported to C++ and Google style guide.
// Made context first parameter in MD5Final for consistency with Sha1.
// Changes(hellner): added rtc namespace
#ifndef WEBRTC_BASE_MD5_H_
#define WEBRTC_BASE_MD5_H_
#include "webrtc/base/basictypes.h"
namespace rtc {
struct MD5Context {
uint32 buf[4];
uint32 bits[2];
uint32 in[16];
};
void MD5Init(MD5Context* context);
void MD5Update(MD5Context* context, const uint8* data, size_t len);
void MD5Final(MD5Context* context, uint8 digest[16]);
void MD5Transform(uint32 buf[4], const uint32 in[16]);
} // namespace rtc
#endif // WEBRTC_BASE_MD5_H_