Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 125679
Collapse All | Expand All

(-)work-orig/camellia.h (-1 / +1 lines)
Lines 22-28 Link Here
22
/// <a href="http://www.weidai.com/scan-mirror/cs.html#Camellia">Camellia</a>
22
/// <a href="http://www.weidai.com/scan-mirror/cs.html#Camellia">Camellia</a>
23
class Camellia : public Camellia_Info, public BlockCipherDocumentation
23
class Camellia : public Camellia_Info, public BlockCipherDocumentation
24
{
24
{
25
	class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Camellia_Info>
25
	class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Camellia_Info>, public SimpledKeyed_Helper
26
	{
26
	{
27
	public:
27
	public:
28
		void UncheckedSetKey(CipherDir dir, const byte *key, unsigned int keylen);
28
		void UncheckedSetKey(CipherDir dir, const byte *key, unsigned int keylen);
(-)work-orig/cast.h (-2 / +2 lines)
Lines 24-30 Link Here
24
/// <a href="http://www.weidai.com/scan-mirror/cs.html#CAST-128">CAST-128</a>
24
/// <a href="http://www.weidai.com/scan-mirror/cs.html#CAST-128">CAST-128</a>
25
class CAST128 : public CAST128_Info, public BlockCipherDocumentation
25
class CAST128 : public CAST128_Info, public BlockCipherDocumentation
26
{
26
{
27
	class CRYPTOPP_NO_VTABLE Base : public CAST, public BlockCipherImpl<CAST128_Info>
27
	class CRYPTOPP_NO_VTABLE Base : public CAST, public BlockCipherImpl<CAST128_Info>, public SimpledKeyed_Helper
28
	{
28
	{
29
	public:
29
	public:
30
		void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length);
30
		void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length);
Lines 60-66 Link Here
60
//! <a href="http://www.weidai.com/scan-mirror/cs.html#CAST-256">CAST-256</a>
60
//! <a href="http://www.weidai.com/scan-mirror/cs.html#CAST-256">CAST-256</a>
61
class CAST256 : public CAST256_Info, public BlockCipherDocumentation
61
class CAST256 : public CAST256_Info, public BlockCipherDocumentation
62
{
62
{
63
	class CRYPTOPP_NO_VTABLE Base : public CAST, public BlockCipherImpl<CAST256_Info>
63
	class CRYPTOPP_NO_VTABLE Base : public CAST, public BlockCipherImpl<CAST256_Info>, public SimpledKeyed_Helper
64
	{
64
	{
65
	public:
65
	public:
66
		void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length = 8);
66
		void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length = 8);
(-)work-orig/des.h (-4 / +4 lines)
Lines 35-41 Link Here
35
	check or correct the parity bits if you wish. */
35
	check or correct the parity bits if you wish. */
36
class DES : public DES_Info, public BlockCipherDocumentation
36
class DES : public DES_Info, public BlockCipherDocumentation
37
{
37
{
38
	class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<DES_Info>, public RawDES
38
	class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<DES_Info>, public RawDES, public SimpledKeyed_Helper
39
	{
39
	{
40
	public:
40
	public:
41
		void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
41
		void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
Lines 60-66 Link Here
60
/// <a href="http://www.weidai.com/scan-mirror/cs.html#DESede">DES-EDE2</a>
60
/// <a href="http://www.weidai.com/scan-mirror/cs.html#DESede">DES-EDE2</a>
61
class DES_EDE2 : public DES_EDE2_Info, public BlockCipherDocumentation
61
class DES_EDE2 : public DES_EDE2_Info, public BlockCipherDocumentation
62
{
62
{
63
	class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<DES_EDE2_Info>
63
	class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<DES_EDE2_Info>, public SimpledKeyed_Helper
64
	{
64
	{
65
	public:
65
	public:
66
		void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length);
66
		void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length);
Lines 84-90 Link Here
84
/// <a href="http://www.weidai.com/scan-mirror/cs.html#DESede">DES-EDE3</a>
84
/// <a href="http://www.weidai.com/scan-mirror/cs.html#DESede">DES-EDE3</a>
85
class DES_EDE3 : public DES_EDE3_Info, public BlockCipherDocumentation
85
class DES_EDE3 : public DES_EDE3_Info, public BlockCipherDocumentation
86
{
86
{
87
	class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<DES_EDE3_Info>
87
	class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<DES_EDE3_Info>, public SimpledKeyed_Helper
88
	{
88
	{
89
	public:
89
	public:
90
		void UncheckedSetKey(CipherDir dir, const byte *key, unsigned int length);
90
		void UncheckedSetKey(CipherDir dir, const byte *key, unsigned int length);
Lines 108-114 Link Here
108
/// <a href="http://www.weidai.com/scan-mirror/cs.html#DESX">DES-XEX3</a>, AKA DESX
108
/// <a href="http://www.weidai.com/scan-mirror/cs.html#DESX">DES-XEX3</a>, AKA DESX
109
class DES_XEX3 : public DES_XEX3_Info, public BlockCipherDocumentation
109
class DES_XEX3 : public DES_XEX3_Info, public BlockCipherDocumentation
110
{
110
{
111
	class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<DES_XEX3_Info>
111
	class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<DES_XEX3_Info>, public SimpledKeyed_Helper
112
	{
112
	{
113
	public:
113
	public:
114
		void UncheckedSetKey(CipherDir dir, const byte *key, unsigned int length);
114
		void UncheckedSetKey(CipherDir dir, const byte *key, unsigned int length);
(-)work-orig/dll.cpp (-1 / +78 lines)
Lines 1-6 Link Here
1
// dll.cpp - written and placed in the public domain by Wei Dai
1
// dll.cpp - written and placed in the public domain by Wei Dai
2
2
3
#define CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES
3
#if defined( __GNUC__ ) && __GNUC__ > 3
4
#	undef CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES
5
#else
6
#	define CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES
7
#endif
4
#define CRYPTOPP_DEFAULT_NO_DLL
8
#define CRYPTOPP_DEFAULT_NO_DLL
5
9
6
#include "dll.h"
10
#include "dll.h"
Lines 36-41 Link Here
36
CRYPTOPP_DLL_TEMPLATE_CLASS AdditiveCipherTemplate<AbstractPolicyHolder<AdditiveCipherAbstractPolicy, CTR_ModePolicy> >;
40
CRYPTOPP_DLL_TEMPLATE_CLASS AdditiveCipherTemplate<AbstractPolicyHolder<AdditiveCipherAbstractPolicy, CTR_ModePolicy> >;
37
CRYPTOPP_DLL_TEMPLATE_CLASS AbstractEuclideanDomain<Integer>;
41
CRYPTOPP_DLL_TEMPLATE_CLASS AbstractEuclideanDomain<Integer>;
38
#endif
42
#endif
43
44
#if defined(__GNUC__) && __GNUC__ > 3
45
template class CRYPTOPP_DLL AbstractEuclideanDomain<Integer>;
46
template class CRYPTOPP_DLL AbstractEuclideanDomain<PolynomialMod2>;
47
template class CRYPTOPP_DLL AbstractGroup<Integer>;
48
template class CRYPTOPP_DLL AbstractGroup<EC2NPoint>;
49
template class CRYPTOPP_DLL AbstractGroup<ECPPoint>;
50
template class CRYPTOPP_DLL AbstractGroup<PolynomialMod2>;
51
template class CRYPTOPP_DLL AbstractPolicyHolder<AdditiveCipherAbstractPolicy, TwoBases<SimpleKeyedTransformation<StreamTransformation>, RandomNumberGenerator> >;
52
template class CRYPTOPP_DLL AbstractRing<Integer>;
53
template class CRYPTOPP_DLL AbstractRing<PolynomialMod2>;
54
template class CRYPTOPP_DLL AdditiveCipherTemplate<>;
55
template class CRYPTOPP_DLL AdditiveCipherTemplate<AbstractPolicyHolder<AdditiveCipherAbstractPolicy, CTR_ModePolicy> >;
56
template class CRYPTOPP_DLL AdditiveCipherTemplate<AbstractPolicyHolder<AdditiveCipherAbstractPolicy, OFB_ModePolicy> >;
57
template class CRYPTOPP_DLL AllocatorWithCleanup<byte>;
58
template class CRYPTOPP_DLL AllocatorWithCleanup<word16>;
59
template class CRYPTOPP_DLL AllocatorWithCleanup<word32>;
60
template class CRYPTOPP_DLL AutoSeededX917RNG<DES_EDE3>;
61
template class CRYPTOPP_DLL CFB_CipherTemplate<AbstractPolicyHolder<CFB_CipherAbstractPolicy, CFB_ModePolicy> >;
62
template class CRYPTOPP_DLL CFB_CipherTemplate<AbstractPolicyHolder<CFB_CipherAbstractPolicy, SymmetricCipher> >;
63
template class CRYPTOPP_DLL CFB_DecryptionTemplate<>;
64
template class CRYPTOPP_DLL CFB_DecryptionTemplate<AbstractPolicyHolder<CFB_CipherAbstractPolicy, CFB_ModePolicy> >;
65
template class CRYPTOPP_DLL CFB_EncryptionTemplate<>;
66
template class CRYPTOPP_DLL CFB_EncryptionTemplate<AbstractPolicyHolder<CFB_CipherAbstractPolicy, CFB_ModePolicy> >;
67
template class CRYPTOPP_DLL CipherModeFinalTemplate_ExternalCipher<CBC_CTS_Decryption>;
68
template class CRYPTOPP_DLL CipherModeFinalTemplate_ExternalCipher<CBC_CTS_Encryption>;
69
template class CRYPTOPP_DLL CipherModeFinalTemplate_ExternalCipher<CBC_Decryption>;
70
template class CRYPTOPP_DLL CipherModeFinalTemplate_ExternalCipher<CBC_Encryption>;
71
template class CRYPTOPP_DLL CipherModeFinalTemplate_ExternalCipher<ECB_OneWay>;
72
template class CRYPTOPP_DLL DH_Domain<DL_GroupParameters_GFP_DefaultSafePrime>;
73
template class CRYPTOPP_DLL DL_Algorithm_GDSA<EC2N::Point>;
74
template class CRYPTOPP_DLL DL_Algorithm_GDSA<ECP::Point>;
75
template class CRYPTOPP_DLL DL_Algorithm_GDSA<Integer>;
76
template class CRYPTOPP_DLL DL_FixedBasePrecomputationImpl<EC2N::Point>;
77
template class CRYPTOPP_DLL DL_FixedBasePrecomputationImpl<ECPPoint>;
78
template class CRYPTOPP_DLL DL_FixedBasePrecomputationImpl<Integer>;
79
template class CRYPTOPP_DLL DL_GroupParameters<Integer>;
80
template class CRYPTOPP_DLL DL_GroupParameters_EC<EC2N>;
81
template class CRYPTOPP_DLL DL_GroupParameters_EC<ECP>;
82
template class CRYPTOPP_DLL DL_GroupParameters_IntegerBasedImpl<ModExpPrecomputation>;
83
template class CRYPTOPP_DLL DL_GroupPrecomputation<EC2N::Point>;
84
template class CRYPTOPP_DLL DL_GroupPrecomputation<ECPPoint>;
85
template class CRYPTOPP_DLL DL_PrivateKeyImpl<DL_GroupParameters_EC<EC2N> >;
86
template class CRYPTOPP_DLL DL_PrivateKeyImpl<DL_GroupParameters_EC<ECP> >;
87
template class CRYPTOPP_DLL DL_PrivateKey_EC<EC2N>;
88
template class CRYPTOPP_DLL DL_PrivateKey_EC<ECP>;
89
template class CRYPTOPP_DLL DL_PrivateKey_GFP<DL_GroupParameters_DSA>;
90
template class CRYPTOPP_DLL DL_PrivateKey_WithSignaturePairwiseConsistencyTest<DL_PrivateKey_EC<EC2N>, ECDSA<EC2N> >;
91
template class CRYPTOPP_DLL DL_PrivateKey_WithSignaturePairwiseConsistencyTest<DL_PrivateKey_EC<ECP>, ECDSA<ECP> >;
92
template class CRYPTOPP_DLL DL_PrivateKey_WithSignaturePairwiseConsistencyTest<DL_PrivateKey_GFP<DL_GroupParameters_DSA>, DSA>;
93
template class CRYPTOPP_DLL DL_PublicKeyImpl<DL_GroupParameters_EC<EC2N> >;
94
template class CRYPTOPP_DLL DL_PublicKeyImpl<DL_GroupParameters_EC<ECP> >;
95
template class CRYPTOPP_DLL DL_PublicKey_EC<EC2N>;
96
template class CRYPTOPP_DLL DL_PublicKey_EC<ECP>;
97
template class CRYPTOPP_DLL DL_PublicKey_GFP<DL_GroupParameters_DSA>;
98
template class CRYPTOPP_DLL EuclideanDomainOf<PolynomialMod2>;
99
template class CRYPTOPP_DLL IteratedHashBase<word32, HashTransformation>;
100
template class CRYPTOPP_DLL IteratedHashBase<word32, MessageAuthenticationCode>;
101
#ifdef WORD64_AVAILABLE
102
template class CRYPTOPP_DLL IteratedHashBase<word64, HashTransformation>;
103
template class CRYPTOPP_DLL IteratedHashBase<word64, MessageAuthenticationCode>;
104
#endif
105
template class CRYPTOPP_DLL OAEP<SHA>;
106
#ifdef CRYPTOPP_IS_DLL
107
template class CRYPTOPP_DLL PKCS_DigestDecoration<SHA>;
108
#endif
109
template class CRYPTOPP_DLL QuotientRing<EuclideanDomainOf<PolynomialMod2> >;
110
template class CRYPTOPP_DLL SimpleKeyedTransformation<BlockTransformation>;
111
template class CRYPTOPP_DLL SimpleKeyedTransformation<HashTransformation>;
112
template class CRYPTOPP_DLL SimpleKeyedTransformation<StreamTransformation>;
113
template class CRYPTOPP_DLL StringSinkTemplate<std::string>;
114
template class CRYPTOPP_DLL TwoBases<SymmetricCipher, RandomNumberGenerator>;
115
#endif // __GNUC__ > 3
39
116
40
template<> const byte PKCS_DigestDecoration<SHA>::decoration[] = {0x30,0x21,0x30,0x09,0x06,0x05,0x2B,0x0E,0x03,0x02,0x1A,0x05,0x00,0x04,0x14};
117
template<> const byte PKCS_DigestDecoration<SHA>::decoration[] = {0x30,0x21,0x30,0x09,0x06,0x05,0x2B,0x0E,0x03,0x02,0x1A,0x05,0x00,0x04,0x14};
41
template<> const unsigned int PKCS_DigestDecoration<SHA>::length = sizeof(PKCS_DigestDecoration<SHA>::decoration);
118
template<> const unsigned int PKCS_DigestDecoration<SHA>::length = sizeof(PKCS_DigestDecoration<SHA>::decoration);
(-)work-orig/gost.h (-1 / +1 lines)
Lines 18-24 Link Here
18
/// <a href="http://www.weidai.com/scan-mirror/cs.html#GOST">GOST</a>
18
/// <a href="http://www.weidai.com/scan-mirror/cs.html#GOST">GOST</a>
19
class GOST : public GOST_Info, public BlockCipherDocumentation
19
class GOST : public GOST_Info, public BlockCipherDocumentation
20
{
20
{
21
	class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<GOST_Info>
21
	class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<GOST_Info>, public SimpledKeyed_Helper
22
	{
22
	{
23
	public:
23
	public:
24
		void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length);
24
		void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length);
(-)work-orig/hmac.h (-1 / +1 lines)
Lines 9-15 Link Here
9
NAMESPACE_BEGIN(CryptoPP)
9
NAMESPACE_BEGIN(CryptoPP)
10
10
11
//! _
11
//! _
12
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE HMAC_Base : public VariableKeyLength<16, 0, UINT_MAX>, public MessageAuthenticationCode
12
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE HMAC_Base : public VariableKeyLength<16, 0, UINT_MAX>, public MessageAuthenticationCode, public SimpledKeyed_Helper
13
{
13
{
14
public:
14
public:
15
	HMAC_Base() : m_innerHashKeyed(false) {}
15
	HMAC_Base() : m_innerHashKeyed(false) {}
(-)work-orig/iterhash.h (-1 / +1 lines)
Lines 88-94 Link Here
88
	: public ClonableImpl<T_Transform, AlgorithmImpl<IteratedHash<T_HashWordType, T_Endianness, T_BlockSize>, T_Transform> >
88
	: public ClonableImpl<T_Transform, AlgorithmImpl<IteratedHash<T_HashWordType, T_Endianness, T_BlockSize>, T_Transform> >
89
{
89
{
90
public:
90
public:
91
	enum {DIGESTSIZE = T_DigestSize};
91
	enum GCC4FIX2 {DIGESTSIZE = T_DigestSize};
92
	unsigned int DigestSize() const {return DIGESTSIZE;};
92
	unsigned int DigestSize() const {return DIGESTSIZE;};
93
93
94
protected:
94
protected:
(-)work-orig/lubyrack.h (-2 / +2 lines)
Lines 23-29 Link Here
23
template <class T>
23
template <class T>
24
class LR : public LR_Info<T>, public BlockCipherDocumentation
24
class LR : public LR_Info<T>, public BlockCipherDocumentation
25
{
25
{
26
	class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<LR_Info<T> >
26
	class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<LR_Info<T> >, public SimpledKeyed_Helper
27
	{
27
	{
28
	public:
28
	public:
29
		// VC60 workaround: have to define these functions within class definition
29
		// VC60 workaround: have to define these functions within class definition
Lines 38-44 Link Here
38
		}
38
		}
39
39
40
	protected:
40
	protected:
41
		enum {S=T::DIGESTSIZE};
41
		enum GCC4FIX4 {S=T::DIGESTSIZE};
42
		unsigned int L;	// key length / 2
42
		unsigned int L;	// key length / 2
43
		SecByteBlock key;
43
		SecByteBlock key;
44
44
(-)work-orig/mars.h (-1 / +1 lines)
Lines 18-24 Link Here
18
/// <a href="http://www.weidai.com/scan-mirror/cs.html#MARS">MARS</a>
18
/// <a href="http://www.weidai.com/scan-mirror/cs.html#MARS">MARS</a>
19
class MARS : public MARS_Info, public BlockCipherDocumentation
19
class MARS : public MARS_Info, public BlockCipherDocumentation
20
{
20
{
21
	class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<MARS_Info>
21
	class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<MARS_Info>, public SimpledKeyed_Helper
22
	{
22
	{
23
	public:
23
	public:
24
		void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length);
24
		void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length);
(-)work-orig/md5mac.h (-1 / +1 lines)
Lines 9-15 Link Here
9
9
10
NAMESPACE_BEGIN(CryptoPP)
10
NAMESPACE_BEGIN(CryptoPP)
11
11
12
class CRYPTOPP_NO_VTABLE MD5MAC_Base : public FixedKeyLength<16>, public IteratedHash<word32, LittleEndian, 64, MessageAuthenticationCode>
12
class CRYPTOPP_NO_VTABLE MD5MAC_Base : public FixedKeyLength<16>, public IteratedHash<word32, LittleEndian, 64, MessageAuthenticationCode>, public SimpledKeyed_Helper
13
{
13
{
14
public:
14
public:
15
	static std::string StaticAlgorithmName() {return "MD5-MAC";}
15
	static std::string StaticAlgorithmName() {return "MD5-MAC";}
(-)work-orig/mdc.h (-1 / +1 lines)
Lines 13-19 Link Here
13
13
14
//! _
14
//! _
15
template <class T>
15
template <class T>
16
struct MDC_Info : public FixedBlockSize<T::DIGESTSIZE>, public FixedKeyLength<T::BLOCKSIZE>
16
struct MDC_Info : public FixedBlockSize<T::DIGESTSIZE>, public FixedKeyLength<T::BLOCKSIZE>, public SimpledKeyed_Helper
17
{
17
{
18
	static std::string StaticAlgorithmName() {return std::string("MDC/")+T::StaticAlgorithmName();}
18
	static std::string StaticAlgorithmName() {return std::string("MDC/")+T::StaticAlgorithmName();}
19
};
19
};
(-)work-orig/rijndael.h (-1 / +1 lines)
Lines 18-24 Link Here
18
/// <a href="http://www.weidai.com/scan-mirror/cs.html#Rijndael">Rijndael</a>
18
/// <a href="http://www.weidai.com/scan-mirror/cs.html#Rijndael">Rijndael</a>
19
class CRYPTOPP_DLL Rijndael : public Rijndael_Info, public BlockCipherDocumentation
19
class CRYPTOPP_DLL Rijndael : public Rijndael_Info, public BlockCipherDocumentation
20
{
20
{
21
	class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Rijndael_Info>
21
	class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Rijndael_Info>, public SimpledKeyed_Helper
22
	{
22
	{
23
	public:
23
	public:
24
		void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length);
24
		void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length);
(-)work-orig/seckey.h (-18 / +20 lines)
Lines 21-27 Link Here
21
class FixedBlockSize
21
class FixedBlockSize
22
{
22
{
23
public:
23
public:
24
	enum {BLOCKSIZE = N};
24
	enum GCC4FIX0 {BLOCKSIZE = N};
25
};
25
};
26
26
27
// ************** rounds ***************
27
// ************** rounds ***************
Lines 31-37 Link Here
31
class FixedRounds
31
class FixedRounds
32
{
32
{
33
public:
33
public:
34
	enum {ROUNDS = R};
34
	enum GCC4FIX1 {ROUNDS = R};
35
35
36
protected:
36
protected:
37
	template <class T>
37
	template <class T>
Lines 50-56 Link Here
50
class VariableRounds
50
class VariableRounds
51
{
51
{
52
public:
52
public:
53
	enum {DEFAULT_ROUNDS = D, MIN_ROUNDS = N, MAX_ROUNDS = M};
53
	enum GCC4FIX3 {DEFAULT_ROUNDS = D, MIN_ROUNDS = N, MAX_ROUNDS = M};
54
	static unsigned int StaticGetDefaultRounds(unsigned int keylength) {return DEFAULT_ROUNDS;}
54
	static unsigned int StaticGetDefaultRounds(unsigned int keylength) {return DEFAULT_ROUNDS;}
55
55
56
protected:
56
protected:
Lines 123-141 Link Here
123
123
124
// ************** implementation helper for SimpledKeyed ***************
124
// ************** implementation helper for SimpledKeyed ***************
125
125
126
template <class T>
126
struct SimpledKeyed_Helper {
127
static inline void CheckedSetKey(T *obj, Empty empty, const byte *key, unsigned int length, const NameValuePairs &param)
127
 template <class T>
128
{
128
 static inline void CheckedSetKey(T *obj, Empty empty, const byte *key, unsigned int length, const NameValuePairs &param)
129
	obj->ThrowIfInvalidKeyLength(length);
129
 {
130
	obj->UncheckedSetKey(key, length);
130
 obj->ThrowIfInvalidKeyLength(length);
131
}
131
 obj->UncheckedSetKey(key, length);
132
132
 }
133
template <class T>
133
134
static inline void CheckedSetKey(T *obj, CipherDir dir, const byte *key, unsigned int length, const NameValuePairs &param)
134
 template <class T>
135
{
135
 static inline void CheckedSetKey(T *obj, CipherDir dir, const byte *key, unsigned int length, const NameValuePairs &param)
136
	obj->ThrowIfInvalidKeyLength(length);
136
 {
137
	obj->UncheckedSetKey(dir, key, length);
137
 obj->ThrowIfInvalidKeyLength(length);
138
}
138
 obj->UncheckedSetKey(dir, key, length);
139
 }
140
};
139
141
140
//! _
142
//! _
141
template <class BASE, class INFO = BASE>
143
template <class BASE, class INFO = BASE>
Lines 176-182 Link Here
176
178
177
	void SetKey(const byte *key, unsigned int length, const NameValuePairs &param = g_nullNameValuePairs)
179
	void SetKey(const byte *key, unsigned int length, const NameValuePairs &param = g_nullNameValuePairs)
178
	{
180
	{
179
		CheckedSetKey(this, DIR, key, length, param);
181
		BASE::CheckedSetKey(this, DIR, key, length, param);
180
	}
182
	}
181
};
183
};
182
184
Lines 187-193 Link Here
187
public:
189
public:
188
	void SetKey(const byte *key, unsigned int length, const NameValuePairs &params = g_nullNameValuePairs)
190
	void SetKey(const byte *key, unsigned int length, const NameValuePairs &params = g_nullNameValuePairs)
189
	{
191
	{
190
		CheckedSetKey(this, Empty(), key, length, params);
192
		BASE::CheckedSetKey(this, Empty(), key, length, params);
191
	}
193
	}
192
};
194
};
193
195
(-)work-orig/shacal2.h (-1 / +1 lines)
Lines 18-24 Link Here
18
/// <a href="http://www.weidai.com/scan-mirror/cs.html#SHACAL-2">SHACAL-2</a>
18
/// <a href="http://www.weidai.com/scan-mirror/cs.html#SHACAL-2">SHACAL-2</a>
19
class SHACAL2 : public SHACAL2_Info, public BlockCipherDocumentation
19
class SHACAL2 : public SHACAL2_Info, public BlockCipherDocumentation
20
{
20
{
21
	class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SHACAL2_Info>
21
	class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SHACAL2_Info>, public SimpledKeyed_Helper
22
	{
22
	{
23
	public:
23
	public:
24
		void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length);
24
		void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length);
(-)work-orig/skipjack.h (-1 / +1 lines)
Lines 18-24 Link Here
18
/// <a href="http://www.weidai.com/scan-mirror/cs.html#SKIPJACK">SKIPJACK</a>
18
/// <a href="http://www.weidai.com/scan-mirror/cs.html#SKIPJACK">SKIPJACK</a>
19
class SKIPJACK : public SKIPJACK_Info, public BlockCipherDocumentation
19
class SKIPJACK : public SKIPJACK_Info, public BlockCipherDocumentation
20
{
20
{
21
	class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SKIPJACK_Info>
21
	class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<SKIPJACK_Info>, public SimpledKeyed_Helper
22
	{
22
	{
23
	public:
23
	public:
24
		void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length);
24
		void UncheckedSetKey(CipherDir direction, const byte *userKey, unsigned int length);
(-)work-orig/ttmac.h (-1 / +1 lines)
Lines 9-15 Link Here
9
NAMESPACE_BEGIN(CryptoPP)
9
NAMESPACE_BEGIN(CryptoPP)
10
10
11
//! _
11
//! _
12
class CRYPTOPP_NO_VTABLE TTMAC_Base : public FixedKeyLength<20>, public IteratedHash<word32, LittleEndian, 64, MessageAuthenticationCode>
12
class CRYPTOPP_NO_VTABLE TTMAC_Base : public FixedKeyLength<20>, public IteratedHash<word32, LittleEndian, 64, MessageAuthenticationCode>, public SimpledKeyed_Helper
13
{
13
{
14
public:
14
public:
15
	static std::string StaticAlgorithmName() {return std::string("Two-Track-MAC");}
15
	static std::string StaticAlgorithmName() {return std::string("Two-Track-MAC");}

Return to bug 125679