C ++ MD5 Class header file

Source: Internet
Author: User
Posting time: 13:21:00

/*************************************** ***************************************
* Copyright (c) 2000 by Robert Hubley .*
* All Rights Reserved .*
**
* This software is provided ''as is ''and any express or implied *
* Warranties, including, but not limited to, the implied warranties *
* Merchantability and fitness for a particle purpose, are disclaimed .*
* In no event shall the authors be liable for any direct, indirect ,*
* Incidental, special, exemplary, or consequential damages (including, *
* Not limited to, procurement of substitute goods or services; loss of use ,*
* Data, or profits; or business interruption) however caused and on any *
* Theory of liability, whether in contract, strict liability, or tort *
* (Including negligence or otherwise) arising in any way out of the use *
* This software, even if advised of the possibility of such damage .*
**
**************************************** **************************************

Md5.h-header file for md5c. c
 
Port to Win32 DLL by Robert Hubley 1/5/2000

Original copyright:

Copyright (c) 1991-2, RSA Data Security, Inc. Created 1991. All
Rights Reserved.

License to copy and use this software is granted provided that it
Is identified as the "RSA Data Security, Inc. MD5 message-Digest
Algorithm "in all material mentioning or referencing this software
Or this function.

License is also granted to make and use derivative works provided
That such works are identified as "derived from the RSA Data
Security, Inc. MD5 message-Digest algorithm "in all material
Mentioning or referencing the derived work.

RSA Data Security, Inc. makes no representations concerning either
The merchantability of this software or the suitability of this
Software for any special purpose. It is provided "as is"
Without express or implied warranty of any kind.

These notices must be retained in any copies of any part of this
Documentation and/or software.
*/
/*************************************** ***************************************
* Copyright (c) 2000 by Robert Hubley .*
* All Rights Reserved .*
**
* This software is provided ''as is ''and any express or implied *
* Warranties, including, but not limited to, the implied warranties *
* Merchantability and fitness for a particle purpose, are disclaimed .*
* In no event shall the authors be liable for any direct, indirect ,*
* Incidental, special, exemplary, or consequential damages (including, *
* Not limited to, procurement of substitute goods or services; loss of use ,*
* Data, or profits; or business interruption) however caused and on any *
* Theory of liability, whether in contract, strict liability, or tort *
* (Including negligence or otherwise) arising in any way out of the use *
* This software, even if advised of the possibility of such damage .*
**
**************************************** **************************************
*/

/*************************************** ***************************************
* 2002-4-18 modified by liguangyi .*
* Struct md5_ctx ==> class md5_ctx .*
* Take off the globals functions *
**************************************** **************************************
*/

# Ifndef _ lgy_md5_h
# DEFINE _ lgy_md5_h

/* MD5 class .*/
Class md5_ctx {
Public:
Md5_ctx ();
Virtual ~ Md5_ctx ();
Void md5update (unsigned char * input, unsigned int inputlen );
Void md5final (unsigned char digest [16]);

PRIVATE:
Unsigned long int State [4];/* State (ABCD )*/
Unsigned long int count [2];/* Number of BITs, modulo 2 ^ 64 (LSB first )*/
Unsigned char buffer [64];/* input buffer */
Unsigned char padding [64];/* what? */

PRIVATE:
Void md5init ();
Void md5transform (unsigned long int State [4], unsigned char block [64]);
Void md5_memcpy (unsigned char * output, unsigned char * input, unsigned int Len );
Void encode (unsigned char * output, unsigned long int * input, unsigned int Len );
Void decode (unsigned long int * output, unsigned char * input, unsigned int Len );
Void md5_memset (unsigned char * output, int value, unsigned int Len );
};

# Endif

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.