summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/sha/sha_locl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/sha/sha_locl.h')
-rw-r--r--src/lib/libcrypto/sha/sha_locl.h27
1 files changed, 3 insertions, 24 deletions
diff --git a/src/lib/libcrypto/sha/sha_locl.h b/src/lib/libcrypto/sha/sha_locl.h
index f2f9a31ee7..f56ac5b9b7 100644
--- a/src/lib/libcrypto/sha/sha_locl.h
+++ b/src/lib/libcrypto/sha/sha_locl.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: sha_locl.h,v 1.19 2014/10/28 07:35:59 jsg Exp $ */ 1/* $OpenBSD: sha_locl.h,v 1.20 2015/09/13 21:09:56 doug Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -76,19 +76,6 @@
76 ll=(c)->h4; HOST_l2c(ll,(s)); \ 76 ll=(c)->h4; HOST_l2c(ll,(s)); \
77 } while (0) 77 } while (0)
78 78
79#if defined(SHA_0)
80
81# define HASH_UPDATE SHA_Update
82# define HASH_TRANSFORM SHA_Transform
83# define HASH_FINAL SHA_Final
84# define HASH_INIT SHA_Init
85# define HASH_BLOCK_DATA_ORDER sha_block_data_order
86# define Xupdate(a,ix,ia,ib,ic,id) (ix=(a)=(ia^ib^ic^id))
87
88static void sha_block_data_order (SHA_CTX *c, const void *p,size_t num);
89
90#elif defined(SHA_1)
91
92# define HASH_UPDATE SHA1_Update 79# define HASH_UPDATE SHA1_Update
93# define HASH_TRANSFORM SHA1_Transform 80# define HASH_TRANSFORM SHA1_Transform
94# define HASH_FINAL SHA1_Final 81# define HASH_FINAL SHA1_Final
@@ -103,10 +90,6 @@ static
103#endif 90#endif
104void sha1_block_data_order (SHA_CTX *c, const void *p,size_t num); 91void sha1_block_data_order (SHA_CTX *c, const void *p,size_t num);
105 92
106#else
107# error "Either SHA_0 or SHA_1 must be defined."
108#endif
109
110#include "md32_common.h" 93#include "md32_common.h"
111 94
112#define INIT_DATA_h0 0x67452301UL 95#define INIT_DATA_h0 0x67452301UL
@@ -115,11 +98,7 @@ void sha1_block_data_order (SHA_CTX *c, const void *p,size_t num);
115#define INIT_DATA_h3 0x10325476UL 98#define INIT_DATA_h3 0x10325476UL
116#define INIT_DATA_h4 0xc3d2e1f0UL 99#define INIT_DATA_h4 0xc3d2e1f0UL
117 100
118#ifdef SHA_0
119int SHA_Init(SHA_CTX *c)
120#else
121int SHA1_Init(SHA_CTX *c) 101int SHA1_Init(SHA_CTX *c)
122#endif
123 { 102 {
124 memset (c,0,sizeof(*c)); 103 memset (c,0,sizeof(*c));
125 c->h0=INIT_DATA_h0; 104 c->h0=INIT_DATA_h0;
@@ -201,7 +180,7 @@ int SHA1_Init(SHA_CTX *c)
201# define X(i) XX[i] 180# define X(i) XX[i]
202#endif 181#endif
203 182
204#if !defined(SHA_1) || !defined(SHA1_ASM) 183#if !defined(SHA1_ASM)
205#include <machine/endian.h> 184#include <machine/endian.h>
206static void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p, size_t num) 185static void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p, size_t num)
207 { 186 {
@@ -387,7 +366,7 @@ static void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p, size_t num)
387 E=D, D=C, C=ROTATE(B,30), B=A; \ 366 E=D, D=C, C=ROTATE(B,30), B=A; \
388 A=ROTATE(A,5)+T+xa; } while(0) 367 A=ROTATE(A,5)+T+xa; } while(0)
389 368
390#if !defined(SHA_1) || !defined(SHA1_ASM) 369#if !defined(SHA1_ASM)
391static void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p, size_t num) 370static void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p, size_t num)
392 { 371 {
393 const unsigned char *data=p; 372 const unsigned char *data=p;