aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/hash
Commit message (Collapse)AuthorAgeFilesLines
...
* Add compile-time rotation functionsJack Lloyd2017-10-1211-370/+381
| | | | | | | | | | | | | | | | | The problem with asm rol/ror is the compiler can't schedule effectively. But we only need asm in the case when the rotation is variable, so distinguish the two cases. If a compile time constant, then static_assert that the rotation is in the correct range and do the straightforward expression knowing the compiler will probably do the right thing. Otherwise do a tricky expression that both GCC and Clang happen to have recognize. Avoid the reduction case; instead require that the rotation be in range (this reverts 2b37c13dcf). Remove the asm rotations (making this branch illnamed), because now both Clang and GCC will create a roll without any extra help. Remove the reduction/mask by the word size for the variable case. The compiler can't optimize that it out well, but it's easy to ensure it is valid in the callers, especially now that the variable input cases are easy to grep for.
* Merge GH #1248 Unroll SM3 compression loopJack Lloyd2017-10-111-56/+94
|\
| * Unroll SM3 compression functionJack Lloyd2017-10-101-56/+94
| |
* | Mark some functions of MDx_HashFunction finalJack Lloyd2017-10-051-3/+3
|/ | | | | The class itself can't be final but we can final the overrides from HashFunction, which helps the compiler devirtualize.
* Avoid empty methods, use =default or add a commentJack Lloyd2017-10-031-1/+1
| | | | Sonar
* Add wrappers for reinterpret_cast between char* and uint8_t*Jack Lloyd2017-10-031-1/+1
| | | | | | | Generally speaking reinterpret_cast is sketchy stuff. But the special case of char*/uint8_t* is both common and safe. By isolating those, the remaining (likely sketchy) cases are easier to grep for.
* Remove protected functions from final classesJack Lloyd2017-10-023-6/+5
| | | | | | Mostly residue from the old system of splitting impls among subclasses Found with Sonar
* Fix some cast warnings from SonarJack Lloyd2017-10-011-1/+1
|
* Use explicit on more single-argument constructorsJack Lloyd2017-09-303-4/+4
|
* Apply final annotations to the library alsoJack Lloyd2017-09-222-3/+3
| | | | | Done by a perl script which converted all classes to final, followed by selective reversion where it caused compilation failures.
* Fix for minimized buildJack Lloyd2017-09-211-0/+1
|
* Header file cleanupsJack Lloyd2017-09-215-5/+0
| | | | Some help from include-what-you-use
* Change header guard format to BOTAN_FOO_H_Jack Lloyd2017-09-2023-46/+46
| | | | | | ISO C++ reserves names with double underscores in them Closes #512
* More annotationsJack Lloyd2017-09-192-4/+4
|
* Add API stability annotations.Jack Lloyd2017-09-1921-29/+29
| | | | | Defined in build.h, all equal to BOTAN_DLL so ties into existing system for exporting symbols.
* Fix Wshadow warningJack Lloyd2017-09-171-5/+5
|
* De-inline xor_buf, add SIMD and unrollingJack Lloyd2017-09-161-11/+24
| | | | Improves CBC and OCB performance with AES-NI quite noticably
* Rename file to match conventionsJack Lloyd2017-08-311-0/+0
| | | | [ci skip]
* More MSVC warnings fixesJack Lloyd2017-08-311-1/+1
|
* Fix various MSVC warningsJack Lloyd2017-08-311-6/+6
| | | | Based on VC2017 output
* Avoid math on booleansJack Lloyd2017-08-291-3/+3
| | | | Sonar find
* Modify GOST-34.11 hash to avoid a GCC miscompilation.Jack Lloyd2017-08-131-1/+4
| | | | | | | | | | | | For whatever reason GCC 7 on i386 miscompiles this loop under -O3. I was not able to reduce the bug to a small testcase - extracting the problem section of the code to its own file, it behaves correctly. Also oddly, I was never able to repro this using Arch's gcc-multilib i386 compiler. But when compiled with the 'native' i386 compiler in a chroot it immediately fails. See GH #1148 and GH #882
* Remove STREEBOG_AX and STREEBOG_C from header.Daniel Wyatt2017-08-041-4/+0
| | | | (Missed hunk in previous commit)
* streebog: Addressing review comments.Daniel Wyatt2017-08-043-852/+46
|
* Add Streebog hash (GOST R 34.11-2012).Daniel Wyatt2017-08-045-0/+1934
|
* Merge GH #1094 Add initial BearSSL providerJack Lloyd2017-08-021-1/+16
|\
| * BearSSL: implement PR feedback and compare ECGroup OID namePatrick Wildt2017-07-051-6/+6
| | | | | | | | | | | | | | This commit implements the feedback from @securitykernel on the PR and also changes the EC Group comparison to use the OID, akin to OpenSSL. The EC Group comparison was needed before GH #1093 was merged, but now we can go use the OpenSSL variant.
| * BearSSL: Initial support and hash testsPatrick Wildt2017-07-051-1/+16
| | | | | | | | | | | | | | | | | | BearSSL is an implementation of the SSL/TLS protocol in C aiming to be correct and secure, small and highly portable. Thus making it nicer to be included in a rather sparse bootloader. This commit adds support for BearSSL's hash routines only, with more stuff coming up in following commits. The goal is to be able to test BearSSL using Botan's extensive testsuite.
* | Use native compiler versioning of MSVCSimon Warta2017-07-312-2/+2
|/ | | | | | | | | | | | | | | | While using marketing names like 2013, 2015 etc. is more convenient at first sight, it requires keeping a table about all supported compiler versions, as there is no formular to calculate between the representations. Keeping a list of compilers leads to the following issue: if one version of Botan is released in 2017, requiring MSVS 2015 for one module, this source can be compiled using MSVS 2015 and 2017 but not a future version like 2019. Also preview/development versions of MSVC that may use an intermediate version number cannot be handled with the marketing name table because they may be unknown to the general public.
* Cleanups in SM3 codeJack Lloyd2017-06-291-81/+25
| | | | | | | | T[] variable is actually a constant, so precompute it in SM3_TJ W1 expansion is very simple and can just be done inline. Somewhat faster on my machine.
* Maintainer mode fixes: old style casts, missing override, unused functionsJack Lloyd2017-06-083-36/+13
|
* fix doxygen build: hide method definitions with ifdefs where theZoltan Gyarmati2017-06-084-0/+8
| | | | | | | function declaration is already hidden, fix some param names in doxygen comments, fixes #1067 This work was sponsored by Ribose Inc (@riboseinc).
* Merge GH #1056 Add HashFunction::copy_state and port to OpenSSL 1.1.0Jack Lloyd2017-05-2241-0/+202
|\
| * Fix for old GCC and ClangJack Lloyd2017-05-222-2/+2
| | | | | | | | | | They don't understand unique_ptr<Derived> to unique_ptr<Base> without help https://stackoverflow.com/questions/22018115/converting-stdunique-ptrderived-to-stdunique-ptrbase
| * Add HashFunction::copy_stateJack Lloyd2017-05-2241-0/+177
| | | | | | | | See GH #1037
* | Disable ARMv8 SHA extensions on 32-bitJack Lloyd2017-05-222-2/+2
| | | | | | | | | | | | | | Works everywhere but Apple Clang. Could handle this with a hack to configure but running ARMv8 in 32-bit mode is rare and suboptimal, and it would be better to deal with this using compile-time feature detection.
* | Change SHA-2 to use a single convention for CPU extnJack Lloyd2017-05-203-9/+8
| |
* | Set minimum compiler versions for ARMv8 SHA intrinsicsJack Lloyd2017-05-202-0/+10
| |
* | Small cleanups for ARM SHA codeJack Lloyd2017-05-204-16/+24
| | | | | | | | | | | | | | Fix for new define syntax, remove old style casts. Add some randomly generated longer SHA-256 vectors, previously had precisely zero multiblock tests.
* | Add SHA-256 using ARMv8 instructionsJack Lloyd2017-05-204-35/+240
| | | | | | | | Based on patch from Jeffrey Walton in GH #841
* | Add ARMv8 SHA-1 supportJack Lloyd2017-05-204-0/+222
|/ | | | | | Based on patch from Jeffrey Walton in GH #840 Only tested in qemu so far.
* 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