summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/sha/sha256.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Replace Makefile based SHA*_ASM defines with HAVE_SHA_* defines.jsing2025-02-141-7/+14
| | | | | | | | | | | | | | | | Currently, SHA{1,256,512}_ASM defines are used to remove the C implementation of sha{1,256,512}_block_data_order() when it is provided by assembly. However, this prevents the C implementation from being used as a fallback. Rename the C sha*_block_data_order() to sha*_block_generic() and provide a sha*_block_data_order() that calls sha*_block_generic(). Replace the Makefile based SHA*_ASM defines with two HAVE_SHA_* defines that allow these functions to be compiled in or removed, such that machine specific verisons can be provided. This should effectively be a no-op on any platform that defined SHA{1,256,512}_ASM. ok tb@
* Remove support for static buffers in HMAC/digeststb2024-06-011-9/+1
| | | | | | | | | | | | | | | | | | HMAC() and the one-step digests used to support passing a NULL buffer and would return the digest in a static buffer. This design is firmly from the nineties, not thread safe and it saves callers a single line. The few ports that used to rely this were fixed with patches sent to non-hostile (and non-dead) upstreams. It's early enough in the release cycle that remaining uses hidden from the compiler should be caught, at least the ones that matter. There won't be that many since BoringSSL removed this feature in 2017. https://boringssl-review.googlesource.com/14528 Add non-null attributes to the headers and add a few missing bounded attributes. ok beck jsing
* Fix line wrapping.jsing2024-03-281-6/+4
|
* Stop including md32_common.h.jsing2023-08-111-15/+1
| | | | | Now that we're no longer dependent on md32_common.h, stop including it. Remove various defines that only existed for md32_common.h usage.
* Demacro sha256.jsing2023-08-111-49/+114
| | | | | | | | | | | | | | Replace macros with static inline functions, as well as writing out the variable rotations instead of trying to outsmart the compiler. Also pull the message schedule update up and complete it prior to commencement of the round. Also use rotate right, rather than transposed rotate left. Overall this is more readable and more closely follows the specification. On some platforms (e.g. aarch64) there is no noteable change in performance, while on others there is a significant improvement (more than 25% on arm). ok miod@ tb@
* Remove MD32_REG_T.jsing2023-08-101-2/+2
| | | | | | | | | This is a hack that is only enabled on a handful of 64 bit platforms, as a workaround for poor compiler optimisation. If you're running an archiac compiler on an archiac architecture, then you can deal with slightly lower performance. ok tb@
* Hide symbols in shabeck2023-07-081-1/+10
| | | | ok tb@
* Clean up alignment handling for SHA-256.jsing2023-07-071-63/+43
| | | | | | | If input data is 32 bit aligned use be32toh() directly, otherwise use crypto_load_be32toh(), cleaning up all of the HOST_c2l() usage. ok beck@
* Clean up SHA-256 input handling and round macros.jsing2023-07-071-72/+58
| | | | | | | Avoid reach around and initialisation outside of the macro, cleaning up the call sites to remove the initialisation. ok beck@
* Remove unused SHA-256 implementation.jsing2023-07-071-71/+1
| | | | ok beck@
* Replace HOST_l2c() with htob32() or crypto_store_htobe32().jsing2023-07-071-17/+15
| | | | ok beck@
* Sprinkle some style(9).jsing2023-05-281-15/+15
|
* Expand occurrences of HASH_CTX that were previously missed.jsing2023-05-281-4/+5
| | | | No change in generated assembly.
* Reorder functions.jsing2023-05-281-214/+214
| | | | No intended functional change.
* Clean up includes.jsing2023-05-281-6/+5
|
* Remove now unnecessary do {} while(0);jsing2023-05-281-3/+1
|
* Inline HASH_MAKE_STRING for SHA256.jsing2023-05-281-34/+37
| | | | No change to generated assembly.
* Implement SHA256_{Update,Transform,Final}() directly in sha256.c.jsing2023-05-271-4/+103
| | | | | | | | | | m32_common.h is a typical OpenSSL macro horror show - copy the update, transform and final functions from md32_common.h, manually expanding the macros for SHA256. This will allow for further clean up to occur. No change in generated assembly. ok beck@ tb@
* More whitespace fixes.jsing2023-03-291-51/+51
| | | | | | Another set of mechnical replacements for "a,b" with "a, b". No change in generated assembly.
* Add license to sha256.c/sha512.c.jsing2023-03-261-3/+50
|
* Add some blank lines for readability, along with some more style(9) tweaks.jsing2023-03-261-4/+15
|
* Whack sha with a style(9) stick.jsing2023-03-261-156/+260
| | | | No change in generated assembly.
* Switch to <endian.h> from <machine/endian.h> for better portability.bcook2021-11-091-3/+2
| | | | ok tb@
* lenght -> lengthjsg2019-01-211-2/+2
|
* Correct spelling of OPENSSL_cleanse.jsing2015-09-101-3/+3
| | | | ok miod@
* remove return value from HOST_c2l/l2c macrosbcook2014-08-181-4/+4
| | | | | | | | | | | These macros and asm inlines simulate a function returning a value, but nothing ever uses this return value. Remove the pseudo-returns and (void) casts discarding the unused values. This, maybe unsurprisingly, speeds things up a bit. It also removes the GCC 4.9 warnings about unused values. ok miod@ deraadt@
* Explicitly include <openssl/opensslconf.h> in every file that referencesjsing2014-07-101-2/+5
| | | | | | | | | an OPENSSL_NO_* define. This avoids relying on something else pulling it in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is never going to do anything, since OPENSSL_NO_XYZ will never defined, due to the fact that opensslconf.h has not been included. This also includes some miscellaneous sorting/tidying of headers.
* Remove leading underscore from _BYTE_ORDER and _{LITTLE,BIG}_ENDIAN, to bemiod2014-07-091-2/+2
| | | | | more friendly to systems where the underscore flavours may be defined as empty. Found the hard way be bcook@; joint brainstrom with bcook beck and guenther
* remove unused, private version strings except SSL_version_strbcook2014-07-091-3/+1
| | | | | | Also remove unused des_ver.h, which exports some of these strings, but is not installed. ok miod@ tedu@
* tags as requested by miod and teduderaadt2014-06-121-1/+1
|
* Remove fips_md_init() macro indirection for digest algorithms, used by themiod2014-05-011-2/+2
| | | | | | | OpenSSL FIPS module to prevent forbidden digests to be allowed. No functional change but readability. ok deraadt@
* Figure out endianness at compile-time, using _BYTE_ORDER frommiod2014-04-231-2/+3
| | | | | | | <machine/endian.h>, rather than writing 1 to a 32-bit variable and checking whether the first byte is nonzero. tweaks and ok matthew@; ok beck@ tedu@
* Import OpenSSL 1.0.1gmiod2014-04-131-3/+3
|
* import OpenSSL-1.0.1cdjm2012-10-131-2/+2
|
* import OpenSSL-1.0.0adjm2010-10-011-21/+11
|
* import openssl-0.9.8jdjm2009-01-091-0/+10
|
* import of OpenSSL 0.9.8hdjm2008-09-061-0/+282