History log of /openbsd-current/lib/libcrypto/md5/md5.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.23 01-Jun-2024 tb

Remove support for static buffers in HMAC/digests

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


# 1.22 28-Mar-2024 jsing

Load in the top of the loop, as we do for other hash implementations.


# 1.21 26-Mar-2024 jsing

Stop including md32_common.h in md5.c and remove unused defines.

This is now no longer needed.

ok tb@


# 1.20 26-Mar-2024 jsing

Include stdint.h for uintptr_t.


# 1.19 26-Mar-2024 jsing

Demacro MD5 and improve data loading.

Use static inline functions instead of macros and improve handling of
aligned data. Also number rounds as per RFC 1321.

ok tb@


Revision tags: OPENBSD_7_4_BASE OPENBSD_7_5_BASE
# 1.18 15-Aug-2023 jsing

Clean up alignment handling.

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@


# 1.17 15-Aug-2023 jsing

Use MD5_LONG instead of unsigned int for consistency.

ok tb@


# 1.16 15-Aug-2023 jsing

Condition only on #ifdef MD5_ASM.

There are a bunch of unnecessary preprocessor directives - just condition
on MD5_ASM, the same as we do elsewhere.

ok tb@


# 1.15 14-Aug-2023 jsing

Inline INIT_DATA_* defines.

ok tb@


# 1.14 14-Aug-2023 jsing

style(9)


# 1.13 10-Aug-2023 jsing

Remove now unnecessary 'do {} while (0);' and move variable declaration.

No functional change.


# 1.12 10-Aug-2023 jsing

Expand HASH_MAKE_STRING.

No change to generated assembly.


# 1.11 10-Aug-2023 jsing

Remove MD32_XARRAY remnants.


# 1.10 10-Aug-2023 jsing

Reorder functions.

No functional change.


# 1.9 10-Aug-2023 jsing

Implement MD5_{Update,Transform,Final}() directly in md5.c.

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.


# 1.8 10-Aug-2023 jsing

Tidy includes.


# 1.7 10-Aug-2023 jsing

Remove MD32_REG_T.

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@


# 1.6 28-Jul-2023 jsing

Combine md5 into a single C file.


# 1.5 07-Jun-2014 deraadt

Remove various test stubs. The good ones have been moved by jsing
and others to the regress framework. These remaining ones just
muddle us up when re-reading code repeatedly.
ok jsing


# 1.4 18-Apr-2014 beck

Unsurprisingly, since <unistd.h> was so darn hard to find for OpenSSL developers
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@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE butholakala pre_openssl_0_9_8h
# 1.3 12-May-2003 markus

merge 0.9.7b with local changes; crank majors for libssl/libcrypto


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.2 29-Sep-1999 beck

OpenSSL 0.9.4 merge


# 1.1 05-Oct-1998 ryker

branches: 1.1.1;
Initial revision


# 1.22 28-Mar-2024 jsing

Load in the top of the loop, as we do for other hash implementations.


# 1.21 26-Mar-2024 jsing

Stop including md32_common.h in md5.c and remove unused defines.

This is now no longer needed.

ok tb@


# 1.20 26-Mar-2024 jsing

Include stdint.h for uintptr_t.


# 1.19 26-Mar-2024 jsing

Demacro MD5 and improve data loading.

Use static inline functions instead of macros and improve handling of
aligned data. Also number rounds as per RFC 1321.

ok tb@


Revision tags: OPENBSD_7_4_BASE OPENBSD_7_5_BASE
# 1.18 15-Aug-2023 jsing

Clean up alignment handling.

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@


# 1.17 15-Aug-2023 jsing

Use MD5_LONG instead of unsigned int for consistency.

ok tb@


# 1.16 15-Aug-2023 jsing

Condition only on #ifdef MD5_ASM.

There are a bunch of unnecessary preprocessor directives - just condition
on MD5_ASM, the same as we do elsewhere.

ok tb@


# 1.15 14-Aug-2023 jsing

Inline INIT_DATA_* defines.

ok tb@


# 1.14 14-Aug-2023 jsing

style(9)


# 1.13 10-Aug-2023 jsing

Remove now unnecessary 'do {} while (0);' and move variable declaration.

No functional change.


# 1.12 10-Aug-2023 jsing

Expand HASH_MAKE_STRING.

No change to generated assembly.


# 1.11 10-Aug-2023 jsing

Remove MD32_XARRAY remnants.


# 1.10 10-Aug-2023 jsing

Reorder functions.

No functional change.


# 1.9 10-Aug-2023 jsing

Implement MD5_{Update,Transform,Final}() directly in md5.c.

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.


# 1.8 10-Aug-2023 jsing

Tidy includes.


# 1.7 10-Aug-2023 jsing

Remove MD32_REG_T.

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@


# 1.6 28-Jul-2023 jsing

Combine md5 into a single C file.


# 1.5 07-Jun-2014 deraadt

Remove various test stubs. The good ones have been moved by jsing
and others to the regress framework. These remaining ones just
muddle us up when re-reading code repeatedly.
ok jsing


# 1.4 18-Apr-2014 beck

Unsurprisingly, since <unistd.h> was so darn hard to find for OpenSSL developers
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@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE butholakala pre_openssl_0_9_8h
# 1.3 12-May-2003 markus

merge 0.9.7b with local changes; crank majors for libssl/libcrypto


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.2 29-Sep-1999 beck

OpenSSL 0.9.4 merge


# 1.1 05-Oct-1998 ryker

branches: 1.1.1;
Initial revision


# 1.21 26-Mar-2024 jsing

Stop including md32_common.h in md5.c and remove unused defines.

This is now no longer needed.

ok tb@


# 1.20 26-Mar-2024 jsing

Include stdint.h for uintptr_t.


# 1.19 26-Mar-2024 jsing

Demacro MD5 and improve data loading.

Use static inline functions instead of macros and improve handling of
aligned data. Also number rounds as per RFC 1321.

ok tb@


Revision tags: OPENBSD_7_4_BASE OPENBSD_7_5_BASE
# 1.18 15-Aug-2023 jsing

Clean up alignment handling.

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@


# 1.17 15-Aug-2023 jsing

Use MD5_LONG instead of unsigned int for consistency.

ok tb@


# 1.16 15-Aug-2023 jsing

Condition only on #ifdef MD5_ASM.

There are a bunch of unnecessary preprocessor directives - just condition
on MD5_ASM, the same as we do elsewhere.

ok tb@


# 1.15 14-Aug-2023 jsing

Inline INIT_DATA_* defines.

ok tb@


# 1.14 14-Aug-2023 jsing

style(9)


# 1.13 10-Aug-2023 jsing

Remove now unnecessary 'do {} while (0);' and move variable declaration.

No functional change.


# 1.12 10-Aug-2023 jsing

Expand HASH_MAKE_STRING.

No change to generated assembly.


# 1.11 10-Aug-2023 jsing

Remove MD32_XARRAY remnants.


# 1.10 10-Aug-2023 jsing

Reorder functions.

No functional change.


# 1.9 10-Aug-2023 jsing

Implement MD5_{Update,Transform,Final}() directly in md5.c.

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.


# 1.8 10-Aug-2023 jsing

Tidy includes.


# 1.7 10-Aug-2023 jsing

Remove MD32_REG_T.

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@


# 1.6 28-Jul-2023 jsing

Combine md5 into a single C file.


# 1.5 07-Jun-2014 deraadt

Remove various test stubs. The good ones have been moved by jsing
and others to the regress framework. These remaining ones just
muddle us up when re-reading code repeatedly.
ok jsing


# 1.4 18-Apr-2014 beck

Unsurprisingly, since <unistd.h> was so darn hard to find for OpenSSL developers
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@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE butholakala pre_openssl_0_9_8h
# 1.3 12-May-2003 markus

merge 0.9.7b with local changes; crank majors for libssl/libcrypto


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.2 29-Sep-1999 beck

OpenSSL 0.9.4 merge


# 1.1 05-Oct-1998 ryker

branches: 1.1.1;
Initial revision


# 1.18 15-Aug-2023 jsing

Clean up alignment handling.

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@


# 1.17 15-Aug-2023 jsing

Use MD5_LONG instead of unsigned int for consistency.

ok tb@


# 1.16 15-Aug-2023 jsing

Condition only on #ifdef MD5_ASM.

There are a bunch of unnecessary preprocessor directives - just condition
on MD5_ASM, the same as we do elsewhere.

ok tb@


# 1.15 14-Aug-2023 jsing

Inline INIT_DATA_* defines.

ok tb@


# 1.14 14-Aug-2023 jsing

style(9)


# 1.13 10-Aug-2023 jsing

Remove now unnecessary 'do {} while (0);' and move variable declaration.

No functional change.


# 1.12 10-Aug-2023 jsing

Expand HASH_MAKE_STRING.

No change to generated assembly.


# 1.11 10-Aug-2023 jsing

Remove MD32_XARRAY remnants.


# 1.10 10-Aug-2023 jsing

Reorder functions.

No functional change.


# 1.9 10-Aug-2023 jsing

Implement MD5_{Update,Transform,Final}() directly in md5.c.

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.


# 1.8 10-Aug-2023 jsing

Tidy includes.


# 1.7 10-Aug-2023 jsing

Remove MD32_REG_T.

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@


# 1.6 28-Jul-2023 jsing

Combine md5 into a single C file.


# 1.5 07-Jun-2014 deraadt

Remove various test stubs. The good ones have been moved by jsing
and others to the regress framework. These remaining ones just
muddle us up when re-reading code repeatedly.
ok jsing


# 1.4 18-Apr-2014 beck

Unsurprisingly, since <unistd.h> was so darn hard to find for OpenSSL developers
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@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE butholakala pre_openssl_0_9_8h
# 1.3 12-May-2003 markus

merge 0.9.7b with local changes; crank majors for libssl/libcrypto


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.2 29-Sep-1999 beck

OpenSSL 0.9.4 merge


# 1.1 05-Oct-1998 ryker

branches: 1.1.1;
Initial revision


# 1.13 10-Aug-2023 jsing

Remove now unnecessary 'do {} while (0);' and move variable declaration.

No functional change.


# 1.12 10-Aug-2023 jsing

Expand HASH_MAKE_STRING.

No change to generated assembly.


# 1.11 10-Aug-2023 jsing

Remove MD32_XARRAY remnants.


# 1.10 10-Aug-2023 jsing

Reorder functions.

No functional change.


# 1.9 10-Aug-2023 jsing

Implement MD5_{Update,Transform,Final}() directly in md5.c.

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.


# 1.8 10-Aug-2023 jsing

Tidy includes.


# 1.7 10-Aug-2023 jsing

Remove MD32_REG_T.

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@


# 1.6 28-Jul-2023 jsing

Combine md5 into a single C file.


# 1.5 07-Jun-2014 deraadt

Remove various test stubs. The good ones have been moved by jsing
and others to the regress framework. These remaining ones just
muddle us up when re-reading code repeatedly.
ok jsing


# 1.4 18-Apr-2014 beck

Unsurprisingly, since <unistd.h> was so darn hard to find for OpenSSL developers
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@


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE OPENBSD_5_5_BASE butholakala pre_openssl_0_9_8h
# 1.3 12-May-2003 markus

merge 0.9.7b with local changes; crank majors for libssl/libcrypto


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE
# 1.2 29-Sep-1999 beck

OpenSSL 0.9.4 merge


# 1.1 05-Oct-1998 ryker

branches: 1.1.1;
Initial revision