📄 ccipher.h
字号:
/*____________________________________________________________________________
Copyright (C) 2002 PGP Corporation
All rights reserved.
$Id: CCipher.h,v 1.4 2002/08/06 20:10:19 dallen Exp $
____________________________________________________________________________*/
#ifndef Included_CCipher_h // [
#define Included_CCipher_h
#include "CErrorState.h"
#include "Crypto.h"
_PGP_BEGIN
class CCipher SMART_ERROR_INHERIT
{
public:
CCipher(PGPdiskEncryptionAlgorithm algorithm) : mAlgorithm(algorithm) { }
virtual ~CCipher() = 0 { }
virtual PGPBoolean IsKeyAttached() const = 0;
virtual const Crypto::SymmetricKey& Key() const = 0;
virtual const Crypto::PassphraseSalt& Salt() const = 0;
PGPdiskEncryptionAlgorithm Algorithm() const {return mAlgorithm;}
virtual PGPUInt32 SizeExportedCipher() const = 0;
virtual PGPUInt16 NumKeyBits() const = 0;
virtual PGPUInt16 NumKeyBytes() const = 0;
virtual PGPUInt16 NumEncryptBytes() const = 0;
virtual PGPUInt16 NumDecryptBytes() const = 0;
virtual PGPUInt16 NumSaltBytes() const = 0;
virtual PGPUInt16 NumIvsNeeded() const = 0;
virtual SMART_ERROR Validate() const = 0;
virtual void AttachKey(const Crypto::SymmetricKey& key,
const Crypto::PassphraseSalt& salt) = 0;
virtual void FlipKeyBytes() = 0;
virtual void Encrypt(const void *in, void *out,
PGPUInt32 numBlocks = 1) const = 0;
virtual void Decrypt(const void *in, void *out,
PGPUInt32 numBlocks = 1) const = 0;
virtual void EncryptCFBdbl(PGPUInt32 ivs[], const PGPUInt32 *src,
PGPUInt32 *dest, PGPUInt32 len) const = 0;
virtual void DecryptCFBdbl(PGPUInt32 ivs[], const PGPUInt32 *src,
PGPUInt32 *dest, PGPUInt32 len) const = 0;
virtual SMART_ERROR ExportCipher(void *buffer,
PGPUInt32 sizeBuffer) const = 0;
virtual SMART_ERROR ImportCipher(const void *buffer,
PGPUInt32 sizeBuffer) = 0;
private:
PGPdiskEncryptionAlgorithm mAlgorithm;
};
_PGP_END
#endif // ] Included_CCipher_h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -