summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/des/des_locl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/des/des_locl.h')
-rw-r--r--src/lib/libcrypto/des/des_locl.h21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/lib/libcrypto/des/des_locl.h b/src/lib/libcrypto/des/des_locl.h
index 477aeb60d9..9480d37489 100644
--- a/src/lib/libcrypto/des/des_locl.h
+++ b/src/lib/libcrypto/des/des_locl.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: des_locl.h,v 1.16 2014/07/10 22:45:56 jsing Exp $ */ 1/* $OpenBSD: des_locl.h,v 1.17 2014/08/18 19:15:34 bcook 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 *
@@ -60,6 +60,7 @@
60#define HEADER_DES_LOCL_H 60#define HEADER_DES_LOCL_H
61 61
62#include <math.h> 62#include <math.h>
63#include <stdint.h>
63#include <stdio.h> 64#include <stdio.h>
64#include <stdlib.h> 65#include <stdlib.h>
65#include <string.h> 66#include <string.h>
@@ -131,20 +132,10 @@
131 } \ 132 } \
132 } 133 }
133 134
134#if defined(__GNUC__) && __GNUC__>=2 && !defined(__STRICT_ANSI__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) 135static inline uint32_t ROTATE(uint32_t a, uint32_t n)
135# if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) 136{
136# define ROTATE(a,n) ({ register unsigned int ret; \ 137 return (a>>n)+(a<<(32-n));
137 asm ("rorl %1,%0" \ 138}
138 : "=r"(ret) \
139 : "I"(n),"0"(a) \
140 : "cc"); \
141 ret; \
142 })
143# endif
144#endif
145#ifndef ROTATE
146#define ROTATE(a,n) (((a)>>(n))+((a)<<(32-(n))))
147#endif
148 139
149/* Don't worry about the LOAD_DATA() stuff, that is used by 140/* Don't worry about the LOAD_DATA() stuff, that is used by
150 * fcrypt() to add it's little bit to the front */ 141 * fcrypt() to add it's little bit to the front */