📄 cpgpglobalrandompool.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 + -