summaryrefslogtreecommitdiff
path: root/seckey.h
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2007-04-16 00:43:17 +0000
committerweidai <weidai11@users.noreply.github.com>2007-04-16 00:43:17 +0000
commit517d6a55ca6bb8d6e75078f24b5da9b3fed37d64 (patch)
tree07de390eacb9ffbe5f030a6a9713b96838337a91 /seckey.h
parentf0b6d88f11fa87bac55c400a1676edb8712e6fa1 (diff)
downloadcryptopp-git-517d6a55ca6bb8d6e75078f24b5da9b3fed37d64.tar.gz
IV_REQUIREMENT changes
Diffstat (limited to 'seckey.h')
-rw-r--r--seckey.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/seckey.h b/seckey.h
index 73b6e302..4adca4b3 100644
--- a/seckey.h
+++ b/seckey.h
@@ -110,15 +110,16 @@ public:
};
/// support query of key length that's the same as another class
-template <class T>
+template <class T, unsigned int IV_REQ = SimpleKeyingInterface::NOT_RESYNCHRONIZABLE, unsigned int IV_L = 0>
class SameKeyLengthAs
{
public:
CRYPTOPP_CONSTANT(MIN_KEYLENGTH=T::MIN_KEYLENGTH)
CRYPTOPP_CONSTANT(MAX_KEYLENGTH=T::MAX_KEYLENGTH)
CRYPTOPP_CONSTANT(DEFAULT_KEYLENGTH=T::DEFAULT_KEYLENGTH)
- CRYPTOPP_CONSTANT(IV_REQUIREMENT = T::IV_REQUIREMENT)
- CRYPTOPP_CONSTANT(IV_LENGTH = T::IV_LENGTH)
+ CRYPTOPP_CONSTANT(IV_REQUIREMENT=IV_REQ)
+ CRYPTOPP_CONSTANT(IV_LENGTH=IV_L)
+
static size_t CRYPTOPP_API StaticGetValidKeyLength(size_t keylength)
{return T::StaticGetValidKeyLength(keylength);}
};
@@ -134,7 +135,7 @@ public:
size_t MaxKeyLength() const {return (size_t)INFO::MAX_KEYLENGTH;}
size_t DefaultKeyLength() const {return INFO::DEFAULT_KEYLENGTH;}
size_t GetValidKeyLength(size_t n) const {return INFO::StaticGetValidKeyLength(n);}
- typename BASE::IV_Requirement IVRequirement() const {return (typename BASE::IV_Requirement)INFO::IV_REQUIREMENT;}
+ SimpleKeyingInterface::IV_Requirement IVRequirement() const {return (SimpleKeyingInterface::IV_Requirement)INFO::IV_REQUIREMENT;}
unsigned int IVSize() const {return INFO::IV_LENGTH;}
};