diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/whrlpool/whirlpool.c | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/whrlpool/whrlpool.h | 9 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libcrypto/whrlpool/whirlpool.c b/src/lib/libcrypto/whrlpool/whirlpool.c index e1e0f7a899..80e147c3b5 100644 --- a/src/lib/libcrypto/whrlpool/whirlpool.c +++ b/src/lib/libcrypto/whrlpool/whirlpool.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: whirlpool.c,v 1.2 2024/03/30 03:45:47 joshua Exp $ */ | 1 | /* $OpenBSD: whirlpool.c,v 1.3 2024/06/01 07:36:17 tb Exp $ */ |
2 | /** | 2 | /** |
3 | * The Whirlpool hashing function. | 3 | * The Whirlpool hashing function. |
4 | * | 4 | * |
@@ -846,10 +846,7 @@ unsigned char * | |||
846 | WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md) | 846 | WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md) |
847 | { | 847 | { |
848 | WHIRLPOOL_CTX ctx; | 848 | WHIRLPOOL_CTX ctx; |
849 | static unsigned char m[WHIRLPOOL_DIGEST_LENGTH]; | ||
850 | 849 | ||
851 | if (md == NULL) | ||
852 | md = m; | ||
853 | WHIRLPOOL_Init(&ctx); | 850 | WHIRLPOOL_Init(&ctx); |
854 | WHIRLPOOL_Update(&ctx, inp, bytes); | 851 | WHIRLPOOL_Update(&ctx, inp, bytes); |
855 | WHIRLPOOL_Final(md, &ctx); | 852 | WHIRLPOOL_Final(md, &ctx); |
diff --git a/src/lib/libcrypto/whrlpool/whrlpool.h b/src/lib/libcrypto/whrlpool/whrlpool.h index 875d34f7d3..1b4fac1993 100644 --- a/src/lib/libcrypto/whrlpool/whrlpool.h +++ b/src/lib/libcrypto/whrlpool/whrlpool.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: whrlpool.h,v 1.5 2014/07/10 22:45:58 jsing Exp $ */ | 1 | /* $OpenBSD: whrlpool.h,v 1.6 2024/06/01 07:36:17 tb Exp $ */ |
2 | 2 | ||
3 | #include <stddef.h> | 3 | #include <stddef.h> |
4 | 4 | ||
@@ -28,10 +28,13 @@ typedef struct { | |||
28 | 28 | ||
29 | #ifndef OPENSSL_NO_WHIRLPOOL | 29 | #ifndef OPENSSL_NO_WHIRLPOOL |
30 | int WHIRLPOOL_Init (WHIRLPOOL_CTX *c); | 30 | int WHIRLPOOL_Init (WHIRLPOOL_CTX *c); |
31 | int WHIRLPOOL_Update (WHIRLPOOL_CTX *c,const void *inp,size_t bytes); | 31 | int WHIRLPOOL_Update (WHIRLPOOL_CTX *c,const void *inp,size_t bytes) |
32 | __attribute__ ((__bounded__(__buffer__, 2, 3))); | ||
32 | void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c,const void *inp,size_t bits); | 33 | void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c,const void *inp,size_t bits); |
33 | int WHIRLPOOL_Final (unsigned char *md,WHIRLPOOL_CTX *c); | 34 | int WHIRLPOOL_Final (unsigned char *md,WHIRLPOOL_CTX *c); |
34 | unsigned char *WHIRLPOOL(const void *inp,size_t bytes,unsigned char *md); | 35 | unsigned char *WHIRLPOOL(const void *inp,size_t bytes,unsigned char *md) |
36 | __attribute__ ((__nonnull__(3))) | ||
37 | __attribute__ ((__bounded__(__buffer__, 1, 2))); | ||
35 | #endif | 38 | #endif |
36 | 39 | ||
37 | #ifdef __cplusplus | 40 | #ifdef __cplusplus |