md5transform.h

Go to the documentation of this file.
00001 /**
00002  * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
00003  * rights reserved.
00004  *
00005  * License to copy and use this software is granted provided that it
00006  * is identified as the "RSA Data Security, Inc. MD5 Message-Digest
00007  * Algorithm" in all material mentioning or referencing this software
00008  * or this function.
00009  *
00010  * License is also granted to make and use derivative works provided
00011  * that such works are identified as "derived from the RSA Data
00012  * Security, Inc. MD5 Message-Digest Algorithm" in all material
00013  * mentioning or referencing the derived work.
00014  *
00015  * RSA Data Security, Inc. makes no representations concerning either
00016  * the merchantability of this software or the suitability of this
00017  * software for any particular purpose. It is provided "as is"
00018  * without express or implied warranty of any kind.
00019  *
00020  * These notices must be retained in any copies of any part of this
00021  * documentation and/or software.
00022  */
00023 
00024 /** \file md5transform.h Interface for MD5 checksumming class. */
00025 
00026 #ifndef __MD5TRANSFORM_H__
00027 #define __MD5TRANSFORM_H__
00028 
00029 #include <hn/osdep.h>
00030 #include <hn/hash.h>
00031 
00032 class DLLEXPORT Md5Transform {
00033 public:
00034         Md5Transform();
00035         ~Md5Transform();
00036         void sumUp(const unsigned char *data, uint32_t length);
00037         void sumUp(const char *data, uint32_t length);
00038         Hash<MD5Hash> getHash();
00039 private:
00040         uint32_t state[4];                                   /* state (ABCD) */
00041         uint32_t count[2];        /* number of bits, modulo 2^64 (lsb first) */
00042         unsigned char buffer[64];                            /* input buffer */
00043 };
00044 
00045 #endif