diff options
-rw-r--r-- | src/lib/libcrypto/ripemd/ripemd.h | 25 | ||||
-rw-r--r-- | src/lib/libcrypto/ripemd/rmd_dgst.c | 469 | ||||
-rw-r--r-- | src/lib/libcrypto/ripemd/rmd_one.c | 34 | ||||
-rw-r--r-- | src/lib/libcrypto/ripemd/rmdconst.h | 14 |
4 files changed, 293 insertions, 249 deletions
diff --git a/src/lib/libcrypto/ripemd/ripemd.h b/src/lib/libcrypto/ripemd/ripemd.h index a5f3a12937..03ba781c4f 100644 --- a/src/lib/libcrypto/ripemd/ripemd.h +++ b/src/lib/libcrypto/ripemd/ripemd.h | |||
@@ -1,25 +1,25 @@ | |||
1 | /* $OpenBSD: ripemd.h,v 1.14 2014/07/10 22:45:57 jsing Exp $ */ | 1 | /* $OpenBSD: ripemd.h,v 1.15 2023/07/08 06:52:56 jsing 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 | * |
5 | * This package is an SSL implementation written | 5 | * This package is an SSL implementation written |
6 | * by Eric Young (eay@cryptsoft.com). | 6 | * by Eric Young (eay@cryptsoft.com). |
7 | * The implementation was written so as to conform with Netscapes SSL. | 7 | * The implementation was written so as to conform with Netscapes SSL. |
8 | * | 8 | * |
9 | * This library is free for commercial and non-commercial use as long as | 9 | * This library is free for commercial and non-commercial use as long as |
10 | * the following conditions are aheared to. The following conditions | 10 | * the following conditions are aheared to. The following conditions |
11 | * apply to all code found in this distribution, be it the RC4, RSA, | 11 | * apply to all code found in this distribution, be it the RC4, RSA, |
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation |
13 | * included with this distribution is covered by the same copyright terms | 13 | * included with this distribution is covered by the same copyright terms |
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). |
15 | * | 15 | * |
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | 16 | * Copyright remains Eric Young's, and as such any Copyright notices in |
17 | * the code are not to be removed. | 17 | * the code are not to be removed. |
18 | * If this package is used in a product, Eric Young should be given attribution | 18 | * If this package is used in a product, Eric Young should be given attribution |
19 | * as the author of the parts of the library used. | 19 | * as the author of the parts of the library used. |
20 | * This can be in the form of a textual message at program startup or | 20 | * This can be in the form of a textual message at program startup or |
21 | * in documentation (online or textual) provided with the package. | 21 | * in documentation (online or textual) provided with the package. |
22 | * | 22 | * |
23 | * Redistribution and use in source and binary forms, with or without | 23 | * Redistribution and use in source and binary forms, with or without |
24 | * modification, are permitted provided that the following conditions | 24 | * modification, are permitted provided that the following conditions |
25 | * are met: | 25 | * are met: |
@@ -34,10 +34,10 @@ | |||
34 | * Eric Young (eay@cryptsoft.com)" | 34 | * Eric Young (eay@cryptsoft.com)" |
35 | * The word 'cryptographic' can be left out if the rouines from the library | 35 | * The word 'cryptographic' can be left out if the rouines from the library |
36 | * being used are not cryptographic related :-). | 36 | * being used are not cryptographic related :-). |
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | 37 | * 4. If you include any Windows specific code (or a derivative thereof) from |
38 | * the apps directory (application code) you must include an acknowledgement: | 38 | * the apps directory (application code) you must include an acknowledgement: |
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" |
40 | * | 40 | * |
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND |
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
@@ -49,7 +49,7 @@ | |||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
51 | * SUCH DAMAGE. | 51 | * SUCH DAMAGE. |
52 | * | 52 | * |
53 | * The licence and distribution terms for any publically available version or | 53 | * The licence and distribution terms for any publically available version or |
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be |
55 | * copied and put under another distribution licence | 55 | * copied and put under another distribution licence |
@@ -84,19 +84,18 @@ extern "C" { | |||
84 | #define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4) | 84 | #define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4) |
85 | #define RIPEMD160_DIGEST_LENGTH 20 | 85 | #define RIPEMD160_DIGEST_LENGTH 20 |
86 | 86 | ||
87 | typedef struct RIPEMD160state_st | 87 | typedef struct RIPEMD160state_st { |
88 | { | 88 | RIPEMD160_LONG A, B,C, D, E; |
89 | RIPEMD160_LONG A,B,C,D,E; | 89 | RIPEMD160_LONG Nl, Nh; |
90 | RIPEMD160_LONG Nl,Nh; | ||
91 | RIPEMD160_LONG data[RIPEMD160_LBLOCK]; | 90 | RIPEMD160_LONG data[RIPEMD160_LBLOCK]; |
92 | unsigned int num; | 91 | unsigned int num; |
93 | } RIPEMD160_CTX; | 92 | } RIPEMD160_CTX; |
94 | 93 | ||
95 | int RIPEMD160_Init(RIPEMD160_CTX *c); | 94 | int RIPEMD160_Init(RIPEMD160_CTX *c); |
96 | int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); | 95 | int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); |
97 | int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); | 96 | int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); |
98 | unsigned char *RIPEMD160(const unsigned char *d, size_t n, | 97 | unsigned char *RIPEMD160(const unsigned char *d, size_t n, |
99 | unsigned char *md); | 98 | unsigned char *md); |
100 | void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b); | 99 | void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b); |
101 | #ifdef __cplusplus | 100 | #ifdef __cplusplus |
102 | } | 101 | } |
diff --git a/src/lib/libcrypto/ripemd/rmd_dgst.c b/src/lib/libcrypto/ripemd/rmd_dgst.c index 9ba11edeb6..0b441d5ccb 100644 --- a/src/lib/libcrypto/ripemd/rmd_dgst.c +++ b/src/lib/libcrypto/ripemd/rmd_dgst.c | |||
@@ -1,25 +1,25 @@ | |||
1 | /* $OpenBSD: rmd_dgst.c,v 1.19 2023/07/08 06:43:39 jsing Exp $ */ | 1 | /* $OpenBSD: rmd_dgst.c,v 1.20 2023/07/08 06:52:56 jsing 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 | * |
5 | * This package is an SSL implementation written | 5 | * This package is an SSL implementation written |
6 | * by Eric Young (eay@cryptsoft.com). | 6 | * by Eric Young (eay@cryptsoft.com). |
7 | * The implementation was written so as to conform with Netscapes SSL. | 7 | * The implementation was written so as to conform with Netscapes SSL. |
8 | * | 8 | * |
9 | * This library is free for commercial and non-commercial use as long as | 9 | * This library is free for commercial and non-commercial use as long as |
10 | * the following conditions are aheared to. The following conditions | 10 | * the following conditions are aheared to. The following conditions |
11 | * apply to all code found in this distribution, be it the RC4, RSA, | 11 | * apply to all code found in this distribution, be it the RC4, RSA, |
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation |
13 | * included with this distribution is covered by the same copyright terms | 13 | * included with this distribution is covered by the same copyright terms |
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). |
15 | * | 15 | * |
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | 16 | * Copyright remains Eric Young's, and as such any Copyright notices in |
17 | * the code are not to be removed. | 17 | * the code are not to be removed. |
18 | * If this package is used in a product, Eric Young should be given attribution | 18 | * If this package is used in a product, Eric Young should be given attribution |
19 | * as the author of the parts of the library used. | 19 | * as the author of the parts of the library used. |
20 | * This can be in the form of a textual message at program startup or | 20 | * This can be in the form of a textual message at program startup or |
21 | * in documentation (online or textual) provided with the package. | 21 | * in documentation (online or textual) provided with the package. |
22 | * | 22 | * |
23 | * Redistribution and use in source and binary forms, with or without | 23 | * Redistribution and use in source and binary forms, with or without |
24 | * modification, are permitted provided that the following conditions | 24 | * modification, are permitted provided that the following conditions |
25 | * are met: | 25 | * are met: |
@@ -34,10 +34,10 @@ | |||
34 | * Eric Young (eay@cryptsoft.com)" | 34 | * Eric Young (eay@cryptsoft.com)" |
35 | * The word 'cryptographic' can be left out if the rouines from the library | 35 | * The word 'cryptographic' can be left out if the rouines from the library |
36 | * being used are not cryptographic related :-). | 36 | * being used are not cryptographic related :-). |
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | 37 | * 4. If you include any Windows specific code (or a derivative thereof) from |
38 | * the apps directory (application code) you must include an acknowledgement: | 38 | * the apps directory (application code) you must include an acknowledgement: |
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" |
40 | * | 40 | * |
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND |
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
@@ -49,7 +49,7 @@ | |||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
51 | * SUCH DAMAGE. | 51 | * SUCH DAMAGE. |
52 | * | 52 | * |
53 | * The licence and distribution terms for any publically available version or | 53 | * The licence and distribution terms for any publically available version or |
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be |
55 | * copied and put under another distribution licence | 55 | * copied and put under another distribution licence |
@@ -78,7 +78,7 @@ | |||
78 | 78 | ||
79 | __BEGIN_HIDDEN_DECLS | 79 | __BEGIN_HIDDEN_DECLS |
80 | 80 | ||
81 | void ripemd160_block_data_order (RIPEMD160_CTX *c, const void *p,size_t num); | 81 | void ripemd160_block_data_order (RIPEMD160_CTX *c, const void *p, size_t num); |
82 | 82 | ||
83 | __END_HIDDEN_DECLS | 83 | __END_HIDDEN_DECLS |
84 | 84 | ||
@@ -153,229 +153,272 @@ __END_HIDDEN_DECLS | |||
153 | c=ROTATE(c,10); } | 153 | c=ROTATE(c,10); } |
154 | 154 | ||
155 | # ifdef RMD160_ASM | 155 | # ifdef RMD160_ASM |
156 | void ripemd160_block_x86(RIPEMD160_CTX *c, unsigned long *p,size_t num); | 156 | void ripemd160_block_x86(RIPEMD160_CTX *c, unsigned long *p, size_t num); |
157 | # define ripemd160_block ripemd160_block_x86 | 157 | # define ripemd160_block ripemd160_block_x86 |
158 | # else | 158 | # else |
159 | void ripemd160_block(RIPEMD160_CTX *c, unsigned long *p,size_t num); | 159 | void ripemd160_block(RIPEMD160_CTX *c, unsigned long *p, size_t num); |
160 | # endif | 160 | # endif |
161 | 161 | ||
162 | int RIPEMD160_Init(RIPEMD160_CTX *c) | 162 | int |
163 | { | 163 | RIPEMD160_Init(RIPEMD160_CTX *c) |
164 | memset (c,0,sizeof(*c)); | 164 | { |
165 | c->A=RIPEMD160_A; | 165 | memset (c, 0, sizeof(*c)); |
166 | c->B=RIPEMD160_B; | 166 | c->A = RIPEMD160_A; |
167 | c->C=RIPEMD160_C; | 167 | c->B = RIPEMD160_B; |
168 | c->D=RIPEMD160_D; | 168 | c->C = RIPEMD160_C; |
169 | c->E=RIPEMD160_E; | 169 | c->D = RIPEMD160_D; |
170 | c->E = RIPEMD160_E; | ||
170 | return 1; | 171 | return 1; |
171 | } | 172 | } |
172 | 173 | ||
173 | #ifndef ripemd160_block_data_order | 174 | #ifndef ripemd160_block_data_order |
174 | #ifdef X | 175 | #ifdef X |
175 | #undef X | 176 | #undef X |
176 | #endif | 177 | #endif |
177 | void ripemd160_block_data_order (RIPEMD160_CTX *ctx, const void *p, size_t num) | 178 | void |
178 | { | 179 | ripemd160_block_data_order(RIPEMD160_CTX *ctx, const void *p, size_t num) |
179 | const unsigned char *data=p; | 180 | { |
180 | unsigned MD32_REG_T A,B,C,D,E; | 181 | const unsigned char *data = p; |
181 | unsigned MD32_REG_T a,b,c,d,e,l; | 182 | unsigned MD32_REG_T A, B,C, D, E; |
183 | unsigned MD32_REG_T a, b,c, d,e, l; | ||
182 | #ifndef MD32_XARRAY | 184 | #ifndef MD32_XARRAY |
183 | /* See comment in crypto/sha/sha_locl.h for details. */ | 185 | /* See comment in crypto/sha/sha_locl.h for details. */ |
184 | unsigned MD32_REG_T XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7, | 186 | unsigned MD32_REG_T XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7, |
185 | XX8, XX9,XX10,XX11,XX12,XX13,XX14,XX15; | 187 | XX8, XX9, XX10, XX11, XX12, XX13, XX14, XX15; |
186 | # define X(i) XX##i | 188 | # define X(i) XX##i |
187 | #else | 189 | #else |
188 | RIPEMD160_LONG XX[16]; | 190 | RIPEMD160_LONG XX[16]; |
189 | # define X(i) XX[i] | 191 | # define X(i) XX[i] |
190 | #endif | 192 | #endif |
191 | 193 | ||
192 | for (;num--;) | 194 | for (; num--; ) { |
193 | { | 195 | |
194 | 196 | A = ctx->A; | |
195 | A=ctx->A; B=ctx->B; C=ctx->C; D=ctx->D; E=ctx->E; | 197 | B = ctx->B; |
196 | 198 | C = ctx->C; | |
197 | HOST_c2l(data,l); X( 0)=l;HOST_c2l(data,l); X( 1)=l; | 199 | D = ctx->D; |
198 | RIP1(A,B,C,D,E,WL00,SL00); HOST_c2l(data,l); X( 2)=l; | 200 | E = ctx->E; |
199 | RIP1(E,A,B,C,D,WL01,SL01); HOST_c2l(data,l); X( 3)=l; | 201 | |
200 | RIP1(D,E,A,B,C,WL02,SL02); HOST_c2l(data,l); X( 4)=l; | 202 | HOST_c2l(data, l); |
201 | RIP1(C,D,E,A,B,WL03,SL03); HOST_c2l(data,l); X( 5)=l; | 203 | X( 0) = l;HOST_c2l(data, l); |
202 | RIP1(B,C,D,E,A,WL04,SL04); HOST_c2l(data,l); X( 6)=l; | 204 | X( 1) = l; |
203 | RIP1(A,B,C,D,E,WL05,SL05); HOST_c2l(data,l); X( 7)=l; | 205 | RIP1(A, B,C, D,E, WL00, SL00); |
204 | RIP1(E,A,B,C,D,WL06,SL06); HOST_c2l(data,l); X( 8)=l; | 206 | HOST_c2l(data, l); |
205 | RIP1(D,E,A,B,C,WL07,SL07); HOST_c2l(data,l); X( 9)=l; | 207 | X( 2) = l; |
206 | RIP1(C,D,E,A,B,WL08,SL08); HOST_c2l(data,l); X(10)=l; | 208 | RIP1(E, A,B, C,D, WL01, SL01); |
207 | RIP1(B,C,D,E,A,WL09,SL09); HOST_c2l(data,l); X(11)=l; | 209 | HOST_c2l(data, l); |
208 | RIP1(A,B,C,D,E,WL10,SL10); HOST_c2l(data,l); X(12)=l; | 210 | X( 3) = l; |
209 | RIP1(E,A,B,C,D,WL11,SL11); HOST_c2l(data,l); X(13)=l; | 211 | RIP1(D, E,A, B,C, WL02, SL02); |
210 | RIP1(D,E,A,B,C,WL12,SL12); HOST_c2l(data,l); X(14)=l; | 212 | HOST_c2l(data, l); |
211 | RIP1(C,D,E,A,B,WL13,SL13); HOST_c2l(data,l); X(15)=l; | 213 | X( 4) = l; |
212 | RIP1(B,C,D,E,A,WL14,SL14); | 214 | RIP1(C, D,E, A,B, WL03, SL03); |
213 | RIP1(A,B,C,D,E,WL15,SL15); | 215 | HOST_c2l(data, l); |
214 | 216 | X( 5) = l; | |
215 | RIP2(E,A,B,C,D,WL16,SL16,KL1); | 217 | RIP1(B, C,D, E,A, WL04, SL04); |
216 | RIP2(D,E,A,B,C,WL17,SL17,KL1); | 218 | HOST_c2l(data, l); |
217 | RIP2(C,D,E,A,B,WL18,SL18,KL1); | 219 | X( 6) = l; |
218 | RIP2(B,C,D,E,A,WL19,SL19,KL1); | 220 | RIP1(A, B,C, D,E, WL05, SL05); |
219 | RIP2(A,B,C,D,E,WL20,SL20,KL1); | 221 | HOST_c2l(data, l); |
220 | RIP2(E,A,B,C,D,WL21,SL21,KL1); | 222 | X( 7) = l; |
221 | RIP2(D,E,A,B,C,WL22,SL22,KL1); | 223 | RIP1(E, A,B, C,D, WL06, SL06); |
222 | RIP2(C,D,E,A,B,WL23,SL23,KL1); | 224 | HOST_c2l(data, l); |
223 | RIP2(B,C,D,E,A,WL24,SL24,KL1); | 225 | X( 8) = l; |
224 | RIP2(A,B,C,D,E,WL25,SL25,KL1); | 226 | RIP1(D, E,A, B,C, WL07, SL07); |
225 | RIP2(E,A,B,C,D,WL26,SL26,KL1); | 227 | HOST_c2l(data, l); |
226 | RIP2(D,E,A,B,C,WL27,SL27,KL1); | 228 | X( 9) = l; |
227 | RIP2(C,D,E,A,B,WL28,SL28,KL1); | 229 | RIP1(C, D,E, A,B, WL08, SL08); |
228 | RIP2(B,C,D,E,A,WL29,SL29,KL1); | 230 | HOST_c2l(data, l); |
229 | RIP2(A,B,C,D,E,WL30,SL30,KL1); | 231 | X(10) = l; |
230 | RIP2(E,A,B,C,D,WL31,SL31,KL1); | 232 | RIP1(B, C,D, E,A, WL09, SL09); |
231 | 233 | HOST_c2l(data, l); | |
232 | RIP3(D,E,A,B,C,WL32,SL32,KL2); | 234 | X(11) = l; |
233 | RIP3(C,D,E,A,B,WL33,SL33,KL2); | 235 | RIP1(A, B,C, D,E, WL10, SL10); |
234 | RIP3(B,C,D,E,A,WL34,SL34,KL2); | 236 | HOST_c2l(data, l); |
235 | RIP3(A,B,C,D,E,WL35,SL35,KL2); | 237 | X(12) = l; |
236 | RIP3(E,A,B,C,D,WL36,SL36,KL2); | 238 | RIP1(E, A,B, C,D, WL11, SL11); |
237 | RIP3(D,E,A,B,C,WL37,SL37,KL2); | 239 | HOST_c2l(data, l); |
238 | RIP3(C,D,E,A,B,WL38,SL38,KL2); | 240 | X(13) = l; |
239 | RIP3(B,C,D,E,A,WL39,SL39,KL2); | 241 | RIP1(D, E,A, B,C, WL12, SL12); |
240 | RIP3(A,B,C,D,E,WL40,SL40,KL2); | 242 | HOST_c2l(data, l); |
241 | RIP3(E,A,B,C,D,WL41,SL41,KL2); | 243 | X(14) = l; |
242 | RIP3(D,E,A,B,C,WL42,SL42,KL2); | 244 | RIP1(C, D,E, A,B, WL13, SL13); |
243 | RIP3(C,D,E,A,B,WL43,SL43,KL2); | 245 | HOST_c2l(data, l); |
244 | RIP3(B,C,D,E,A,WL44,SL44,KL2); | 246 | X(15) = l; |
245 | RIP3(A,B,C,D,E,WL45,SL45,KL2); | 247 | RIP1(B, C,D, E,A, WL14, SL14); |
246 | RIP3(E,A,B,C,D,WL46,SL46,KL2); | 248 | RIP1(A, B,C, D,E, WL15, SL15); |
247 | RIP3(D,E,A,B,C,WL47,SL47,KL2); | 249 | |
248 | 250 | RIP2(E, A,B, C,D, WL16, SL16, KL1); | |
249 | RIP4(C,D,E,A,B,WL48,SL48,KL3); | 251 | RIP2(D, E,A, B,C, WL17, SL17, KL1); |
250 | RIP4(B,C,D,E,A,WL49,SL49,KL3); | 252 | RIP2(C, D,E, A,B, WL18, SL18, KL1); |
251 | RIP4(A,B,C,D,E,WL50,SL50,KL3); | 253 | RIP2(B, C,D, E,A, WL19, SL19, KL1); |
252 | RIP4(E,A,B,C,D,WL51,SL51,KL3); | 254 | RIP2(A, B,C, D,E, WL20, SL20, KL1); |
253 | RIP4(D,E,A,B,C,WL52,SL52,KL3); | 255 | RIP2(E, A,B, C,D, WL21, SL21, KL1); |
254 | RIP4(C,D,E,A,B,WL53,SL53,KL3); | 256 | RIP2(D, E,A, B,C, WL22, SL22, KL1); |
255 | RIP4(B,C,D,E,A,WL54,SL54,KL3); | 257 | RIP2(C, D,E, A,B, WL23, SL23, KL1); |
256 | RIP4(A,B,C,D,E,WL55,SL55,KL3); | 258 | RIP2(B, C,D, E,A, WL24, SL24, KL1); |
257 | RIP4(E,A,B,C,D,WL56,SL56,KL3); | 259 | RIP2(A, B,C, D,E, WL25, SL25, KL1); |
258 | RIP4(D,E,A,B,C,WL57,SL57,KL3); | 260 | RIP2(E, A,B, C,D, WL26, SL26, KL1); |
259 | RIP4(C,D,E,A,B,WL58,SL58,KL3); | 261 | RIP2(D, E,A, B,C, WL27, SL27, KL1); |
260 | RIP4(B,C,D,E,A,WL59,SL59,KL3); | 262 | RIP2(C, D,E, A,B, WL28, SL28, KL1); |
261 | RIP4(A,B,C,D,E,WL60,SL60,KL3); | 263 | RIP2(B, C,D, E,A, WL29, SL29, KL1); |
262 | RIP4(E,A,B,C,D,WL61,SL61,KL3); | 264 | RIP2(A, B,C, D,E, WL30, SL30, KL1); |
263 | RIP4(D,E,A,B,C,WL62,SL62,KL3); | 265 | RIP2(E, A,B, C,D, WL31, SL31, KL1); |
264 | RIP4(C,D,E,A,B,WL63,SL63,KL3); | 266 | |
265 | 267 | RIP3(D, E,A, B,C, WL32, SL32, KL2); | |
266 | RIP5(B,C,D,E,A,WL64,SL64,KL4); | 268 | RIP3(C, D,E, A,B, WL33, SL33, KL2); |
267 | RIP5(A,B,C,D,E,WL65,SL65,KL4); | 269 | RIP3(B, C,D, E,A, WL34, SL34, KL2); |
268 | RIP5(E,A,B,C,D,WL66,SL66,KL4); | 270 | RIP3(A, B,C, D,E, WL35, SL35, KL2); |
269 | RIP5(D,E,A,B,C,WL67,SL67,KL4); | 271 | RIP3(E, A,B, C,D, WL36, SL36, KL2); |
270 | RIP5(C,D,E,A,B,WL68,SL68,KL4); | 272 | RIP3(D, E,A, B,C, WL37, SL37, KL2); |
271 | RIP5(B,C,D,E,A,WL69,SL69,KL4); | 273 | RIP3(C, D,E, A,B, WL38, SL38, KL2); |
272 | RIP5(A,B,C,D,E,WL70,SL70,KL4); | 274 | RIP3(B, C,D, E,A, WL39, SL39, KL2); |
273 | RIP5(E,A,B,C,D,WL71,SL71,KL4); | 275 | RIP3(A, B,C, D,E, WL40, SL40, KL2); |
274 | RIP5(D,E,A,B,C,WL72,SL72,KL4); | 276 | RIP3(E, A,B, C,D, WL41, SL41, KL2); |
275 | RIP5(C,D,E,A,B,WL73,SL73,KL4); | 277 | RIP3(D, E,A, B,C, WL42, SL42, KL2); |
276 | RIP5(B,C,D,E,A,WL74,SL74,KL4); | 278 | RIP3(C, D,E, A,B, WL43, SL43, KL2); |
277 | RIP5(A,B,C,D,E,WL75,SL75,KL4); | 279 | RIP3(B, C,D, E,A, WL44, SL44, KL2); |
278 | RIP5(E,A,B,C,D,WL76,SL76,KL4); | 280 | RIP3(A, B,C, D,E, WL45, SL45, KL2); |
279 | RIP5(D,E,A,B,C,WL77,SL77,KL4); | 281 | RIP3(E, A,B, C,D, WL46, SL46, KL2); |
280 | RIP5(C,D,E,A,B,WL78,SL78,KL4); | 282 | RIP3(D, E,A, B,C, WL47, SL47, KL2); |
281 | RIP5(B,C,D,E,A,WL79,SL79,KL4); | 283 | |
282 | 284 | RIP4(C, D,E, A,B, WL48, SL48, KL3); | |
283 | a=A; b=B; c=C; d=D; e=E; | 285 | RIP4(B, C,D, E,A, WL49, SL49, KL3); |
284 | /* Do other half */ | 286 | RIP4(A, B,C, D,E, WL50, SL50, KL3); |
285 | A=ctx->A; B=ctx->B; C=ctx->C; D=ctx->D; E=ctx->E; | 287 | RIP4(E, A,B, C,D, WL51, SL51, KL3); |
286 | 288 | RIP4(D, E,A, B,C, WL52, SL52, KL3); | |
287 | RIP5(A,B,C,D,E,WR00,SR00,KR0); | 289 | RIP4(C, D,E, A,B, WL53, SL53, KL3); |
288 | RIP5(E,A,B,C,D,WR01,SR01,KR0); | 290 | RIP4(B, C,D, E,A, WL54, SL54, KL3); |
289 | RIP5(D,E,A,B,C,WR02,SR02,KR0); | 291 | RIP4(A, B,C, D,E, WL55, SL55, KL3); |
290 | RIP5(C,D,E,A,B,WR03,SR03,KR0); | 292 | RIP4(E, A,B, C,D, WL56, SL56, KL3); |
291 | RIP5(B,C,D,E,A,WR04,SR04,KR0); | 293 | RIP4(D, E,A, B,C, WL57, SL57, KL3); |
292 | RIP5(A,B,C,D,E,WR05,SR05,KR0); | 294 | RIP4(C, D,E, A,B, WL58, SL58, KL3); |
293 | RIP5(E,A,B,C,D,WR06,SR06,KR0); | 295 | RIP4(B, C,D, E,A, WL59, SL59, KL3); |
294 | RIP5(D,E,A,B,C,WR07,SR07,KR0); | 296 | RIP4(A, B,C, D,E, WL60, SL60, KL3); |
295 | RIP5(C,D,E,A,B,WR08,SR08,KR0); | 297 | RIP4(E, A,B, C,D, WL61, SL61, KL3); |
296 | RIP5(B,C,D,E,A,WR09,SR09,KR0); | 298 | RIP4(D, E,A, B,C, WL62, SL62, KL3); |
297 | RIP5(A,B,C,D,E,WR10,SR10,KR0); | 299 | RIP4(C, D,E, A,B, WL63, SL63, KL3); |
298 | RIP5(E,A,B,C,D,WR11,SR11,KR0); | 300 | |
299 | RIP5(D,E,A,B,C,WR12,SR12,KR0); | 301 | RIP5(B, C,D, E,A, WL64, SL64, KL4); |
300 | RIP5(C,D,E,A,B,WR13,SR13,KR0); | 302 | RIP5(A, B,C, D,E, WL65, SL65, KL4); |
301 | RIP5(B,C,D,E,A,WR14,SR14,KR0); | 303 | RIP5(E, A,B, C,D, WL66, SL66, KL4); |
302 | RIP5(A,B,C,D,E,WR15,SR15,KR0); | 304 | RIP5(D, E,A, B,C, WL67, SL67, KL4); |
303 | 305 | RIP5(C, D,E, A,B, WL68, SL68, KL4); | |
304 | RIP4(E,A,B,C,D,WR16,SR16,KR1); | 306 | RIP5(B, C,D, E,A, WL69, SL69, KL4); |
305 | RIP4(D,E,A,B,C,WR17,SR17,KR1); | 307 | RIP5(A, B,C, D,E, WL70, SL70, KL4); |
306 | RIP4(C,D,E,A,B,WR18,SR18,KR1); | 308 | RIP5(E, A,B, C,D, WL71, SL71, KL4); |
307 | RIP4(B,C,D,E,A,WR19,SR19,KR1); | 309 | RIP5(D, E,A, B,C, WL72, SL72, KL4); |
308 | RIP4(A,B,C,D,E,WR20,SR20,KR1); | 310 | RIP5(C, D,E, A,B, WL73, SL73, KL4); |
309 | RIP4(E,A,B,C,D,WR21,SR21,KR1); | 311 | RIP5(B, C,D, E,A, WL74, SL74, KL4); |
310 | RIP4(D,E,A,B,C,WR22,SR22,KR1); | 312 | RIP5(A, B,C, D,E, WL75, SL75, KL4); |
311 | RIP4(C,D,E,A,B,WR23,SR23,KR1); | 313 | RIP5(E, A,B, C,D, WL76, SL76, KL4); |
312 | RIP4(B,C,D,E,A,WR24,SR24,KR1); | 314 | RIP5(D, E,A, B,C, WL77, SL77, KL4); |
313 | RIP4(A,B,C,D,E,WR25,SR25,KR1); | 315 | RIP5(C, D,E, A,B, WL78, SL78, KL4); |
314 | RIP4(E,A,B,C,D,WR26,SR26,KR1); | 316 | RIP5(B, C,D, E,A, WL79, SL79, KL4); |
315 | RIP4(D,E,A,B,C,WR27,SR27,KR1); | 317 | |
316 | RIP4(C,D,E,A,B,WR28,SR28,KR1); | 318 | a = A; |
317 | RIP4(B,C,D,E,A,WR29,SR29,KR1); | 319 | b = B; |
318 | RIP4(A,B,C,D,E,WR30,SR30,KR1); | 320 | c = C; |
319 | RIP4(E,A,B,C,D,WR31,SR31,KR1); | 321 | d = D; |
320 | 322 | e = E; | |
321 | RIP3(D,E,A,B,C,WR32,SR32,KR2); | 323 | /* Do other half */ |
322 | RIP3(C,D,E,A,B,WR33,SR33,KR2); | 324 | A = ctx->A; |
323 | RIP3(B,C,D,E,A,WR34,SR34,KR2); | 325 | B = ctx->B; |
324 | RIP3(A,B,C,D,E,WR35,SR35,KR2); | 326 | C = ctx->C; |
325 | RIP3(E,A,B,C,D,WR36,SR36,KR2); | 327 | D = ctx->D; |
326 | RIP3(D,E,A,B,C,WR37,SR37,KR2); | 328 | E = ctx->E; |
327 | RIP3(C,D,E,A,B,WR38,SR38,KR2); | 329 | |
328 | RIP3(B,C,D,E,A,WR39,SR39,KR2); | 330 | RIP5(A, B,C, D,E, WR00, SR00, KR0); |
329 | RIP3(A,B,C,D,E,WR40,SR40,KR2); | 331 | RIP5(E, A,B, C,D, WR01, SR01, KR0); |
330 | RIP3(E,A,B,C,D,WR41,SR41,KR2); | 332 | RIP5(D, E,A, B,C, WR02, SR02, KR0); |
331 | RIP3(D,E,A,B,C,WR42,SR42,KR2); | 333 | RIP5(C, D,E, A,B, WR03, SR03, KR0); |
332 | RIP3(C,D,E,A,B,WR43,SR43,KR2); | 334 | RIP5(B, C,D, E,A, WR04, SR04, KR0); |
333 | RIP3(B,C,D,E,A,WR44,SR44,KR2); | 335 | RIP5(A, B,C, D,E, WR05, SR05, KR0); |
334 | RIP3(A,B,C,D,E,WR45,SR45,KR2); | 336 | RIP5(E, A,B, C,D, WR06, SR06, KR0); |
335 | RIP3(E,A,B,C,D,WR46,SR46,KR2); | 337 | RIP5(D, E,A, B,C, WR07, SR07, KR0); |
336 | RIP3(D,E,A,B,C,WR47,SR47,KR2); | 338 | RIP5(C, D,E, A,B, WR08, SR08, KR0); |
337 | 339 | RIP5(B, C,D, E,A, WR09, SR09, KR0); | |
338 | RIP2(C,D,E,A,B,WR48,SR48,KR3); | 340 | RIP5(A, B,C, D,E, WR10, SR10, KR0); |
339 | RIP2(B,C,D,E,A,WR49,SR49,KR3); | 341 | RIP5(E, A,B, C,D, WR11, SR11, KR0); |
340 | RIP2(A,B,C,D,E,WR50,SR50,KR3); | 342 | RIP5(D, E,A, B,C, WR12, SR12, KR0); |
341 | RIP2(E,A,B,C,D,WR51,SR51,KR3); | 343 | RIP5(C, D,E, A,B, WR13, SR13, KR0); |
342 | RIP2(D,E,A,B,C,WR52,SR52,KR3); | 344 | RIP5(B, C,D, E,A, WR14, SR14, KR0); |
343 | RIP2(C,D,E,A,B,WR53,SR53,KR3); | 345 | RIP5(A, B,C, D,E, WR15, SR15, KR0); |
344 | RIP2(B,C,D,E,A,WR54,SR54,KR3); | 346 | |
345 | RIP2(A,B,C,D,E,WR55,SR55,KR3); | 347 | RIP4(E, A,B, C,D, WR16, SR16, KR1); |
346 | RIP2(E,A,B,C,D,WR56,SR56,KR3); | 348 | RIP4(D, E,A, B,C, WR17, SR17, KR1); |
347 | RIP2(D,E,A,B,C,WR57,SR57,KR3); | 349 | RIP4(C, D,E, A,B, WR18, SR18, KR1); |
348 | RIP2(C,D,E,A,B,WR58,SR58,KR3); | 350 | RIP4(B, C,D, E,A, WR19, SR19, KR1); |
349 | RIP2(B,C,D,E,A,WR59,SR59,KR3); | 351 | RIP4(A, B,C, D,E, WR20, SR20, KR1); |
350 | RIP2(A,B,C,D,E,WR60,SR60,KR3); | 352 | RIP4(E, A,B, C,D, WR21, SR21, KR1); |
351 | RIP2(E,A,B,C,D,WR61,SR61,KR3); | 353 | RIP4(D, E,A, B,C, WR22, SR22, KR1); |
352 | RIP2(D,E,A,B,C,WR62,SR62,KR3); | 354 | RIP4(C, D,E, A,B, WR23, SR23, KR1); |
353 | RIP2(C,D,E,A,B,WR63,SR63,KR3); | 355 | RIP4(B, C,D, E,A, WR24, SR24, KR1); |
354 | 356 | RIP4(A, B,C, D,E, WR25, SR25, KR1); | |
355 | RIP1(B,C,D,E,A,WR64,SR64); | 357 | RIP4(E, A,B, C,D, WR26, SR26, KR1); |
356 | RIP1(A,B,C,D,E,WR65,SR65); | 358 | RIP4(D, E,A, B,C, WR27, SR27, KR1); |
357 | RIP1(E,A,B,C,D,WR66,SR66); | 359 | RIP4(C, D,E, A,B, WR28, SR28, KR1); |
358 | RIP1(D,E,A,B,C,WR67,SR67); | 360 | RIP4(B, C,D, E,A, WR29, SR29, KR1); |
359 | RIP1(C,D,E,A,B,WR68,SR68); | 361 | RIP4(A, B,C, D,E, WR30, SR30, KR1); |
360 | RIP1(B,C,D,E,A,WR69,SR69); | 362 | RIP4(E, A,B, C,D, WR31, SR31, KR1); |
361 | RIP1(A,B,C,D,E,WR70,SR70); | 363 | |
362 | RIP1(E,A,B,C,D,WR71,SR71); | 364 | RIP3(D, E,A, B,C, WR32, SR32, KR2); |
363 | RIP1(D,E,A,B,C,WR72,SR72); | 365 | RIP3(C, D,E, A,B, WR33, SR33, KR2); |
364 | RIP1(C,D,E,A,B,WR73,SR73); | 366 | RIP3(B, C,D, E,A, WR34, SR34, KR2); |
365 | RIP1(B,C,D,E,A,WR74,SR74); | 367 | RIP3(A, B,C, D,E, WR35, SR35, KR2); |
366 | RIP1(A,B,C,D,E,WR75,SR75); | 368 | RIP3(E, A,B, C,D, WR36, SR36, KR2); |
367 | RIP1(E,A,B,C,D,WR76,SR76); | 369 | RIP3(D, E,A, B,C, WR37, SR37, KR2); |
368 | RIP1(D,E,A,B,C,WR77,SR77); | 370 | RIP3(C, D,E, A,B, WR38, SR38, KR2); |
369 | RIP1(C,D,E,A,B,WR78,SR78); | 371 | RIP3(B, C,D, E,A, WR39, SR39, KR2); |
370 | RIP1(B,C,D,E,A,WR79,SR79); | 372 | RIP3(A, B,C, D,E, WR40, SR40, KR2); |
371 | 373 | RIP3(E, A,B, C,D, WR41, SR41, KR2); | |
372 | D =ctx->B+c+D; | 374 | RIP3(D, E,A, B,C, WR42, SR42, KR2); |
373 | ctx->B=ctx->C+d+E; | 375 | RIP3(C, D,E, A,B, WR43, SR43, KR2); |
374 | ctx->C=ctx->D+e+A; | 376 | RIP3(B, C,D, E,A, WR44, SR44, KR2); |
375 | ctx->D=ctx->E+a+B; | 377 | RIP3(A, B,C, D,E, WR45, SR45, KR2); |
376 | ctx->E=ctx->A+b+C; | 378 | RIP3(E, A,B, C,D, WR46, SR46, KR2); |
377 | ctx->A=D; | 379 | RIP3(D, E,A, B,C, WR47, SR47, KR2); |
378 | 380 | ||
379 | } | 381 | RIP2(C, D,E, A,B, WR48, SR48, KR3); |
382 | RIP2(B, C,D, E,A, WR49, SR49, KR3); | ||
383 | RIP2(A, B,C, D,E, WR50, SR50, KR3); | ||
384 | RIP2(E, A,B, C,D, WR51, SR51, KR3); | ||
385 | RIP2(D, E,A, B,C, WR52, SR52, KR3); | ||
386 | RIP2(C, D,E, A,B, WR53, SR53, KR3); | ||
387 | RIP2(B, C,D, E,A, WR54, SR54, KR3); | ||
388 | RIP2(A, B,C, D,E, WR55, SR55, KR3); | ||
389 | RIP2(E, A,B, C,D, WR56, SR56, KR3); | ||
390 | RIP2(D, E,A, B,C, WR57, SR57, KR3); | ||
391 | RIP2(C, D,E, A,B, WR58, SR58, KR3); | ||
392 | RIP2(B, C,D, E,A, WR59, SR59, KR3); | ||
393 | RIP2(A, B,C, D,E, WR60, SR60, KR3); | ||
394 | RIP2(E, A,B, C,D, WR61, SR61, KR3); | ||
395 | RIP2(D, E,A, B,C, WR62, SR62, KR3); | ||
396 | RIP2(C, D,E, A,B, WR63, SR63, KR3); | ||
397 | |||
398 | RIP1(B, C,D, E,A, WR64, SR64); | ||
399 | RIP1(A, B,C, D,E, WR65, SR65); | ||
400 | RIP1(E, A,B, C,D, WR66, SR66); | ||
401 | RIP1(D, E,A, B,C, WR67, SR67); | ||
402 | RIP1(C, D,E, A,B, WR68, SR68); | ||
403 | RIP1(B, C,D, E,A, WR69, SR69); | ||
404 | RIP1(A, B,C, D,E, WR70, SR70); | ||
405 | RIP1(E, A,B, C,D, WR71, SR71); | ||
406 | RIP1(D, E,A, B,C, WR72, SR72); | ||
407 | RIP1(C, D,E, A,B, WR73, SR73); | ||
408 | RIP1(B, C,D, E,A, WR74, SR74); | ||
409 | RIP1(A, B,C, D,E, WR75, SR75); | ||
410 | RIP1(E, A,B, C,D, WR76, SR76); | ||
411 | RIP1(D, E,A, B,C, WR77, SR77); | ||
412 | RIP1(C, D,E, A,B, WR78, SR78); | ||
413 | RIP1(B, C,D, E,A, WR79, SR79); | ||
414 | |||
415 | D = ctx->B + c + D; | ||
416 | ctx->B = ctx->C + d + E; | ||
417 | ctx->C = ctx->D + e + A; | ||
418 | ctx->D = ctx->E + a + B; | ||
419 | ctx->E = ctx->A + b + C; | ||
420 | ctx->A = D; | ||
421 | |||
380 | } | 422 | } |
423 | } | ||
381 | #endif | 424 | #endif |
diff --git a/src/lib/libcrypto/ripemd/rmd_one.c b/src/lib/libcrypto/ripemd/rmd_one.c index 0d372f32f7..18b7460396 100644 --- a/src/lib/libcrypto/ripemd/rmd_one.c +++ b/src/lib/libcrypto/ripemd/rmd_one.c | |||
@@ -1,25 +1,25 @@ | |||
1 | /* $OpenBSD: rmd_one.c,v 1.9 2015/09/10 15:56:25 jsing Exp $ */ | 1 | /* $OpenBSD: rmd_one.c,v 1.10 2023/07/08 06:52:56 jsing 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 | * |
5 | * This package is an SSL implementation written | 5 | * This package is an SSL implementation written |
6 | * by Eric Young (eay@cryptsoft.com). | 6 | * by Eric Young (eay@cryptsoft.com). |
7 | * The implementation was written so as to conform with Netscapes SSL. | 7 | * The implementation was written so as to conform with Netscapes SSL. |
8 | * | 8 | * |
9 | * This library is free for commercial and non-commercial use as long as | 9 | * This library is free for commercial and non-commercial use as long as |
10 | * the following conditions are aheared to. The following conditions | 10 | * the following conditions are aheared to. The following conditions |
11 | * apply to all code found in this distribution, be it the RC4, RSA, | 11 | * apply to all code found in this distribution, be it the RC4, RSA, |
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation |
13 | * included with this distribution is covered by the same copyright terms | 13 | * included with this distribution is covered by the same copyright terms |
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). |
15 | * | 15 | * |
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | 16 | * Copyright remains Eric Young's, and as such any Copyright notices in |
17 | * the code are not to be removed. | 17 | * the code are not to be removed. |
18 | * If this package is used in a product, Eric Young should be given attribution | 18 | * If this package is used in a product, Eric Young should be given attribution |
19 | * as the author of the parts of the library used. | 19 | * as the author of the parts of the library used. |
20 | * This can be in the form of a textual message at program startup or | 20 | * This can be in the form of a textual message at program startup or |
21 | * in documentation (online or textual) provided with the package. | 21 | * in documentation (online or textual) provided with the package. |
22 | * | 22 | * |
23 | * Redistribution and use in source and binary forms, with or without | 23 | * Redistribution and use in source and binary forms, with or without |
24 | * modification, are permitted provided that the following conditions | 24 | * modification, are permitted provided that the following conditions |
25 | * are met: | 25 | * are met: |
@@ -34,10 +34,10 @@ | |||
34 | * Eric Young (eay@cryptsoft.com)" | 34 | * Eric Young (eay@cryptsoft.com)" |
35 | * The word 'cryptographic' can be left out if the rouines from the library | 35 | * The word 'cryptographic' can be left out if the rouines from the library |
36 | * being used are not cryptographic related :-). | 36 | * being used are not cryptographic related :-). |
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | 37 | * 4. If you include any Windows specific code (or a derivative thereof) from |
38 | * the apps directory (application code) you must include an acknowledgement: | 38 | * the apps directory (application code) you must include an acknowledgement: |
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" |
40 | * | 40 | * |
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND |
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
@@ -49,7 +49,7 @@ | |||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
51 | * SUCH DAMAGE. | 51 | * SUCH DAMAGE. |
52 | * | 52 | * |
53 | * The licence and distribution terms for any publically available version or | 53 | * The licence and distribution terms for any publically available version or |
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be |
55 | * copied and put under another distribution licence | 55 | * copied and put under another distribution licence |
@@ -61,18 +61,20 @@ | |||
61 | #include <openssl/ripemd.h> | 61 | #include <openssl/ripemd.h> |
62 | #include <openssl/crypto.h> | 62 | #include <openssl/crypto.h> |
63 | 63 | ||
64 | unsigned char *RIPEMD160(const unsigned char *d, size_t n, | 64 | unsigned char * |
65 | unsigned char *md) | 65 | RIPEMD160(const unsigned char *d, size_t n, |
66 | { | 66 | unsigned char *md) |
67 | { | ||
67 | RIPEMD160_CTX c; | 68 | RIPEMD160_CTX c; |
68 | static unsigned char m[RIPEMD160_DIGEST_LENGTH]; | 69 | static unsigned char m[RIPEMD160_DIGEST_LENGTH]; |
69 | 70 | ||
70 | if (md == NULL) md=m; | 71 | if (md == NULL) |
72 | md = m; | ||
71 | if (!RIPEMD160_Init(&c)) | 73 | if (!RIPEMD160_Init(&c)) |
72 | return NULL; | 74 | return NULL; |
73 | RIPEMD160_Update(&c,d,n); | 75 | RIPEMD160_Update(&c, d, n); |
74 | RIPEMD160_Final(md,&c); | 76 | RIPEMD160_Final(md, &c); |
75 | explicit_bzero(&c,sizeof(c)); | 77 | explicit_bzero(&c, sizeof(c)); |
76 | return(md); | 78 | return (md); |
77 | } | 79 | } |
78 | 80 | ||
diff --git a/src/lib/libcrypto/ripemd/rmdconst.h b/src/lib/libcrypto/ripemd/rmdconst.h index f34047f4ff..7d703da77d 100644 --- a/src/lib/libcrypto/ripemd/rmdconst.h +++ b/src/lib/libcrypto/ripemd/rmdconst.h | |||
@@ -1,25 +1,25 @@ | |||
1 | /* $OpenBSD: rmdconst.h,v 1.3 2016/12/21 15:49:29 jsing Exp $ */ | 1 | /* $OpenBSD: rmdconst.h,v 1.4 2023/07/08 06:52:56 jsing 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 | * |
5 | * This package is an SSL implementation written | 5 | * This package is an SSL implementation written |
6 | * by Eric Young (eay@cryptsoft.com). | 6 | * by Eric Young (eay@cryptsoft.com). |
7 | * The implementation was written so as to conform with Netscapes SSL. | 7 | * The implementation was written so as to conform with Netscapes SSL. |
8 | * | 8 | * |
9 | * This library is free for commercial and non-commercial use as long as | 9 | * This library is free for commercial and non-commercial use as long as |
10 | * the following conditions are aheared to. The following conditions | 10 | * the following conditions are aheared to. The following conditions |
11 | * apply to all code found in this distribution, be it the RC4, RSA, | 11 | * apply to all code found in this distribution, be it the RC4, RSA, |
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | 12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation |
13 | * included with this distribution is covered by the same copyright terms | 13 | * included with this distribution is covered by the same copyright terms |
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | 14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). |
15 | * | 15 | * |
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | 16 | * Copyright remains Eric Young's, and as such any Copyright notices in |
17 | * the code are not to be removed. | 17 | * the code are not to be removed. |
18 | * If this package is used in a product, Eric Young should be given attribution | 18 | * If this package is used in a product, Eric Young should be given attribution |
19 | * as the author of the parts of the library used. | 19 | * as the author of the parts of the library used. |
20 | * This can be in the form of a textual message at program startup or | 20 | * This can be in the form of a textual message at program startup or |
21 | * in documentation (online or textual) provided with the package. | 21 | * in documentation (online or textual) provided with the package. |
22 | * | 22 | * |
23 | * Redistribution and use in source and binary forms, with or without | 23 | * Redistribution and use in source and binary forms, with or without |
24 | * modification, are permitted provided that the following conditions | 24 | * modification, are permitted provided that the following conditions |
25 | * are met: | 25 | * are met: |
@@ -34,10 +34,10 @@ | |||
34 | * Eric Young (eay@cryptsoft.com)" | 34 | * Eric Young (eay@cryptsoft.com)" |
35 | * The word 'cryptographic' can be left out if the rouines from the library | 35 | * The word 'cryptographic' can be left out if the rouines from the library |
36 | * being used are not cryptographic related :-). | 36 | * being used are not cryptographic related :-). |
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | 37 | * 4. If you include any Windows specific code (or a derivative thereof) from |
38 | * the apps directory (application code) you must include an acknowledgement: | 38 | * the apps directory (application code) you must include an acknowledgement: |
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | 39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" |
40 | * | 40 | * |
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | 41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND |
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
@@ -49,7 +49,7 @@ | |||
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
51 | * SUCH DAMAGE. | 51 | * SUCH DAMAGE. |
52 | * | 52 | * |
53 | * The licence and distribution terms for any publically available version or | 53 | * The licence and distribution terms for any publically available version or |
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | 54 | * derivative of this code cannot be changed. i.e. this code cannot simply be |
55 | * copied and put under another distribution licence | 55 | * copied and put under another distribution licence |