summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/md32_common.h
diff options
context:
space:
mode:
authorjsing <>2023-08-10 07:15:23 +0000
committerjsing <>2023-08-10 07:15:23 +0000
commit5ccf52b751e2b7dd5a5c0593f12b501074180fff (patch)
tree9ca48e5b24acc855af178267c3089d8f870623b0 /src/lib/libcrypto/md32_common.h
parent0c67b8136f2ccb712ba6ab0d74f8dac9b61c59e8 (diff)
downloadopenbsd-5ccf52b751e2b7dd5a5c0593f12b501074180fff.tar.gz
openbsd-5ccf52b751e2b7dd5a5c0593f12b501074180fff.tar.bz2
openbsd-5ccf52b751e2b7dd5a5c0593f12b501074180fff.zip
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@
Diffstat (limited to 'src/lib/libcrypto/md32_common.h')
-rw-r--r--src/lib/libcrypto/md32_common.h34
1 files changed, 1 insertions, 33 deletions
diff --git a/src/lib/libcrypto/md32_common.h b/src/lib/libcrypto/md32_common.h
index ccd6db53fb..f61c49f03c 100644
--- a/src/lib/libcrypto/md32_common.h
+++ b/src/lib/libcrypto/md32_common.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: md32_common.h,v 1.25 2023/05/27 18:33:34 jsing Exp $ */ 1/* $OpenBSD: md32_common.h,v 1.26 2023/08/10 07:15:23 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -307,35 +307,3 @@ int HASH_FINAL (unsigned char *md, HASH_CTX *c)
307 return 1; 307 return 1;
308} 308}
309#endif 309#endif
310
311#ifndef MD32_REG_T
312#if defined(__alpha) || defined(__sparcv9) || defined(__mips)
313#define MD32_REG_T long
314/*
315 * This comment was originally written for MD5, which is why it
316 * discusses A-D. But it basically applies to all 32-bit digests,
317 * which is why it was moved to common header file.
318 *
319 * In case you wonder why A-D are declared as long and not
320 * as MD5_LONG. Doing so results in slight performance
321 * boost on LP64 architectures. The catch is we don't
322 * really care if 32 MSBs of a 64-bit register get polluted
323 * with eventual overflows as we *save* only 32 LSBs in
324 * *either* case. Now declaring 'em long excuses the compiler
325 * from keeping 32 MSBs zeroed resulting in 13% performance
326 * improvement under SPARC Solaris7/64 and 5% under AlphaLinux.
327 * Well, to be honest it should say that this *prevents*
328 * performance degradation.
329 * <appro@fy.chalmers.se>
330 */
331#else
332/*
333 * Above is not absolute and there are LP64 compilers that
334 * generate better code if MD32_REG_T is defined int. The above
335 * pre-processor condition reflects the circumstances under which
336 * the conclusion was made and is subject to further extension.
337 * <appro@fy.chalmers.se>
338 */
339#define MD32_REG_T int
340#endif
341#endif