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

📄 cpgpglobalrandompool.h

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

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

#ifndef Included_CPGPGlobalRandomPool_h	// [
#define Included_CPGPGlobalRandomPool_h

#include "pgpRandomPool.h"
#include "pgpUtilities.h"

_PGP_BEGIN

// Class CPGPGlobalRandomPool

class CPGPGlobalRandomPool
{
	NOT_COPYABLE(CPGPGlobalRandomPool)

public:
	CPGPGlobalRandomPool(PGPContextRef pgpContext);
	~CPGPGlobalRandomPool() { }

	PGPUInt32	GetSize();

	PGPUInt32	GetEntropy();
	PGPUInt32	GetMinimumEntropy();
	PGPBoolean	HasMinimumEntropy();

	PGPUInt32	AddKeystroke(PGPInt32 event);
	PGPUInt32	MouseMoved();

	void	GetRandomBytes(void *randomData, PGPSize bytesData);

private:
	PGPContextRef	mPGPContext;
};


// Class CPGPGlobalRandomPool member functions

inline 
CPGPGlobalRandomPool::CPGPGlobalRandomPool(PGPContextRef pgpContext)
{
	pgpAssert(PGPContextRefIsValid(pgpContext));
	mPGPContext = pgpContext;
}

inline 
PGPUInt32 
CPGPGlobalRandomPool::GetSize()
{
	return PGPGlobalRandomPoolGetSize();
}

inline 
PGPUInt32 
CPGPGlobalRandomPool::GetEntropy()
{
	return PGPGlobalRandomPoolGetEntropy();
}

inline 
PGPUInt32 
CPGPGlobalRandomPool::GetMinimumEntropy()
{
	return PGPGlobalRandomPoolGetMinimumEntropy();
}

inline 
PGPBoolean 
CPGPGlobalRandomPool::HasMinimumEntropy()
{
	return PGPGlobalRandomPoolHasMinimumEntropy();
}

inline 
PGPUInt32 
CPGPGlobalRandomPool::AddKeystroke(PGPInt32 event)
{
	return PGPGlobalRandomPoolAddKeystroke(event);
}

inline 
PGPUInt32 
CPGPGlobalRandomPool::MouseMoved()
{
	return PGPGlobalRandomPoolMouseMoved();
}

inline 
void 
CPGPGlobalRandomPool::GetRandomBytes(void *randomData, PGPSize bytesData)
{
	pgpAssertAddrValid(randomData, VoidAlign);

	PGPError	pgpErr	= PGPContextGetRandomBytes(mPGPContext, randomData, 
		bytesData);

	THROW_IF_PGPERROR(pgpErr);
}

_PGP_END

#endif	// ] Included_CPGPGlobalRandomPool_h

⌨️ 快捷键说明

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