summaryrefslogtreecommitdiff
path: root/strciphr.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2006-12-14 11:41:39 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2006-12-14 11:41:39 +0000
commit085c5b2d0b70a2ff3d9ccf8616a7bdf4abbc957f (patch)
treebe3960f1424e79719ea9c5f6152df003bc1c44f3 /strciphr.h
parent60b7db799a5d9d607dba4b9a66c4421bb60f2577 (diff)
downloadcryptopp-085c5b2d0b70a2ff3d9ccf8616a7bdf4abbc957f.tar.gz
port to Borland C++Builder 2006
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@260 57ff6487-cd31-0410-9ec3-f628ee90f5f0
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 e905d7b..ee5ba5d 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;}