summaryrefslogtreecommitdiff
path: root/strciphr.h
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2006-12-14 11:41:39 +0000
committerweidai <weidai11@users.noreply.github.com>2006-12-14 11:41:39 +0000
commit4afd858ae4974f82f9997b9184bc3d8d71d29b6e (patch)
treebe3960f1424e79719ea9c5f6152df003bc1c44f3 /strciphr.h
parent0f5ff1a06380139d0e93ba7cda3923d2c41cd866 (diff)
downloadcryptopp-git-4afd858ae4974f82f9997b9184bc3d8d71d29b6e.tar.gz
port to Borland C++Builder 2006
Diffstat (limited to 'strciphr.h')
-rw-r--r--strciphr.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/strciphr.h b/strciphr.h
index e905d7b1..ee5ba5df 100644
--- a/strciphr.h
+++ b/strciphr.h
@@ -64,7 +64,8 @@ struct CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AdditiveCipherAbstractPolicy
virtual bool CanOperateKeystream() const {return false;}
virtual void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) {assert(false);}
virtual void CipherSetKey(const NameValuePairs &params, const byte *key, size_t length) =0;
- virtual void CipherResynchronize(byte *keystreamBuffer, const byte *iv) {throw NotImplemented("StreamTransformation: this object doesn't support resynchronization");}
+ virtual void CipherGetNextIV(byte *iv) {throw NotImplemented("SimpleKeyingInterface: this object doesn't support GetNextIV()");}
+ virtual void CipherResynchronize(byte *keystreamBuffer, const byte *iv) {throw NotImplemented("SimpleKeyingInterface: this object doesn't support resynchronization");}
virtual bool IsRandomAccess() const =0;
virtual void SeekToIteration(lword iterationCount) {assert(!IsRandomAccess()); throw NotImplemented("StreamTransformation: this object doesn't support random access");}
};
@@ -123,6 +124,7 @@ class CRYPTOPP_NO_VTABLE AdditiveCipherTemplate : public BASE
public:
byte GenerateByte();
void ProcessData(byte *outString, const byte *inString, size_t length);
+ void GetNextIV(byte *iv) {this->AccessPolicy().CipherGetNextIV(iv);}
void Resynchronize(const byte *iv);
unsigned int OptimalBlockSize() const {return this->GetPolicy().GetBytesPerIteration();}
unsigned int GetOptimalNextBlockSize() const {return (unsigned int)this->m_leftOver;}
@@ -156,7 +158,8 @@ public:
virtual bool CanIterate() const {return false;}
virtual void Iterate(byte *output, const byte *input, CipherDir dir, size_t iterationCount) {assert(false);}
virtual void CipherSetKey(const NameValuePairs &params, const byte *key, size_t length) =0;
- virtual void CipherResynchronize(const byte *iv) {throw NotImplemented("StreamTransformation: this object doesn't support resynchronization");}
+ virtual void CipherGetNextIV(byte *iv) {throw NotImplemented("SimpleKeyingInterface: this object doesn't support GetNextIV()");}
+ virtual void CipherResynchronize(const byte *iv) {throw NotImplemented("SimpleKeyingInterface: this object doesn't support resynchronization");}
};
template <typename WT, unsigned int W, class BASE = CFB_CipherAbstractPolicy>
@@ -221,6 +224,7 @@ class CRYPTOPP_NO_VTABLE CFB_CipherTemplate : public BASE
{
public:
void ProcessData(byte *outString, const byte *inString, size_t length);
+ void GetNextIV(byte *iv) {this->AccessPolicy().CipherGetNextIV(iv);}
void Resynchronize(const byte *iv);
unsigned int OptimalBlockSize() const {return this->GetPolicy().GetBytesPerIteration();}
unsigned int GetOptimalNextBlockSize() const {return (unsigned int)m_leftOver;}