Skip to content

Commit

Permalink
Revert botched "Crypto++ 5.6.3 check-in". Corruption due to VMware ad…
Browse files Browse the repository at this point in the history
…ding garbage to the end of some source files during drag and drop from guest to host.

This reverts commit c454358.
  • Loading branch information
noloader committed Nov 23, 2015
1 parent c454358 commit 62618fd
Show file tree
Hide file tree
Showing 53 changed files with 204 additions and 577 deletions.
8 changes: 3 additions & 5 deletions 3way.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// 3way.h - written and placed in the public domain by Wei Dai

//! \file 3way.h
//! \brief Classes for the 3-Way block cipher
//! \file
//! \headerfile 3way.h
//! \brief Class file for the 3way cipher

#ifndef CRYPTOPP_THREEWAY_H
#define CRYPTOPP_THREEWAY_H
Expand Down Expand Up @@ -67,6 +68,3 @@ typedef ThreeWay::Decryption ThreeWayDecryption;
NAMESPACE_END

#endif
D

#endif
4 changes: 1 addition & 3 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -765,9 +765,7 @@ WARN_LOGFILE =

INPUT = . \
GNUmakefile \
rdrand.S \
rdrand.asm \
cryptest.sh
rdrand.asm

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down
32 changes: 16 additions & 16 deletions TestVectors/hkdf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Comment: Test Case 4
Key: 0x0b0b0b0b0b0b0b0b0b0b0b
Salt: 0x000102030405060708090a0b0c
Info: 0xf0f1f2f3f4f5f6f7f8f9
DerivedKeyLength: 42
DerivedLength: 42
DerivedKey: 0x085a01ea1b10f36933068b56efa5ad81a4f14b822f5b091568a9cdd4f155fda2c22e422478d305f3f896
Test: Verify

Expand All @@ -16,7 +16,7 @@ Comment: Test Case 5
Key: 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f
Salt: 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf
Info: 0xb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
DerivedKeyLength: 82
DerivedLength: 82
DerivedKey: 0x0bd770a74d1160f7c9f12cd5912a06ebff6adcae899d92191fe4305673ba2ffe8fa3f1a4e5ad79f3f334b3b202b2173c486ea37ce3d397ed034c7f9dfeb15c5e927336d0441f4c4300e2cff0d0900b52d3b4
Test: Verify

Expand All @@ -27,7 +27,7 @@ Comment: Test Case 6
Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
Salt: ""
Info: ""
DerivedKeyLength: 42
DerivedLength: 42
DerivedKey: 0x0ac1af7002b3d761d1e55298da9d0506b9ae52057220a306e07b6b87e8df21d0ea00033de03984d34918
Test: Verify

Expand All @@ -38,7 +38,7 @@ Comment: Test Case 7
Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c
Salt: ""
Info: ""
DerivedKeyLength: 42
DerivedLength: 42
DerivedKey: 0x2c91117204d745f3500d636a62f64f0ab3bae548aa53d423b0d1f27ebba6f5e5673a081d70cce7acfc48
Test: Verify

Expand All @@ -49,7 +49,7 @@ Comment: Test Case 1
Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
Salt: 0x000102030405060708090a0b0c
Info: 0xf0f1f2f3f4f5f6f7f8f9
DerivedKeyLength: 42
DerivedLength: 42
DerivedKey: 0x3cb25f25faacd57a90434f64d0362f2a2d2d0a90cf1a5a4c5db02d56ecc4c5bf34007208d5b887185865
Test: Verify

Expand All @@ -60,7 +60,7 @@ Comment: Test Case 2
Key: 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f
Salt: 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf
Info: 0xb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
DerivedKeyLength: 82
DerivedLength: 82
DerivedKey: 0xb11e398dc80327a1c8e7f78c596a49344f012eda2d4efad8a050cc4c19afa97c59045a99cac7827271cb41c65e590e09da3275600c2f09b8367793a9aca3db71cc30c58179ec3e87c14c01d5c1f3434f1d87
Test: Verify

Expand All @@ -71,7 +71,7 @@ Comment: Test Case 3
Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
Salt: ""
Info: ""
DerivedKeyLength: 42
DerivedLength: 42
DerivedKey: 0x8da4e775a563c18f715f802a063c5a31b8a11f5c5ee1879ec3454e5f3c738d2d9d201395faa4b61a96c8
Test: Verify

Expand All @@ -82,7 +82,7 @@ Comment: Test Case 8 (Mirror Tests 1 and 4)
Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
Salt: 0x000102030405060708090a0b0c
Info: 0xf0f1f2f3f4f5f6f7f8f9
DerivedKeyLength: 42
DerivedLength: 42
DerivedKey: 0x832390086CDA71FB47625BB5CEB168E4C8E26A1A16ED34D9FC7FE92C1481579338DA362CB8D9F925D7CB
Test: Verify

Expand All @@ -93,7 +93,7 @@ Comment: Test Case 9 (Mirror Tests 2 and 5)
Key: 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f
Salt: 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf
Info: 0xb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
DerivedKeyLength: 82
DerivedLength: 82
DerivedKey: 0xCE6C97192805B346E6161E821ED165673B84F400A2B514B2FE23D84CD189DDF1B695B48CBD1C8388441137B3CE28F16AA64BA33BA466B24DF6CFCB021ECFF235F6A2056CE3AF1DE44D572097A8505D9E7A93
Test: Verify

Expand All @@ -104,7 +104,7 @@ Comment: Test Case 10 (Mirror Test 3 and 6)
Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
Salt: ""
Info: ""
DerivedKeyLength: 42
DerivedLength: 42
DerivedKey: 0xF5FA02B18298A72A8C23898A8703472C6EB179DC204C03425C970E3B164BF90FFF22D04836D0E2343BAC
Test: Verify

Expand All @@ -115,7 +115,7 @@ Comment: Test Case 11
Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c
Salt: ""
Info:
DerivedKeyLength: 42
DerivedLength: 42
DerivedKey: 0x1407D46013D98BC6DECEFCFEE55F0F90B0C7F63D68EB1A80EAF07E953CFC0A3A5240A155D6E4DAA965BB
Test: Verify

Expand All @@ -126,7 +126,7 @@ Comment: Test Case 12 (Mirror Tests 3 and 6)
Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
Salt: ""
Info: ""
DerivedKeyLength: 42
DerivedLength: 42
DerivedKey: 0xF5FA02B18298A72A8C23898A8703472C6EB179DC204C03425C970E3B164BF90FFF22D04836D0E2343BAC
Test: Verify

Expand All @@ -137,7 +137,7 @@ Comment: Test Case 13 (Mirror Tests 1 and 4)
Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
Salt: 0x000102030405060708090a0b0c
Info: 0xf0f1f2f3f4f5f6f7f8f9
DerivedKeyLength: 42
DerivedLength: 42
DerivedKey: 0x0D29F74CCD8640F44B0DD9638111C1B5766EFED752AF358109E2E7C9CD4A28EF2F90B2AD461FBA0744D4
Test: Verify

Expand All @@ -148,7 +148,7 @@ Comment: Test Case 14 (Mirror Tests 2 and 5)
Key: 0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f
Salt: 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf
Info: 0xb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
DerivedKeyLength: 82
DerivedLength: 82
DerivedKey: 0x4EBE4FE2DCCEC42661699500BE279A993FED90351E19373B3926FAA3A410700B2BBF77E254CF1451AE6068D64A0904D966F4FF25498445A501B88F50D21E3A68A890E09445DC5886DD00E7F4F7C58A512170
Test: Verify

Expand All @@ -159,7 +159,7 @@ Comment: Test Case 15 (Mirror Tests 3 and 6)
Key: 0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
Salt: ""
Info: ""
DerivedKeyLength: 42
DerivedLength: 42
DerivedKey: 0x110632D0F7AEFAC31771FC66C22BB3462614B81E4B04BA7F2B662E0BD694F56458615F9A9CB56C57ECF2
Test: Verify

Expand All @@ -170,6 +170,6 @@ Comment: Test Case 16 (Mirror Test 7)
Key: 0x0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c
Salt: r64 0x00
Info: ""
DerivedKeyLength: 42
DerivedLength: 42
DerivedKey: 0x4089286EBFB23DD8A02F0C9DAA35D538EB09CD0A8CBAB203F39083AA3E0BD313E6F91E64F21A187510B0
Test: Verify
6 changes: 2 additions & 4 deletions arc4.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// arc4.h - written and placed in the public domain by Wei Dai

//! \file arc4.h
//! \file
//! \headerfile arc4.h
//! \brief Classes for ARC4 cipher

#ifndef CRYPTOPP_ARC4_H
Expand Down Expand Up @@ -81,6 +82,3 @@ using namespace Weak1; // import Weak1 into CryptoPP with warning
NAMESPACE_END

#endif
E_END

#endif
4 changes: 2 additions & 2 deletions argnames.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ CRYPTOPP_DEFINE_NAME_STRING(MaxLineLength) //< int
CRYPTOPP_DEFINE_NAME_STRING(DigestSize) //!< int, in bytes
CRYPTOPP_DEFINE_NAME_STRING(L1KeyLength) //!< int, in bytes
CRYPTOPP_DEFINE_NAME_STRING(TableSize) //!< int, in bytes
CRYPTOPP_DEFINE_NAME_STRING(Blinding) //!< bool, timing attack mitigations
CRYPTOPP_DEFINE_NAME_STRING(Blinding) //!< bool
CRYPTOPP_DEFINE_NAME_STRING(DerivedKey) //!< ByteArrayParameter, key derivation, derived key
CRYPTOPP_DEFINE_NAME_STRING(DerivedKeyLength) //!< int, key derivation, derived key length in bytes
CRYPTOPP_DEFINE_NAME_STRING(DerivedLength) //!< int, key derivation, derived key length in bytes
DOCUMENTED_NAMESPACE_END

NAMESPACE_END
Expand Down
26 changes: 2 additions & 24 deletions base32.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,12 @@ NAMESPACE_BEGIN(CryptoPP)
class Base32Encoder : public SimpleProxyFilter
{
public:
//! \brief Construct a Base32Encoder
//! \param attachment a BufferedTrasformation to attach to this object
//! \param uppercase a flag indicating uppercase output
//! \param groupSize the size of the grouping
//! \param separator the separator to use between groups
//! \param terminator the terminator appeand after processing
//! \details Base32Encoder() constructs a default encoder. The constructor lacks fields for padding and
//! line breaks. You must use IsolatedInitialize() to change the default padding character or suppress it.
//! \sa IsolatedInitialize() for an example of modifying a Base32Encoder after construction.
Base32Encoder(BufferedTransformation *attachment = NULL, bool uppercase = true, int groupSize = 0, const std::string &separator = ":", const std::string &terminator = "")
Base32Encoder(BufferedTransformation *attachment = NULL, bool uppercase = true, int outputGroupSize = 0, const std::string &separator = ":", const std::string &terminator = "")
: SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
{
IsolatedInitialize(MakeParameters(Name::Uppercase(), uppercase)(Name::GroupSize(), groupSize)(Name::Separator(), ConstByteArrayParameter(separator))(Name::Terminator(), ConstByteArrayParameter(terminator)));
IsolatedInitialize(MakeParameters(Name::Uppercase(), uppercase)(Name::GroupSize(), outputGroupSize)(Name::Separator(), ConstByteArrayParameter(separator))(Name::Terminator(), ConstByteArrayParameter(terminator)));
}

//! \brief Initialize or reinitialize this object, without signal propagation
//! \param parameters a set of NameValuePairs used to initialize this object
//! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
//! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached
//! transformations. If initialization should be propagated, then use the Initialize() function.
//! \details The following code modifies the padding and line break parameters for an encoder:
//! <pre>
//! Base32Encoder encoder;
//! AlgorithmParameters params = MakeParameters(Pad(), false)(InsertLineBreaks(), false);
//! encoder.IsolatedInitialize(params);
//! </pre>
void IsolatedInitialize(const NameValuePairs &parameters);
};

Expand All @@ -54,8 +34,6 @@ class Base32Encoder : public SimpleProxyFilter
class Base32Decoder : public BaseN_Decoder
{
public:
//! \brief Construct a Base32Decoder
//! \param attachment a BufferedTrasformation to attach to this object
Base32Decoder(BufferedTransformation *attachment = NULL)
: BaseN_Decoder(GetDefaultDecodingLookupArray(), 5, attachment) {}

Expand Down
57 changes: 3 additions & 54 deletions base64.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// base64.h - written and placed in the public domain by Wei Dai

//! \file base64.h
//! \file
//! \brief Classes for the Base64Encoder, Base64Decoder, Base64URLEncoder and Base64URLDecoder

#ifndef CRYPTOPP_BASE64_H
Expand All @@ -18,30 +18,12 @@ NAMESPACE_BEGIN(CryptoPP)
class Base64Encoder : public SimpleProxyFilter
{
public:
//! \brief Construct a Base64Encoder
//! \param attachment a BufferedTrasformation to attach to this object
//! \param insertLineBreaks a BufferedTrasformation to attach to this object
//! \param maxLineLength the lenght of a line if line breaks are used
//! \details Base64Encoder() constructs a default encoder. The constructor lacks parameters for padding.
//! You must use IsolatedInitialize() to modify the Base64Encoder after construction.
//! \sa IsolatedInitialize() for an example of modifying a Base64Encoder after construction.
Base64Encoder(BufferedTransformation *attachment = NULL, bool insertLineBreaks = true, int maxLineLength = 72)
: SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
{
IsolatedInitialize(MakeParameters(Name::InsertLineBreaks(), insertLineBreaks)(Name::MaxLineLength(), maxLineLength));
}

//! \brief Initialize or reinitialize this object, without signal propagation
//! \param parameters a set of NameValuePairs used to initialize this object
//! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
//! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached
//! transformations. If initialization should be propagated, then use the Initialize() function.
//! \details The following code modifies the padding and line break parameters for an encoder:
//! <pre>
//! Base64Encoder encoder;
//! AlgorithmParameters params = MakeParameters(Pad(), false)(InsertLineBreaks(), false);
//! encoder.IsolatedInitialize(params);
//! </pre>

void IsolatedInitialize(const NameValuePairs &parameters);
};

Expand All @@ -52,16 +34,9 @@ class Base64Encoder : public SimpleProxyFilter
class Base64Decoder : public BaseN_Decoder
{
public:
//! \brief Construct a Base64Decoder
//! \param attachment a BufferedTrasformation to attach to this object
Base64Decoder(BufferedTransformation *attachment = NULL)
: BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {}

//! \brief Initialize or reinitialize this object, without signal propagation
//! \param parameters a set of NameValuePairs used to initialize this object
//! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
//! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on
//! attached transformations. If initialization should be propagated, then use the Initialize() function.
void IsolatedInitialize(const NameValuePairs &parameters)
{CRYPTOPP_UNUSED(parameters);}

Expand All @@ -76,31 +51,12 @@ class Base64Decoder : public BaseN_Decoder
class Base64URLEncoder : public SimpleProxyFilter
{
public:
//! \brief Construct a Base64URLEncoder
//! \param attachment a BufferedTrasformation to attach to this object
//! \param insertLineBreaks a BufferedTrasformation to attach to this object
//! \param maxLineLength the lenght of a line if line breaks are used
//! \details Base64URLEncoder() constructs a default encoder. The constructor ignores insertLineBreaks
//! and maxLineLength because the web and URL safe specifications don't use them. They are present
//! in the constructor for API compatibility with Base64Encoder (drop-in replacement).
//! \details If you need line breaks and padding, then you must use IsolatedInitialize() to set them
//! after constructing a Base64URLEncoder.
//! \sa IsolatedInitialize() for an example of modifying a Base64URLEncoder after construction.
Base64URLEncoder(BufferedTransformation *attachment = NULL, bool insertLineBreaks = false, int maxLineLength = -1)
: SimpleProxyFilter(new BaseN_Encoder(new Grouper), attachment)
{
IsolatedInitialize(MakeParameters(Name::InsertLineBreaks(), false)(Name::MaxLineLength(), -1)(Name::Pad(),false));
IsolatedInitialize(MakeParameters(Name::InsertLineBreaks(), insertLineBreaks)(Name::MaxLineLength(), maxLineLength));
}

//! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
//! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on attached
//! transformations. If initialization should be propagated, then use the Initialize() function.
//! \details The following code modifies the padding and line break parameters for an encoder:
//! <pre>
//! Base64URLEncoder encoder;
//! AlgorithmParameters params = MakeParameters(Name::Pad(), true)(Name::InsertLineBreaks(), true);
//! encoder.IsolatedInitialize(params);
//! </pre>
void IsolatedInitialize(const NameValuePairs &parameters);
};

Expand All @@ -111,16 +67,9 @@ class Base64URLEncoder : public SimpleProxyFilter
class Base64URLDecoder : public BaseN_Decoder
{
public:
//! \brief Construct a Base64URLDecoder
//! \param attachment a BufferedTrasformation to attach to this object
Base64URLDecoder(BufferedTransformation *attachment = NULL)
: BaseN_Decoder(GetDecodingLookupArray(), 6, attachment) {}

//! \brief Initialize or reinitialize this object, without signal propagation
//! \param parameters a set of NameValuePairs used to initialize this object
//! \details IsolatedInitialize() is used to initialize or reinitialize an object using a variable
//! number of arbitrarily typed arguments. IsolatedInitialize() does not call Initialize() on
//! attached transformations. If initialization should be propagated, then use the Initialize() function.
void IsolatedInitialize(const NameValuePairs &parameters)
{CRYPTOPP_UNUSED(parameters);}

Expand Down
Loading

0 comments on commit 62618fd

Please sign in to comment.