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

📄 csha.h

📁 PGP8.0源码 请认真阅读您的文件包然后写出其具体功能
💻 H
字号:
/*____________________________________________________________________________
		Copyright (C) 2002 PGP Corporation
        All rights reserved.

        $Id: CSHA.h,v 1.2 2002/08/06 20:10:18 dallen Exp $
____________________________________________________________________________*/

#ifndef Included_CSHA_h	// [
#define Included_CSHA_h

/* NIST proposed Secure Hash Standard.

   Written 2 September 1992, Peter C. Gutmann.
   This implementation placed in the public domain.

   Modified 1 June 1993, Colin Plumb.
   These modifications placed in the public domain.

   Modified 22 October 1998, Network Associates, Inc.
   Modifications copyright Network Associates, Inc.

   Comments to pgut1@cs.aukuni.ac.nz */

_PGP_BEGIN

// Class CSHA

class CSHA
{
	NOT_COPYABLE(CSHA)

public:
	enum {kSHS_BLOCKSIZE = 64};
	enum {kSHS_DIGESTSIZE = 20};

	union Digest
	{
		PGPUInt8	bytes[kSHS_DIGESTSIZE];
		PGPUInt32	dwords[kSHS_DIGESTSIZE / sizeof(PGPUInt32)];
	};

public:
			CSHA();

	void	Init();
	void	Update(const PGPByte *buf, PGPUInt16 len);
	void	Final(Digest *digest);

	CSHA *	Clone();

private:
	Digest		mDigest;
	PGPUInt32	mCountHi;		// 64-bit byte count
	PGPUInt32	mCountLo;		// 64-bit byte count
	PGPUInt32	mData[16];		// SHS data buffer

	void	ByteReverse(PGPUInt32 *buf, PGPUInt32 byteCount);
	void	Transform();
};

_PGP_END

#endif	// ] Included_CSHA_h

⌨️ 快捷键说明

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