aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/hash
Commit message (Collapse)AuthorAgeFilesLines
* Set minimum compiler versions for SHA intrinsicsJack Lloyd2017-05-192-0/+12
|
* Add support for Intel SHA-1/SHA-2 instructionsJack Lloyd2017-05-198-1/+465
| | | | Based on GH #807 and #808
* Merge GH #966 Add SM3 hash functionJack Lloyd2017-04-054-0/+334
|\
| * Re-roll two loops in SM3 hash compression function that are causing test ↵Daniel Wyatt2017-04-041-94/+32
| | | | | | | | failures for some compilers.
| * Unroll loops in SM3 hash compress_n.Daniel Wyatt2017-04-032-65/+241
| |
| * Fix info.txt date and update to new format.Daniel Wyatt2017-04-031-1/+3
| |
| * Merge remote-tracking branch 'origin/master' into sm3Daniel Wyatt2017-04-0321-21/+63
| |\
| * | Add SM3 hash functionDaniel Wyatt2017-04-034-0/+218
| | |
* | | Content:Tomasz Frydrych2017-04-032-2/+2
| |/ |/| | | | | | | | | | | | | | | * fixes for deprecated constructions in c++11 and later (explicit rule of 3/5 or implicit rule of 0 and other violations) * `default` specifier instead of `{}` in some places(probably all) * removal of unreachable code (for example `return` after `throw`) * removal of compilation unit only visible, but not used functions * fix for `throw()` specifier - used instead `BOTAN_NOEXCEPT` * removed not needed semicolons
* | Remove "Dirty hack" for multiple defines in lex_me_harder()Simon Warta2017-04-0221-21/+63
|/
* Convert to using standard uintN_t integer typesJack Lloyd2016-12-1843-365/+365
| | | | | | Renames a couple of functions for somewhat better name consistency, eg make_u32bit becomes make_uint32. The old typedefs remain for now since probably lots of application code uses them.
* Avoid unneeded code - previous conditionals handle these casesJack Lloyd2016-11-251-8/+0
|
* Adds SHAKE support for XMSSMatthias Gierlings2016-11-251-0/+8
| | | | | | | - Enables code for shake support - Creating SHAKE hash function by name now allows to select output size of 256 Bit for SHAKE128 and 512 Bit for SHAKE256. - Adds *self-generated*, unverified test vectors for XMSS/SHAKE.
* Add SHAKE-128 and SHAKE-256 as hash functionsJack Lloyd2016-11-107-75/+279
|
* Move ISA optimized versions under the main algo dirJack Lloyd2016-11-032-4/+0
| | | | | | | | Previously it made sense for them to be in distinct dirs because they were standalone. However with #580 that is no longer the case, so move them to subdirs. Configure knows that anything underneath a directory has a dependency on the parent dir, so update info.txt files accordingly to remove explicit dependencies where set.
* Correct name for Comb4PJack Lloyd2016-10-271-1/+1
|
* Remove alias logic from SCAN_NameJack Lloyd2016-10-211-50/+62
| | | | | | This required taking a global lock and doing a map lookup each time an algorithm was requested (and so many times during a TLS handshake).
* Remove Algo_RegistryJack Lloyd2016-10-2110-121/+181
| | | | | | | I repent my use of global constructors. I repent my use of global locks. Hopefully I will never touch this code again. :)
* Merge GH #669 Add SHA-3, SHAKE-128, and BoringSSL-mode NewHopeJack Lloyd2016-10-207-91/+315
|\
| * Add proper SHA-3Jack Lloyd2016-10-197-91/+315
| | | | | | | | | | | | | | | | | | | | Kind of a copy and paste of Keccak, but only a single copy of the permutation at least. Keccak depends on SHA-3 instead of the reverse, so that SHA-3 can be enabled without also bringing in an unapproved hash function. Updates newhope code and removes API function newhope_hash which was an unofficial SHA-3-256.
* | Improve stream doxygen [ci skip]René Korthaus2016-10-191-1/+1
| |
* | Improve hash doxygen [ci skip]René Korthaus2016-10-191-3/+12
|/
* Add ISA annotations to functions using SIMD, AES, etcJack Lloyd2016-10-141-0/+1
| | | | | | | | Also emit `#pragma GCC target` in the ISA specific amalgamation files. This allows compiling without any special compiler flags, at least with GCC 6.2 and Clang 3.8. The ISA annotations are ignored in MSVC, which just emits whatever instruction the intrinsic requires.
* Change T::provider to return std::stringJack Lloyd2016-09-151-2/+1
|
* Add T::provider() to allow user to inquire about implementation usedJack Lloyd2016-09-151-0/+7
| | | | | For block ciphers, stream ciphers, hashes, MACs, and cipher modes. Cipher_Mode already had it, with a slightly different usage.
* Merge optimized implementations into base classJack Lloyd2016-09-156-75/+47
| | | | | | | | | | Various algorithms had an optimized implementation (for SSE2, AVX2, etc) which was offered alongside the 'base' implementation. This is admittedly very useful for testing, but it breaks user expectations in bad ways. See GH #477 for background. Now encrypting with `AES_128` (say) just runs whatever implementation is best on the current processor/build.
* Merge GH #613 NewHope R-LWE key exchangeJack Lloyd2016-09-052-6/+9
|\
| * Add NEWHOPE KEM schemeJack Lloyd2016-08-302-6/+9
| | | | | | | | | | | | | | | | | | | | Provides conjectured 200-bit security against a quantum attacker. Based on the public domain reference implementation at https://github.com/tpoeppelmann/newhope and bit-for-bit compatible with that version. Test vectors generated by the reference testvector.c
* | Remove deprecated hashes MD2, HAS-160, and RIPEMD-128Jack Lloyd2016-09-0210-600/+0
|/
* improve parallel hash tests + memory leak fixDaniel Neus2016-07-201-1/+1
| | | | | | | | | | - add one test with SHA-256,SHA-512 - test Parallel::clone() - test Parallel ctor - fix memory leak in Parallel::clone(): Currently Parallel::clone() calls hash->clone() (first heap allocation) and after this clone() calls Parallel(const std::vector<HashFunction*>& in) which does another heap allocation. So its sufficient to pass the hash pointer to the Parallel ctor instead of a clone
* Remaining cppcheck fixes that are not covered by GH #444Daniel Neus2016-03-051-1/+1
|
* cppcheck fixes: Class 'X' has a constructor with 1 argument that is not ↵Daniel Neus2016-03-055-5/+5
| | | | explicit.
* Fix remaining Wshadow warnings and enable on gcc and clangRené Korthaus2016-02-182-3/+3
|
* Order the accesses to A[] in the Keccak permutation.Jack Lloyd2016-02-061-17/+17
| | | | | | Consistent speed up of about ~5% on my machine. Also tried moving all the A[] values to local registers, was slower.
* Fix indentJack Lloyd2016-01-301-171/+193
|
* Blake2b: use rotate_right instead of a macrocynecx2016-01-271-7/+5
|
* Blake2b: Fix for MSVCcynecx2016-01-261-5/+3
|
* Blake2b: Add copyright & fix header guardcynecx2016-01-262-3/+17
|
* Add Blake2b hash functioncynecx2016-01-264-0/+264
|
* Add final attribute to many classesJack Lloyd2016-01-1019-26/+28
| | | | | | | In some cases this can offer better optimization, via devirtualization. And it lets the user know the class is not intended for derivation. Some discussion in GH #402
* Mass-prefix member vars with m_René Korthaus2016-01-0837-704/+704
|
* Merge the openssl code together.Jack Lloyd2015-12-192-122/+0
| | | | | | | Having the code diffused all over the place was ugly and would not scale well to multiple alternative providers. GH #368
* Missing addsJack Lloyd2015-12-111-1/+1
|
* Reroot the exception hierarchy into a toplevel Exception classJack Lloyd2015-12-111-2/+2
| | | | | | | | As the alternatives are unfortunate for applications trying to catch all library errors, and it seems deriving from std::runtime_error causes problems with MSVC DLLs (GH #340) Effectively reverts 2837e915d82e43
* Update and consolidate the test framework.Jack Lloyd2015-11-111-1/+1
| | | | | | | | | | | The tests previously had used 4 to 6 different schemes internally (the vec file reader framework, Catch, the old InSiTo Boost.Test tests, the PK/BigInt tests which escaped the rewrite in 1.11.7, plus a number of one-offs). Converge on a design that works everywhere, and update all the things. Fix also a few bugs found by the test changes: SHA-512-256 name incorrect, OpenSSL RC4 name incorrect, signature of FFI function botan_pubkey_destroy was wrong.
* Break up openssl providerJack Lloyd2015-10-192-0/+122
| | | | | | For RSA, RC4, and ECDSA put the openssl versions in the same directory as the base version. They just rely on a macro check for the openssl module to test for the desire to use OpenSSL.
* Address some review comments by Simon. GH #279Jack Lloyd2015-09-211-1/+1
|
* Internal header cleanupsJack Lloyd2015-09-1923-63/+17
| | | | Only user-visible change is the removal of get_byte.h
* Handle dependencies re static linking. GH #279Jack Lloyd2015-09-174-4/+31
| | | | | | | | | | | | | | Previously we were hanging on the type destructors to pull in the relevant objects. However that fails in many simple cases where the object is never deleted. For every type involved in the algo registry add static create and providers functions to access the algo registry. Modify lookup.h to be inline and call those functions, and move a few to sub-headers (eg, get_pbkdf going to pbkdf.h). So accessing the registry involves going through the same file that handles the initialization, so there is no way to end up with missing objs.
* Fix static lib registration for block, hash, mac, stream, kdfJack Lloyd2015-09-1022-46/+184
| | | | | | | | | | | The support problems from having static libraries not work in the obvious way will be endless trouble. Instead have each set of registrations tag along in a source file for the basic type, at the cost of some extra ifdefs. On shared libs this is harmless - everything is going into the shared object anyway. With static libs, this means pulling in a single block cipher pulls in the text of all the them. But that's still strictly better than the amalgamation (which is really pulling in everything), and it works (unlike status quo).