| 1 |
// Copyright (C) 1995-1998 Eric Young ([email protected]) All rights reserved. |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
#ifndef OPENSSL_HEADER_RIPEMD_H |
| 5 |
#define OPENSSL_HEADER_RIPEMD_H |
| 6 |
|
| 7 |
#include <openssl/base.h> |
| 8 |
|
| 9 |
#ifdef __cplusplus |
| 10 |
extern "C" { |
| 11 |
#endif |
| 12 |
|
| 13 |
|
| 14 |
# define RIPEMD160_CBLOCK 64 |
| 15 |
# define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4) |
| 16 |
# define RIPEMD160_DIGEST_LENGTH 20 |
| 17 |
|
| 18 |
struct RIPEMD160state_st { |
| 19 |
uint32_t h[5]; |
| 20 |
uint32_t Nl, Nh; |
| 21 |
uint8_t data[RIPEMD160_CBLOCK]; |
| 22 |
unsigned num; |
| 23 |
}; |
| 24 |
|
| 25 |
// RIPEMD160_Init initialises |ctx| and returns one. |
| 26 |
OPENSSL_EXPORT int RIPEMD160_Init(RIPEMD160_CTX *ctx); |
| 27 |
|
| 28 |
// RIPEMD160_Update adds |len| bytes from |data| to |ctx| and returns one. |
| 29 |
OPENSSL_EXPORT int RIPEMD160_Update(RIPEMD160_CTX *ctx, const void *data, |
| 30 |
size_t len); |
| 31 |
|
| 32 |
// RIPEMD160_Final adds the final padding to |ctx| and writes the resulting |
| 33 |
// digest to |out|, which must have at least |RIPEMD160_DIGEST_LENGTH| bytes of |
| 34 |
// space. It returns one. |
| 35 |
OPENSSL_EXPORT int RIPEMD160_Final(uint8_t out[RIPEMD160_DIGEST_LENGTH], |
| 36 |
RIPEMD160_CTX *ctx); |
| 37 |
|
| 38 |
// RIPEMD160 writes the digest of |len| bytes from |data| to |out| and returns |
| 39 |
// |out|. There must be at least |RIPEMD160_DIGEST_LENGTH| bytes of space in |
| 40 |
// |out|. |
| 41 |
OPENSSL_EXPORT uint8_t *RIPEMD160(const uint8_t *data, size_t len, |
| 42 |
uint8_t out[RIPEMD160_DIGEST_LENGTH]); |
| 43 |
|
| 44 |
#if defined(__cplusplus) |
| 45 |
} // extern C |
| 46 |
#endif |
| 47 |
|
| 48 |
#endif // OPENSSL_HEADER_RIPEMD_H |