diff options
Diffstat (limited to 'src/lib/libcrypto/sha/sha1.c')
-rw-r--r-- | src/lib/libcrypto/sha/sha1.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/lib/libcrypto/sha/sha1.c b/src/lib/libcrypto/sha/sha1.c index 52338812db..ab05709818 100644 --- a/src/lib/libcrypto/sha/sha1.c +++ b/src/lib/libcrypto/sha/sha1.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sha1.c,v 1.15 2024/06/01 07:36:16 tb Exp $ */ | 1 | /* $OpenBSD: sha1.c,v 1.16 2025/02/14 12:01:58 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 | * |
@@ -71,11 +71,10 @@ | |||
71 | /* Ensure that SHA_LONG and uint32_t are equivalent sizes. */ | 71 | /* Ensure that SHA_LONG and uint32_t are equivalent sizes. */ |
72 | CTASSERT(sizeof(SHA_LONG) == sizeof(uint32_t)); | 72 | CTASSERT(sizeof(SHA_LONG) == sizeof(uint32_t)); |
73 | 73 | ||
74 | #ifdef SHA1_ASM | ||
75 | void sha1_block_data_order(SHA_CTX *ctx, const void *p, size_t num); | 74 | void sha1_block_data_order(SHA_CTX *ctx, const void *p, size_t num); |
76 | #endif | 75 | void sha1_block_generic(SHA_CTX *ctx, const void *p, size_t num); |
77 | 76 | ||
78 | #ifndef SHA1_ASM | 77 | #ifndef HAVE_SHA1_BLOCK_GENERIC |
79 | static inline SHA_LONG | 78 | static inline SHA_LONG |
80 | Ch(SHA_LONG x, SHA_LONG y, SHA_LONG z) | 79 | Ch(SHA_LONG x, SHA_LONG y, SHA_LONG z) |
81 | { | 80 | { |
@@ -164,8 +163,8 @@ sha1_round4(SHA_LONG *a, SHA_LONG *b, SHA_LONG *c, SHA_LONG *d, SHA_LONG *e, | |||
164 | *a = T; | 163 | *a = T; |
165 | } | 164 | } |
166 | 165 | ||
167 | static void | 166 | void |
168 | sha1_block_data_order(SHA_CTX *ctx, const void *_in, size_t num) | 167 | sha1_block_generic(SHA_CTX *ctx, const void *_in, size_t num) |
169 | { | 168 | { |
170 | const uint8_t *in = _in; | 169 | const uint8_t *in = _in; |
171 | const SHA_LONG *in32; | 170 | const SHA_LONG *in32; |
@@ -382,6 +381,14 @@ sha1_block_data_order(SHA_CTX *ctx, const void *_in, size_t num) | |||
382 | } | 381 | } |
383 | #endif | 382 | #endif |
384 | 383 | ||
384 | #ifndef HAVE_SHA1_BLOCK_DATA_ORDER | ||
385 | void | ||
386 | sha1_block_data_order(SHA_CTX *ctx, const void *_in, size_t num) | ||
387 | { | ||
388 | sha1_block_generic(ctx, _in, num); | ||
389 | } | ||
390 | #endif | ||
391 | |||
385 | int | 392 | int |
386 | SHA1_Init(SHA_CTX *c) | 393 | SHA1_Init(SHA_CTX *c) |
387 | { | 394 | { |