summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bf/bf_local.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bf/bf_local.h')
-rw-r--r--src/lib/libcrypto/bf/bf_local.h25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/lib/libcrypto/bf/bf_local.h b/src/lib/libcrypto/bf/bf_local.h
index f463dda360..8fc5a5dbd8 100644
--- a/src/lib/libcrypto/bf/bf_local.h
+++ b/src/lib/libcrypto/bf/bf_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: bf_local.h,v 1.2 2024/03/27 11:44:39 jsing Exp $ */ 1/* $OpenBSD: bf_local.h,v 1.3 2024/03/27 11:54:29 jsing Exp $ */
2/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -56,7 +56,7 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#include <openssl/opensslconf.h> /* BF_PTR, BF_PTR2 */ 59#include <openssl/opensslconf.h> /* BF_PTR */
60 60
61#ifndef HEADER_BF_LOCL_H 61#ifndef HEADER_BF_LOCL_H
62#define HEADER_BF_LOCL_H 62#define HEADER_BF_LOCL_H
@@ -107,26 +107,7 @@
107/* This is actually a big endian algorithm, the most significant byte 107/* This is actually a big endian algorithm, the most significant byte
108 * is used to lookup array 0 */ 108 * is used to lookup array 0 */
109 109
110#if defined(BF_PTR2) 110#if defined(BF_PTR)
111
112/*
113 * This is basically a special Intel version. Point is that Intel
114 * doesn't have many registers, but offers a reach choice of addressing
115 * modes. So we spare some registers by directly traversing BF_KEY
116 * structure and hiring the most decorated addressing mode. The code
117 * generated by EGCS is *perfectly* competitive with assembler
118 * implementation!
119 */
120#define BF_ENC(LL,R,KEY,Pi) (\
121 LL^=KEY[Pi], \
122 t= KEY[BF_ROUNDS+2 + 0 + ((R>>24)&0xFF)], \
123 t+= KEY[BF_ROUNDS+2 + 256 + ((R>>16)&0xFF)], \
124 t^= KEY[BF_ROUNDS+2 + 512 + ((R>>8 )&0xFF)], \
125 t+= KEY[BF_ROUNDS+2 + 768 + ((R )&0xFF)], \
126 LL^=t \
127 )
128
129#elif defined(BF_PTR)
130 111
131#ifndef BF_LONG_LOG2 112#ifndef BF_LONG_LOG2
132#define BF_LONG_LOG2 2 /* default to BF_LONG being 32 bits */ 113#define BF_LONG_LOG2 2 /* default to BF_LONG being 32 bits */