From 417eb2ee99ee039b1f6aaaee5f1407ca5e4f94cf Mon Sep 17 00:00:00 2001 From: tb <> Date: Wed, 11 Jun 2025 04:08:16 +0000 Subject: Remove BF_PTR In bf_local.h r1.2, openssl/opensslconf.h was pulled out of the HEADER_BF_LOCL_H header guard, so BF_PTR was never defined from opensslfeatures.h. Thus, alpha, mips64, sparc64 haven't used the path that is supposedly optimized for them. On the M3k the speed gain of bf-cbc with BF_PTR is roughly 5%, so not really great. This is blowfish, so I don't think we want to carry complications for alpha and mips64 only. ok jsing kenjiro --- src/lib/libcrypto/bf/bf_local.h | 47 +++-------------------------------------- 1 file changed, 3 insertions(+), 44 deletions(-) (limited to 'src/lib/libcrypto/bf') diff --git a/src/lib/libcrypto/bf/bf_local.h b/src/lib/libcrypto/bf/bf_local.h index 8fc5a5dbd8..2fe65eb85c 100644 --- a/src/lib/libcrypto/bf/bf_local.h +++ b/src/lib/libcrypto/bf/bf_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bf_local.h,v 1.3 2024/03/27 11:54:29 jsing Exp $ */ +/* $OpenBSD: bf_local.h,v 1.4 2025/06/11 04:08:16 tb Exp $ */ /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -56,11 +56,11 @@ * [including the GNU Public Licence.] */ -#include /* BF_PTR */ - #ifndef HEADER_BF_LOCL_H #define HEADER_BF_LOCL_H +#include + /* NOTE - c is not incremented as per n2l */ #define n2ln(c,l1,l2,n) { \ c+=n; \ @@ -104,46 +104,6 @@ *((c)++)=(unsigned char)(((l)>> 8L)&0xff), \ *((c)++)=(unsigned char)(((l) )&0xff)) -/* This is actually a big endian algorithm, the most significant byte - * is used to lookup array 0 */ - -#if defined(BF_PTR) - -#ifndef BF_LONG_LOG2 -#define BF_LONG_LOG2 2 /* default to BF_LONG being 32 bits */ -#endif -#define BF_M (0xFF<>BF_i)&BF_M gets folded into a single instruction, namely - * rlwinm. So let'em double-check if their compiler does it. - */ - -#define BF_ENC(LL,R,S,P) ( \ - LL^=P, \ - LL^= (((*(BF_LONG *)((unsigned char *)&(S[ 0])+((R>>BF_0)&BF_M))+ \ - *(BF_LONG *)((unsigned char *)&(S[256])+((R>>BF_1)&BF_M)))^ \ - *(BF_LONG *)((unsigned char *)&(S[512])+((R>>BF_2)&BF_M)))+ \ - *(BF_LONG *)((unsigned char *)&(S[768])+((R<>24)&0xff)] + \ @@ -151,6 +111,5 @@ S[0x0200+((int)(R>> 8)&0xff)])+ \ S[0x0300+((int)(R )&0xff)])&0xffffffffL \ ) -#endif #endif -- cgit v1.2.3-55-g6feb