summaryrefslogtreecommitdiff
path: root/cryptlib.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Whitespace check-inJeffrey Walton2018-12-041-22/+20
|
* Move DEFAULT_CHANNEL and AAD_CHANNEL defs into cryptlib.cpp (GH #751)Jeffrey Walton2018-12-031-0/+36
| | | | | | | | The library used to provide DEFAULT_CHANNEL and AAD_CHANNEL this way. We experienced Static Initialization Order Fiasco crashes on occassion, so we moved them into cryptlib.h with internal linkage. The cost was, each translation unit got a copy of the strings which contributed to bloat. Issue 751 shows Clang compiles the global constructors for DEFAULT_CHANNEL and AAD_CHANNEL above the base ISA so we caught crashes on OS X with down-level hardware. We are now at a "pick your poison" point. We selected Static Initialization Order Fiasco because it seems to be less prevalent. Hat tip to the C++ Committee for allowing this problem to fester for three decades.
* Remove Thread and Socket classes (GH #208, PR #703)Jeffrey Walton2018-08-171-6/+0
| | | Also see https://groups.google.com/forum/#!topic/cryptopp-users/5btwLoxXXD4.
* Add PtrAdd and PtrSub helper functionsJeffrey Walton2018-07-101-10/+10
| | | | This helps contain UB on pointer subtraction by ensuring a ptrdiff_t is used. The code is a little uglier but it is also more portable.
* Increase use of ptrdiff_t when performing pointer mathJeffrey Walton2018-07-091-4/+4
| | | | | | Increase use of ptrdiff_t when performing pointer math Reduce AlgorithmProvider overrides Fix CPU_ProbeARMv7 on Aarch64
* Make AuthenticatedSymmetricCipher::AlgorithmName non-pureJeffrey Walton2018-04-051-0/+6
| | | | Also see https://stackoverflow.com/q/49658309/608639
* Cutover PBKDF to KeyDerivationFunction interface (GH #610, PR #612)Jeffrey Walton2018-03-291-5/+0
|
* Add KeyDerivationFunction interface (GH #610, PR #611)Jeffrey Walton2018-03-291-0/+25
|
* Clear clang-tidy warningsJeffrey Walton2018-01-241-63/+98
|
* Remove unneeded Doxygen directiveJeffrey Walton2018-01-191-1/+0
|
* Fix failed self test under Clang (GH #533)Jeffrey Walton2017-12-251-1/+1
| | | | This may cause GH #300, "Clang 3.9 and missing member definitions for template classes" or GH #294, "Fix clang warnings about undefined variable templates in pkcspad.h" to resurface. Man I hope not...
* Use ptrdiff_t cast in BlockTransformation (GH #549)Jeffrey Walton2017-12-171-4/+4
|
* Fix Clang 5.0 "runtime error: addition of unsigned offset to 0xXXXX ↵Jeffrey Walton2017-12-161-6/+7
| | | | overflowed to 0xYYYY" (GH #549)
* Change Doxygen comment style from //! to ///Jeffrey Walton2017-11-291-16/+16
| | | | Also see https://groups.google.com/forum/#!topic/cryptopp-users/A7-Xt5Knlzw
* Update documentationJeffrey Walton2017-11-121-25/+0
| | | | Removed defined-out code
* Reduce C++ file scope class objectsJeffrey Walton2017-11-121-20/+8
| | | | Update comments and documentation
* Update documentationJeffrey Walton2017-10-011-1/+2
|
* Update StreamTransformation and ProcessLastBlockJeffrey Walton2017-09-291-0/+17
| | | | | | Some authenticated encryption modes have needs that are not expressed well with MandatoryBlockSize() and MinLastBlockSize(). When IsLastBlockSpecial() returns true three things happen. First, standard block cipher padding is not applied. Second, the ProcessLastBlock() is used that provides inString and outString lengths. Third, outString is larger than inString by 2*MandatoryBlockSize(). That is, there's a reserve available when processing the last block. The return value of ProcessLastBlock() indicates how many bytes were written to outString. A filter driving data will send outString and returned length to an AttachedTransformation() for additional processing.
* Backed off assert.Jeffrey Walton2017-08-151-2/+1
| | | | Its too noisy
* Clear coverity finding FORWARD_NULL (CID 147865)Jeffrey Walton2017-05-201-4/+5
|
* Revert "Clear coverity finding FORWARD_NULL (CID 147865)"Jeffrey Walton2017-05-201-4/+5
| | | | This broke some self tests.
* Clear coverity finding FORWARD_NULL (CID 147865)Jeffrey Walton2017-05-201-5/+4
|
* Add tests for Information Dispersal and Secret SharingJeffrey Walton2017-05-091-3/+0
|
* Add variable block size support for block ciphersJeffrey Walton2017-05-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should lead the way for more modern block ciphers like Threefish and Kalyna. It tested well with both regular cipher modes (the mode has an instance of the cipher) and external cipher modes (the cipher and mode are distinct objects, and the mode holds a reference to the cipher). We still have to work out the details of naming a cipher. For example, Kalyna with a 128-bit key can use a 128-bit or 256-bit block size. Kalyna-128 is not enough to describe the algorithm and locate it in the object registry. Kalyna-128-128 looks kind of weird; maybe Kalyna-128(128) or Kalyna-128(256) would be better. Here are the initial test cases to verify functionality: byte key[64] = {}, iv[32] = {}; ECB_Mode<Kalyna>::Encryption enc1; enc1.SetKey(key, 16); CBC_Mode<Kalyna>::Encryption enc2; enc2.SetKeyWithIV(key, 16, iv); AlgorithmParameters params = MakeParameters (Name::BlockSize(), 32) (Name::IV(), ConstByteArrayParameter(iv, 32)); CTR_Mode<Kalyna>::Encryption enc3; enc3.SetKey(key, 16, params); CBC_Mode<Kalyna>::Encryption enc4; enc4.SetKey(key, 32, params); Kalyna::Encryption enc5; ECB_Mode_ExternalCipher::Encryption ecb(enc5); ecb.SetKey(key, 16, params); Kalyna::Encryption enc6; ECB_Mode_ExternalCipher::Encryption cbc(enc6); cbc.SetKey(key, 32, params);
* Simplify C++ dynamic object initializationJeffrey Walton2017-03-201-22/+27
| | | | | | | | | | | Wrap DetectArmFeatures and DetectX86Features in InitializeCpu class Use init_priority for InitializeCpu Remove HAVE_GCC_CONSTRUCTOR1 and HAVE_GCC_CONSTRUCTOR0 Use init_seg(<name>) on Windows and explicitly insert at XCU segment Simplify logic for HAVE_GAS Remove special recipies for MACPORTS_GCC_COMPILER Move C++ static initializers into anonymous namespace when possible Add default NullNameValuePairs ctor for Clang
* Updated static initializersJeffrey Walton2017-03-171-18/+15
| | | | | When MSVC init_seg or GCC init_priority is available, we don't need to use the Singleton. We only need to create a file scope class variable and place it in the segment for MSVC or provide the attribute for GCC. An additional upside is we cleared all the memory leaks that used to be reported by MSVC for debug builds.
* Avoid inlining LibraryVersion (Issue 371)Jeffrey Walton2017-03-141-1/+1
|
* Add C++ nullptr support (Issue 383)Jeffrey Walton2017-03-011-2/+2
|
* Remove NULL_CHANNEL and CW8 workaround (Issue 382)Jeffrey Walton2017-03-011-3/+0
|
* Change to more intuitive names LibraryVersion and HeaderVersion (Issue 371)Jeffrey Walton2017-01-281-1/+1
|
* Add BuildVersion and RuntimeVersion functions (Issue 371)Jeffrey Walton2017-01-281-1/+10
| | | | These function are intended to catch mining and matching of library versions. BuildVersion provides CRYPTOPP_VERSION when the shared object was built. RuntimeVersion provides CRYPTOPP_VERSION the app compiled against, which could be different than the shared object's version
* Change file preamble to include "originally written by Wei Dai"Jeffrey Walton2017-01-271-1/+1
| | | | We have made a fair number of changes, and we don't want WD to receive credit for issues he was not part of
* spelling fixesklemens2016-12-271-2/+2
|
* Silence select conversion warnings (Issue 340)Jeffrey Walton2016-12-021-3/+15
|
* Fix Solaris GCC and "constructor priorities are not supported"Jeffrey Walton2016-09-191-4/+0
|
* Add CRYPTOPP_ASSERT (Issue 277, CVE-2016-7420)Jeffrey Walton2016-09-161-15/+15
| | | | trap.h and CRYPTOPP_ASSERT has existed for over a year in Master. We deferred on the cut-over waiting for a minor version bump (5.7). We have to use it now due to CVE-2016-7420
* Updated documentation (Issue 248)Jeffrey Walton2016-08-271-9/+9
|
* Cleared most "Conditional jump or move depends on uninitialised value" ↵Jeffrey Walton2016-07-131-4/+5
| | | | (Issue 223)
* Cleared issues 11,12,13 (Clang integrated assembler), 58 (RC rollup), 66 ↵Jeffrey Walton2015-11-181-1/+47
| | | | (Coverity rollup)
* CRYPTOPP 5.6.3 RC6 checkinJeffrey Walton2015-11-051-840/+895
|
* Partial cut-over to static local strings for DefaultChannel() and ↵Jeffrey Walton2015-07-311-3/+2
| | | | AadChannel(). Cout-over DEFAULT_CHANNEL and AAD_CHANNEL to use them behind the scenes
* Cleared auto_ptr deprecation warning with C++11 under Debian 8/i686Jeffrey Walton2015-07-301-7/+14
|
* Fixed compiler errors on Apple due to cross product of {C++03,C++11} x ↵Jeffrey Walton2015-07-271-2/+2
| | | | {libc++, libstdc++}. It included bringing in the correct <memory> in <stdcpp.h>, and then only including <stdcpp.h> when <memory> was needed.
* Cut-in CRYPTOPP_ASSERT in all remaining header and source filesJeffrey Walton2015-07-261-9/+9
|
* Added "trap.h" include for header and source files that assertJeffrey Walton2015-07-261-0/+1
|
* Added GCC_DIAGNOSTIC_AWARE to help suppress some warnings on contemporary ↵Jeffrey Walton2015-06-291-0/+5
| | | | compilers. The macro was needed to help with managing old compilers, like GCC 4.2.1, present on OpenBSD
* fix CTR mode not allowing NULL as IVweidai2010-08-051-1/+1
|
* fix possible race condition in Singleton::Ref()weidai2010-06-181-1/+8
| | | | | tolerate double destruction of Singleton and g_nullNameValuePairs fix #include of standard headers
* add x86/x64 assembly for SHA-256,weidai2009-03-101-5/+8
| | | | | add DEFAULT_CHANNEL and AAD_CHANNEL, fix macChannel for AuthenticatedEncryptionFilter
* tweaks/fixes for 5.6weidai2009-03-031-0/+18
|