⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 md5.h

📁 SMAL是short message abstract library的缩写,是由风起水流软件工作室(www.zealware.com)开发的一个支持短信网关系统开发的C++底层抽象接口库
💻 H
字号:
/******************************************************************************
FileName                : md5.h
Description             : 哈希算法,版权归其作者所有
Version                 : 
Date                    : 1991
Author                  : RSA Data Security, Inc.
Other                   : C++/object oriented translation of MD5.
******************************************************************************/

#include <stdio.h>

#ifndef _MD5_H_
#define _MD5_H_

//##ModelId=46B5D43F01B4
class/* __declspec(dllexport)*/ MD5 {

public:
  // methods for controlled operation:
	//##ModelId=46B5D43F01BE
  MD5              ();  // simple initializer
	//##ModelId=46B5D43F01BF
  void  update     (unsigned char *input, unsigned int input_length);
	//##ModelId=46B5D43F01CA
  void  finalize   ();

// methods to acquire finalized result
	//##ModelId=46B5D43F01CB
  void raw_digest  ( unsigned char *buf);  // digest as a 16-byte binary array

private:

// first, some types:
	//##ModelId=46B5D43F0289
  typedef unsigned       int uint4; // assumes integer is 4 words long
	//##ModelId=46B5D43F0291
  typedef unsigned short int uint2; // assumes short integer is 2 words long
	//##ModelId=46B5D43F029A
  typedef unsigned      char uint1; // assumes char is 1 word long

// next, the private data:
	//##ModelId=46B5D43F01D3
  uint4 state[4];
	//##ModelId=46B5D43F01D8
  uint4 count[2];     // number of *bits*, mod 2^64
	//##ModelId=46B5D43F01DD
  uint1 buffer[64];   // input buffer
	//##ModelId=46B5D43F01E2
  uint1 digest[16];
	//##ModelId=46B5D43F01E7
  uint1 finalized;

// last, the private methods, mostly static:
	//##ModelId=46B5D43F01EB
  void init             ();               // called by all constructors
	//##ModelId=46B5D43F01F0
  void transform        (uint1 *buffer);  // does the real update work.  Note 
                                          // that length is implied to be 64.

	//##ModelId=46B5D43F01F2
  static void encode    (uint1 *dest, uint4 *src, uint4 length);
	//##ModelId=46B5D43F01FC
  static void decode    (uint4 *dest, uint1 *src, uint4 length);
	//##ModelId=46B5D43F0205
  static void memcpy    (uint1 *dest, uint1 *src, uint4 length);
	//##ModelId=46B5D43F020E
  static void memset    (uint1 *start, uint1 val, uint4 length);

	//##ModelId=46B5D43F0218
  static inline uint4  rotate_left (uint4 x, uint4 n);
	//##ModelId=46B5D43F021C
  static inline uint4  F           (uint4 x, uint4 y, uint4 z);
	//##ModelId=46B5D43F022D
  static inline uint4  G           (uint4 x, uint4 y, uint4 z);
	//##ModelId=46B5D43F0236
  static inline uint4  H           (uint4 x, uint4 y, uint4 z);
	//##ModelId=46B5D43F023B
  static inline uint4  I           (uint4 x, uint4 y, uint4 z);
	//##ModelId=46B5D43F0244
  static inline void   FF  (uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, 
			    uint4 s, uint4 ac);
	//##ModelId=46B5D43F0255
  static inline void   GG  (uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, 
			    uint4 s, uint4 ac);
	//##ModelId=46B5D43F026A
  static inline void   HH  (uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, 
			    uint4 s, uint4 ac);
	//##ModelId=46B5D43F027C
  static inline void   II  (uint4& a, uint4 b, uint4 c, uint4 d, uint4 x, 
			    uint4 s, uint4 ac);

};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -