fix infinite recursive call in IsRandomAccess (reported by ASBai)
parent
c8fe7e0718
commit
244f99c027
4
modes.h
4
modes.h
|
|
@ -140,7 +140,7 @@ inline void CopyOrZero(void *dest, const void *src, size_t s)
|
||||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE OFB_ModePolicy : public ModePolicyCommonTemplate<AdditiveCipherAbstractPolicy>
|
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE OFB_ModePolicy : public ModePolicyCommonTemplate<AdditiveCipherAbstractPolicy>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool IsRandomAccess() const {return false;}
|
bool CipherIsRandomAccess() const {return false;}
|
||||||
IV_Requirement IVRequirement() const {return UNIQUE_IV;}
|
IV_Requirement IVRequirement() const {return UNIQUE_IV;}
|
||||||
static const char * CRYPTOPP_API StaticAlgorithmName() {return "OFB";}
|
static const char * CRYPTOPP_API StaticAlgorithmName() {return "OFB";}
|
||||||
|
|
||||||
|
|
@ -162,7 +162,7 @@ private:
|
||||||
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CTR_ModePolicy : public ModePolicyCommonTemplate<AdditiveCipherAbstractPolicy>
|
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CTR_ModePolicy : public ModePolicyCommonTemplate<AdditiveCipherAbstractPolicy>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool IsRandomAccess() const {return true;}
|
bool CipherIsRandomAccess() const {return true;}
|
||||||
IV_Requirement IVRequirement() const {return UNIQUE_IV;}
|
IV_Requirement IVRequirement() const {return UNIQUE_IV;}
|
||||||
static const char * CRYPTOPP_API StaticAlgorithmName() {return "CTR";}
|
static const char * CRYPTOPP_API StaticAlgorithmName() {return "CTR";}
|
||||||
|
|
||||||
|
|
|
||||||
2
panama.h
2
panama.h
|
|
@ -122,7 +122,7 @@ class PanamaCipherPolicy : public AdditiveCipherConcretePolicy<word32, 8>,
|
||||||
protected:
|
protected:
|
||||||
void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length);
|
void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length);
|
||||||
void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
|
void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
|
||||||
bool IsRandomAccess() const {return false;}
|
bool CipherIsRandomAccess() const {return false;}
|
||||||
void CipherResynchronize(byte *keystreamBuffer, const byte *iv);
|
void CipherResynchronize(byte *keystreamBuffer, const byte *iv);
|
||||||
#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X64
|
#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X64
|
||||||
unsigned int GetAlignment() const;
|
unsigned int GetAlignment() const;
|
||||||
|
|
|
||||||
2
salsa.h
2
salsa.h
|
|
@ -19,7 +19,7 @@ protected:
|
||||||
void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length);
|
void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length);
|
||||||
void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
|
void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
|
||||||
void CipherResynchronize(byte *keystreamBuffer, const byte *IV);
|
void CipherResynchronize(byte *keystreamBuffer, const byte *IV);
|
||||||
bool IsRandomAccess() const {return true;}
|
bool CipherIsRandomAccess() const {return true;}
|
||||||
void SeekToIteration(lword iterationCount);
|
void SeekToIteration(lword iterationCount);
|
||||||
#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X64
|
#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X64
|
||||||
unsigned int GetAlignment() const;
|
unsigned int GetAlignment() const;
|
||||||
|
|
|
||||||
2
seal.h
2
seal.h
|
|
@ -19,7 +19,7 @@ protected:
|
||||||
void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length);
|
void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length);
|
||||||
void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
|
void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
|
||||||
void CipherResynchronize(byte *keystreamBuffer, const byte *IV);
|
void CipherResynchronize(byte *keystreamBuffer, const byte *IV);
|
||||||
bool IsRandomAccess() const {return true;}
|
bool CipherIsRandomAccess() const {return true;}
|
||||||
void SeekToIteration(lword iterationCount);
|
void SeekToIteration(lword iterationCount);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ protected:
|
||||||
void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length);
|
void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length);
|
||||||
void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
|
void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
|
||||||
void CipherResynchronize(byte *keystreamBuffer, const byte *iv);
|
void CipherResynchronize(byte *keystreamBuffer, const byte *iv);
|
||||||
bool IsRandomAccess() const {return false;}
|
bool CipherIsRandomAccess() const {return false;}
|
||||||
#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X64
|
#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X64
|
||||||
unsigned int GetAlignment() const;
|
unsigned int GetAlignment() const;
|
||||||
unsigned int GetOptimalBlockSize() const;
|
unsigned int GetOptimalBlockSize() const;
|
||||||
|
|
|
||||||
|
|
@ -75,8 +75,8 @@ struct CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AdditiveCipherAbstractPolicy
|
||||||
virtual void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) {assert(false);}
|
virtual void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount) {assert(false);}
|
||||||
virtual void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length) =0;
|
virtual void CipherSetKey(const NameValuePairs ¶ms, const byte *key, size_t length) =0;
|
||||||
virtual void CipherResynchronize(byte *keystreamBuffer, const byte *iv) {throw NotImplemented("SimpleKeyingInterface: this object doesn't support resynchronization");}
|
virtual void CipherResynchronize(byte *keystreamBuffer, const byte *iv) {throw NotImplemented("SimpleKeyingInterface: this object doesn't support resynchronization");}
|
||||||
virtual bool IsRandomAccess() const =0;
|
virtual bool CipherIsRandomAccess() const =0;
|
||||||
virtual void SeekToIteration(lword iterationCount) {assert(!IsRandomAccess()); throw NotImplemented("StreamTransformation: this object doesn't support random access");}
|
virtual void SeekToIteration(lword iterationCount) {assert(!CipherIsRandomAccess()); throw NotImplemented("StreamTransformation: this object doesn't support random access");}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename WT, unsigned int W, unsigned int X = 1, class BASE = AdditiveCipherAbstractPolicy>
|
template <typename WT, unsigned int W, unsigned int X = 1, class BASE = AdditiveCipherAbstractPolicy>
|
||||||
|
|
@ -141,7 +141,7 @@ public:
|
||||||
unsigned int OptimalDataAlignment() const {return this->GetPolicy().GetAlignment();}
|
unsigned int OptimalDataAlignment() const {return this->GetPolicy().GetAlignment();}
|
||||||
bool IsSelfInverting() const {return true;}
|
bool IsSelfInverting() const {return true;}
|
||||||
bool IsForwardTransformation() const {return true;}
|
bool IsForwardTransformation() const {return true;}
|
||||||
bool IsRandomAccess() const {return this->GetPolicy().IsRandomAccess();}
|
bool IsRandomAccess() const {return this->GetPolicy().CipherIsRandomAccess();}
|
||||||
void Seek(lword position);
|
void Seek(lword position);
|
||||||
|
|
||||||
typedef typename BASE::PolicyInterface PolicyInterface;
|
typedef typename BASE::PolicyInterface PolicyInterface;
|
||||||
|
|
|
||||||
2
wake.h
2
wake.h
|
|
@ -44,7 +44,7 @@ protected:
|
||||||
void Iterate(byte *output, const byte *input, CipherDir dir, size_t iterationCount);
|
void Iterate(byte *output, const byte *input, CipherDir dir, size_t iterationCount);
|
||||||
// OFB
|
// OFB
|
||||||
void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
|
void OperateKeystream(KeystreamOperation operation, byte *output, const byte *input, size_t iterationCount);
|
||||||
bool IsRandomAccess() const {return false;}
|
bool CipherIsRandomAccess() const {return false;}
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Weak {
|
namespace Weak {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue