summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/md5 (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove #error if OPENSSL_NO_FOO is definedtb2025-01-251-5/+1
| | | | discussed with jsing
* Remove now unused perlasm script for MD5 on amd64.jsing2025-01-241-265/+0
|
* Provide a readable assembly implementation for MD5 on amd64.jsing2025-01-244-8/+244
| | | | | | | | | | This appears to be about 5% faster than the current perlasm version on a modern Intel CPU. While here rename md5_block_asm_data_order to md5_block_data_order, for consistency with other hashes. ok tb@
* Improve bit counter handling in MD5.jsing2025-01-192-18/+7
| | | | | | | | | | | | | | | | Like most hashes, MD5 needs to keep count of the number of bits in the message being processed. However, rather than using a 64 bit counter this is implemented using two 32 bit values (which is exposed in the public API). Even with this hurdle, we can still use 64 bit math and let the compiler figure out how to best handle the situation (hopefully avoiding compiler warnings on 16 bit platforms in the process!). On amd64 this code now requires two instructions, instead of the previous five. While here remove a comment that is excessively visible and no longer completely accurate (and if you're going to redefine types like MD5_WORD you kinda need to know what you're doing). ok tb@ (who's going to miss the dear diary style comments)
* Reverse order of attributestb2024-06-011-3/+3
| | | | requested by jsing on review
* Remove support for static buffers in HMAC/digeststb2024-06-012-5/+3
| | | | | | | | | | | | | | | | | | 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
* Load in the top of the loop, as we do for other hash implementations.jsing2024-03-281-10/+10
|
* Stop including md32_common.h in md5.c and remove unused defines.jsing2024-03-261-17/+1
| | | | | | This is now no longer needed. ok tb@
* Include stdint.h for uintptr_t.jsing2024-03-261-1/+2
|
* Demacro MD5 and improve data loading.jsing2024-03-261-116/+154
| | | | | | | Use static inline functions instead of macros and improve handling of aligned data. Also number rounds as per RFC 1321. ok tb@
* Replace uses of endbr64 with _CET_ENDBR from cet.htb2024-02-241-1/+1
| | | | | | | | | cet.h is needed for other platforms to emit the relevant .gnu.properties sections that are necessary for them to enable IBT. It also avoids issues with older toolchains on macOS that explode on encountering endbr64. based on a diff by kettenis ok beck kettenis
* Clean up alignment handling.jsing2023-08-151-56/+35
| | | | | | | | Instead of using HOST_{c2l,l2c} macros, provide and use crypto_load_le32toh() and crypto_store_htole32(). In some cases just use htole32() directly. ok tb@
* Use MD5_LONG instead of unsigned int for consistency.jsing2023-08-151-3/+3
| | | | ok tb@
* Condition only on #ifdef MD5_ASM.jsing2023-08-151-15/+5
| | | | | | | There are a bunch of unnecessary preprocessor directives - just condition on MD5_ASM, the same as we do elsewhere. ok tb@
* Inline INIT_DATA_* defines.jsing2023-08-141-10/+7
| | | | ok tb@
* style(9)jsing2023-08-141-6/+6
|
* Remove now unnecessary 'do {} while (0);' and move variable declaration.jsing2023-08-101-5/+2
| | | | No functional change.
* Expand HASH_MAKE_STRING.jsing2023-08-101-13/+13
| | | | No change to generated assembly.
* Remove MD32_XARRAY remnants.jsing2023-08-101-4/+1
|
* Reorder functions.jsing2023-08-101-119/+119
| | | | No functional change.
* Implement MD5_{Update,Transform,Final}() directly in md5.c.jsing2023-08-101-1/+103
| | | | | | | | Copy the update, transform and final functions from md32_common.h, manually expanding the macros for MD5. This will allow for further clean up to occur. No change in generated assembly.
* Tidy includes.jsing2023-08-101-4/+1
|
* Remove MD32_REG_T.jsing2023-08-101-3/+3
| | | | | | | | | 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@
* Combine md5 into a single C file.jsing2023-07-282-80/+18
|
* Mop up MD32_XARRAY from md5.jsing2023-07-151-91/+84
| | | | | | | MD32_XARRAY was added as a workaround for a broken HP C compiler (circa 1999). Clean it up to simplify the code. No change in generated assembly.
* Hide symbols in md4 and md5beck2023-07-082-3/+7
| | | | ok tb@
* Hit md5 with the style(9) stick.jsing2023-07-083-130/+163
|
* Inline md5_local.h in md5_dgst.c.jsing2023-07-082-134/+76
| | | | | | | | md5_local.h is not really a local header, just another layer of indirection that cannot be included by anything other than md5_dgst.c. As such, include it directly instead. No change in generated assembly.
* Add endbr64 where needed by inspection. Passes regresson tests.deraadt2023-04-251-0/+1
| | | | ok jsing, and kind of tb an earlier version
* Make internal header file names consistenttb2022-11-262-3/+3
| | | | | | | | | | | | | | | | Libcrypto currently has a mess of *_lcl.h, *_locl.h, and *_local.h names used for internal headers. Move all these headers we inherited from OpenSSL to *_local.h, reserving the name *_internal.h for our own code. Similarly, move dtls_locl.h and ssl_locl.h to dtls_local and ssl_local.h. constant_time_locl.h is moved to constant_time.h since it's special. Adjust all .c files in libcrypto, libssl and regress. The diff is mechanical with the exception of tls13_quic.c, where #include <ssl_locl.h> was fixed manually. discussed with jsing, no objection bcook
* Explicitly export a list of symbols from libcrypto.jsing2016-12-211-1/+5
| | | | | | | | | | | | | | | | Move the "internal" BN functions from bn.h to bn_lcl.h and stop exporting the bn_* symbols. These are documented as only being intended for internal use, so why they were placed in a public header is beyond me... This hides 363 previously exported symbols, most of which exist in headers that are not installed and were never intended to be public. This also removes a few crusty old things that should have died long ago (like _ossl_old_des_read_pw). But don't worry... there are still 3451 symbols exported from the library. With input and testing from inoguchi@. ok beck@ inoguchi@
* Less IA64.jsing2016-09-041-992/+0
| | | | ok deraadt@
* Correct spelling of OPENSSL_cleanse.jsing2015-09-101-2/+2
| | | | ok miod@
* Remove pointless comments.jsing2015-09-101-2/+2
| | | | ok "captain obvious"
* deregister; no binary changejsg2014-10-281-2/+2
| | | | ok jsing@ miod@
* digests: *_LONG_LOG2 is not used, stop talking about it.bcook2014-10-202-8/+3
| | | | | | | | Modified patch from Dmitry Eremin-Solenikov leave the sole public define in ripemd.h ok deraadt@ miod@
* remove return value from HOST_c2l/l2c macrosbcook2014-08-181-5/+5
| | | | | | | | | | | 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@
* unbreak build this needed to be an and..beck2014-07-131-2/+2
| | | | ok jsing@
* Take out __bounded__ in the include files we use it in when not on OpenBSD.beck2014-07-131-1/+4
| | | | | | | while we can take it out in portable at compile time, it is still a problem when we install this header file on a system that doesn't support __bounded__ if this is unguarded. ok miod@ bcook@
* Explicitly include <openssl/opensslconf.h> in every file that referencesjsing2014-07-101-3/+3
| | | | | | | | | 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 bogus preprocessor statements trying to pick the largest integermiod2014-07-101-8/+1
| | | | | | | | type for BF_LONG, MD[45]_LONG and SHA_LONG. First, the preprocessor symbols they check for a 64-bit system is __ILP64__ which no sane system provides; second, on the platforms which have assembler code to speed things up, the assembler code assumes a 32-bit type will be used.
* 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@
* Add more bounded attributes to the buffer and md5/sha headers in libsslavsm2014-06-141-3/+5
| | | | ok miod@
* tags as requested by miod and teduderaadt2014-06-124-4/+4
|
* Remove various test stubs. The good ones have been moved by jsingderaadt2014-06-071-125/+0
| | | | | | and others to the regress framework. These remaining ones just muddle us up when re-reading code repeatedly. ok jsing
* Almost nothing actually needs to include <openssl/e_os2.h>, however byjsing2014-05-242-2/+5
| | | | | | | including it they get <openssl/opensslconf.h>. So instead of pulling in <openssl/e_os2.h>, just pull in <openssl/opensslconf.h>. "go ahead" miod@
* Remove fips_md_init() macro indirection for digest algorithms, used by themiod2014-05-011-1/+1
| | | | | | | OpenSSL FIPS module to prevent forbidden digests to be allowed. No functional change but readability. ok deraadt@
* First pass at removing win64 support from the assembly generating Perljsing2014-04-301-106/+0
| | | | | | | scripts. We certainly do not need an identical copy of the win64 exception handler in each script (surely one copy would be sufficient). ok miod@
* Unsurprisingly, since <unistd.h> was so darn hard to find for OpenSSL developersbeck2014-04-181-3/+1
| | | | | | | | they had resorted to manually protyping read(2) instead of incredible amount of preprocessor wizardry needed to find the ever illusive <unistd.h>. Let's just include <unistd.h> and we don't need to do this.. While we're at it flense out _OSD_POSIX and __DGJPP__ cruft. ok krw@
* Remove _CRAY references. Note that this pleads for the use of <stdint.h>miod2014-04-161-8/+1
| | | | | fixed-width types instead of choosing int or long depending upon what we think the architecture support.