summaryrefslogtreecommitdiff
path: root/sha.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use std namespace for memset, memcpy, memcmp (#1204)Jeffrey Walton2023-04-151-5/+5
|
* Fix inline ASM on x86 (GH #1142)Jeffrey Walton2022-08-211-7/+9
|
* Update GCC clobber list for SHA-256 and SHA-512 (PR #1139)Jeffrey Walton2022-08-061-4/+8
| | | | | | * Clear documentation warning * Update GCC clobber list for SHA-256 and SHA-512 Also see PR #1133 and GH #1134
* Use CRYPTOPP_ARM_NEON_AVAILABLE in sha.cppJeffrey Walton2022-02-101-11/+40
|
* Consistently use cryptogams_ prefix for Andy Polyakov's code (PR #952)Jeffrey Walton2020-12-261-24/+24
|
* Fix conflicting Cryptogams API names on ARM with OpenSSL (GH #952)Sergiu Giurgiu2020-06-031-4/+4
|
* Breakout sha_block_data_order and sha_block_data_order_neon (GH #847)Jeffrey Walton2019-05-261-0/+51
|
* Fix SHA512 on ARM benchmarksJeffrey Walton2019-05-251-2/+2
| | | | This was a mistake when porting from Cryptogams to Crypto++. The macros VFP_ABI_PUSH and VFP_ABI_POP needed to be defined because they save and restore SIMD register state. They were originally missing during the port. The benchmarks would hang because the doubles we used for benchmarking were blown away in sha512_block_data_order_neon.
* Use CRYPTOGAMS_armcap_P for ARM (GH #846)Jeffrey Walton2019-05-241-31/+17
| | | | Andy advised against removing the global caps variable. This commit reintroduces CRYPTOGAMS_armcap_P. However, due to the shared object symbol loading problem, we needed to use CRYPTOGAMS_armcap_P as a global, and not CRYPTOGAMS_armcap as a local. Using CRYPTOGAMS_armcap_P directly caused the symbol to be marked as R_ARM_ABS32 which avoids the problem with R_ARM_REL32.
* Remove const_cast from CryptogamsArmCaps()Jeffrey Walton2019-05-231-27/+9
|
* Fix "unexpected reloc type 0x03" for ARM shared object (GH #846)Jeffrey Walton2019-05-221-23/+14
|
* Use void return value for Cryptogams SHA functionsJeffrey Walton2019-05-211-3/+3
|
* Update commentsJeffrey Walton2019-05-201-3/+4
|
* Fold declarations for CRYPTOGAMS_armcapsJeffrey Walton2019-05-201-3/+5
| | | | Also declare storage for CRYPTOGAMS_armcaps. This moves the symbol from BSS to initialized data. The Cryptogams module declares the symbol as common, so they are weak and use our declaration.
* Display C++ for SHA512_AlgorithmProvider on ARMJeffrey Walton2019-05-191-1/+1
|
* Update commentsJeffrey Walton2019-05-191-3/+4
|
* Return CRYPTOGAMS_armcaps in CryptogamsArmCapsJeffrey Walton2019-05-191-14/+14
|
* Disable Cryptogams ASM on static Transform functionJeffrey Walton2019-05-191-3/+3
| | | | This needs mmore testing.
* Add ARM SHA512 asm implementation from Cryptogams (GH #841, PR #843)Jeffrey Walton2019-05-191-42/+99
| | | | | | | Cryptogams is Andy Polyakov's project used to create high speed crypto algorithms and share them with other developers. Cryptogams has a dual license. First is the OpenSSL license because Andy contributes to OpenSSL. Second is a BSD license for those who want a more permissive license. Andy's implementation runs about 45% faster than C/C++ code. Testing on a 1.8 GHz Cortex-A17 shows Cryptograms at 45 cpb, and C++ at 79 cpb. The integration instructions are documented at [Cryptogams SHA](https://wiki.openssl.org/index.php/Cryptogams_SHA) on the OpenSSL wiki.
* Add ARM SHA256 asm implementation from Cryptogams (GH #840, PR #840)Jeffrey Walton2019-05-191-1/+49
| | | | | | | Cryptogams is Andy Polyakov's project used to create high speed crypto algorithms and share them with other developers. Cryptogams has a dual license. First is the OpenSSL license because Andy contributes to OpenSSL. Second is a BSD license for those who want a more permissive license. Andy's implementation runs about 45% faster than C/C++ code. Testing on a 1 GHz Cortex-A7 shows Cryptograms at 17 cpb, and C++ at 30 cpb. The integration instructions are documented at [Cryptogams SHA](https://wiki.openssl.org/index.php/Cryptogams_SHA) on the OpenSSL wiki.
* Add ARM SHA1 asm implementation from Cryptogams (GH #837, PR #838)Jeffrey Walton2019-05-181-0/+32
| | | | | | | | | Add ARM SHA1 asm implementation from Cryptogams. Cryptogams is Andy Polyakov's project used to create high speed crypto algorithms and share them with other developers. Cryptogams has a dual license. First is the OpenSSL license because Andy contributes to OpenSSL. Second is a BSD license for those who want a more permissive license. Andy's implementation runs about 30% faster than C/C++ code. Testing on a 1 GHz Cortex-A7 shows Cryptograms at 16 cpb, and C++ at 23 cpb. The integration instructions are documented at [Cryptogams SHA](https://wiki.openssl.org/index.php/Cryptogams_SHA) on the OpenSSL wiki.
* Restore unnamed namespace for SHA512_HashBlock_SSE2 (GH #684)Jeffrey Walton2018-12-281-5/+6
|
* Rename files with dashes to underscores (GH #736)Jeffrey Walton2018-11-101-1/+1
| | | | Also see https://groups.google.com/forum/#!topic/cryptopp-users/HBz-6gZZFOA on the mailing list
* Add proper declaration for Kalyna tables; and split from definitionsJeffrey Walton2018-10-281-2/+2
|
* Cleanup SHA SIMD source fileJeffrey Walton2018-10-281-71/+76
| | | | Add proper declaration for SHA256_K and SHA512_K tables; and split from definitions
* Fix spelling and grammarJeffrey Walton2018-10-131-1/+1
|
* Fix partial specializations for FixedSizeAllocatorWithCleanup (PR #710)Jeffrey Walton2018-08-241-3/+2
| | | | | Commit afbd3e60f68f effectively treated a symptom and not the underlying problem. The problem was linkers on 32-bit systems ignore CRYPTOPP_ALIGN_DAT(16) passed down by the compiler and align to 8-bytes or less. We have to use Wei's original code in some places. It is not a bad thing, but the bit fiddling is something we would like to contain a little more by depending more on language or platform features. This commit keeps the original changes which improve partial specializations; but fixes 32-bit linker behavior by effectively reverting afbd3e60f68f and e054d36dc88d00. We also add more comments so the next person has understands why things are done they way they are.
* Fix alignment on Win32 and Solaris Sparc (PR #709)Jeffrey Walton2018-08-231-2/+3
| | | | | | | These fixes were interesting in a morbid sort of way. I thought the FixedSizeAllocatorWithCleanup specializations faithfully reproduced semantics but I was wrong on Win32 and Sparc. Also see Commit e054d36dc88d. It seems there was another requirement or dependency that we missed, but it was not readily apparent. If I am parsing results correctly (which I may not be), it appears the bit twiddling using 8 byte alignment had more influence on alignment than I originally thought based on use of CRYPTOPP_BOOL_ALIGN16 and T_Align16. Or maybe the alignment attributes specified by CRYPTOPP_ALIGN_DATA are not being honored like they should for stack allocations. This check-in avoids some uses of x86 movdqa (aligned) in favor of movdqu (unaligned). The uses were concentrated on memory operands which were 8-byte aligned instead of 16-byte aligned. It is not clear to me how the specializations lost 8-bytes of alignment. The check-in also enlists CRYPTOPP_ASSERT to tell us when there's a problem so we don't need to go hunting for bugs.
* Disable X32 inline assembly (GH #686, PR #704)Jeffrey Walton2018-08-181-7/+0
| | | Also use CRYPTOPP_DISABLE_XXX_ASM consistently. The pattern is needed for Clang which still can't compile Intel assembly language. Also see http://llvm.org/bugs/show_bug.cgi?id=24232.
* Whitespace check-inJeffrey Walton2018-08-171-15/+15
|
* Clear unused variable warnings under MSVCJeffrey Walton2018-08-031-1/+1
|
* Cleanup SHA512::Transform codeJeffrey Walton2018-07-211-39/+15
| | | | The extra code paths added at GH #689 were no longer needed after GH #691
* Whitespace check-inJeffrey Walton2018-07-201-1/+1
|
* Fix Solaris 11/Sparc crash in SHA-384 (GH #689, GH #403)Jeffrey Walton2018-07-201-60/+87
| | | | I believe Andrew Marlow first reported it. At the time we could not get our hands on hardware to fully test things. Instead we were using -xmemalign=4i option as a band-aide to avoid running afoul of the Sparc instruction that moves 64-bits of data in one shot.
* Cleanup defines in sha.cppJeffrey Walton2018-07-151-4/+4
| | | | There's no need for extra guards with CRYPTOPP_DISABLE_SHA_ASM because relevant macros are undefined
* Disable X32 for SHA (GH #686)Jeffrey Walton2018-07-151-24/+13
| | | | Thanks to Peter Cordes for the feedback
* Add ARMv8.4 cpu feature detection support (GH #685) (#687)Jeffrey Walton2018-07-151-9/+16
| | | | | | | | | This PR adds ARMv8.4 cpu feature detection support. Previously we only needed ARMv8.1 and things were much easier. For example, ARMv8.1 `__ARM_FEATURE_CRYPTO` meant PMULL, AES, SHA-1 and SHA-256 were available. ARMv8.4 `__ARM_FEATURE_CRYPTO` means PMULL, AES, SHA-1, SHA-256, SHA-512, SHA-3, SM3 and SM4 are available. We still use the same pattern as before. We make something available based on compiler version and/or preprocessor macros. But this time around we had to tighten things up a bit to ensure ARMv8.4 did not cross-pollinate down into ARMv8.1. ARMv8.4 is largely untested at the moment. There is no hardware in the field and CI lacks QEMU with the relevant patches/support. We will probably have to revisit some of this stuff in the future. Since this update applies to ARM gadgets we took the time to expand Android and iOS testing on Travis. Travis now tests more platforms, and includes Autotools and CMake builds, too.
* Fix "Error: symbol SHA512_Round is already defined" (GH #684)Jeffrey Walton2018-07-131-3/+10
|
* Add algorithm provider member function to Algorithm classJeffrey Walton2018-07-061-0/+71
|
* Re-engage SSE2 ASM for SHA-256 (GH# 674)Jeffrey Walton2018-06-291-1/+1
| | | | I'm not usre where exactly the break occured, but it was probably due to the BASE+SIMD rewrite. Thanks to tesbayda for tracking it down.
* Add CRYPTOPP_TABLE, remove CRYPTOPP_SECTIONJeffrey Walton2018-01-211-7/+6
|
* Switch to rotlConstant and rotrConstantJeffrey Walton2017-11-251-14/+14
| | | | This will help Clang and its need for a constexpr
* Add Power8 SHA256 and SHA512 support (GH #513)Jeffrey Walton2017-09-221-0/+14
|
* Add Power8 SHA256 and SHA512 support (GH #513)Jeffrey Walton2017-09-221-0/+19
|
* Fix func/subfunc parameter names (GH #502)Jeffrey Walton2017-09-161-2/+2
|
* Fix bad SHA152 hash under IBM XL C/C++ compiler (GH #502)Jeffrey Walton2017-09-151-13/+79
|
* Clear uninitialized variable warnings under xlCJeffrey Walton2017-09-011-3/+2
|
* Fix build on FreeBSD 10.3 x86 with clang++ 3.4.1. (#483)Wyatt O'Day2017-08-301-1/+2
| | | | | | * Fix build on FreeBSD 10.3 x86 with clang++ v. 3.4.1. The x64 build (also clang++ 3.4.1) doesn't require CRYPTOPP_DISABLE_SHA_ASM. It seems to be a bug specific to the x86 version of clang++. * Based on suggestion from @noloader, don't split x86/x64 clang++ version detection. Just wait until clang++ is consistently working in both x86/x64.
* Remove BOOL macro value (GH #462)Jeffrey Walton2017-08-201-12/+18
| | | | Currently the CRYPTOPP_BOOL_XXX macros set the macro value to 0 or 1. If we remove setting the 0 value (the #else part of the expression), then the self tests speed up by about 0.3 seconds. I can't explain it, but I have observed it repeatedly. This check-in prepares for the removal in Upstream master
* Split source files to support Base Implementation + SIMD implementation (GH ↵Jeffrey Walton2017-08-171-874/+59
| | | | | #461) Split source files to support Base Implementation + SIMD implementation