summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/md5/md5.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Provide a readable assembly implementation for MD5 on amd64.jsing2025-01-241-3/+2
| | | | | | | | | | 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-191-9/+3
| | | | | | | | | | | | | | | | 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)
* Remove support for static buffers in HMAC/digeststb2024-06-011-4/+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
* 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@
* 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-281-0/+303
|
* 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
* 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@
* merge 0.9.7b with local changes; crank majors for libssl/libcryptomarkus2003-05-121-1/+1
|
* OpenSSL 0.9.4 mergebeck1999-09-291-13/+5
|
* Import of SSLeay-0.9.0b with RSA and IDEA stubbed + OpenBSD buildryker1998-10-051-0/+135
functionality for shared libs. Note that routines such as sslv2_init and friends that use RSA will not work due to lack of RSA in this library. Needs documentation and help from ports for easy upgrade to full functionality where legally possible.