Mbed TLS v3.5.0
ripemd160.h
Go to the documentation of this file.
1
6/*
7 * Copyright The Mbed TLS Contributors
8 * SPDX-License-Identifier: Apache-2.0
9 *
10 * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 * not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
13 *
14 * http://www.apache.org/licenses/LICENSE-2.0
15 *
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 */
22#ifndef MBEDTLS_RIPEMD160_H
23#define MBEDTLS_RIPEMD160_H
25
26#include "mbedtls/build_info.h"
27
28#include <stddef.h>
29#include <stdint.h>
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#if !defined(MBEDTLS_RIPEMD160_ALT)
36// Regular implementation
37//
38
43 uint32_t MBEDTLS_PRIVATE(total)[2];
44 uint32_t MBEDTLS_PRIVATE(state)[5];
45 unsigned char MBEDTLS_PRIVATE(buffer)[64];
46}
48
49#else /* MBEDTLS_RIPEMD160_ALT */
50#include "ripemd160_alt.h"
51#endif /* MBEDTLS_RIPEMD160_ALT */
52
59
66
74 const mbedtls_ripemd160_context *src);
75
84
95 const unsigned char *input,
96 size_t ilen);
97
107 unsigned char output[20]);
108
118 const unsigned char data[64]);
119
129int mbedtls_ripemd160(const unsigned char *input,
130 size_t ilen,
131 unsigned char output[20]);
132
133#if defined(MBEDTLS_SELF_TEST)
134
141
142#endif /* MBEDTLS_SELF_TEST */
143
144#ifdef __cplusplus
145}
146#endif
147
148#endif /* mbedtls_ripemd160.h */
Build-time configuration info.
Macro wrapper for struct's members.
#define MBEDTLS_PRIVATE(member)
int mbedtls_ripemd160_starts(mbedtls_ripemd160_context *ctx)
RIPEMD-160 context setup.
int mbedtls_ripemd160_update(mbedtls_ripemd160_context *ctx, const unsigned char *input, size_t ilen)
RIPEMD-160 process buffer.
int mbedtls_ripemd160_self_test(int verbose)
Checkup routine.
void mbedtls_ripemd160_clone(mbedtls_ripemd160_context *dst, const mbedtls_ripemd160_context *src)
Clone (the state of) a RIPEMD-160 context.
void mbedtls_ripemd160_init(mbedtls_ripemd160_context *ctx)
Initialize RIPEMD-160 context.
int mbedtls_internal_ripemd160_process(mbedtls_ripemd160_context *ctx, const unsigned char data[64])
RIPEMD-160 process data block (internal use only)
struct mbedtls_ripemd160_context mbedtls_ripemd160_context
RIPEMD-160 context structure.
void mbedtls_ripemd160_free(mbedtls_ripemd160_context *ctx)
Clear RIPEMD-160 context.
int mbedtls_ripemd160(const unsigned char *input, size_t ilen, unsigned char output[20])
Output = RIPEMD-160( input buffer )
int mbedtls_ripemd160_finish(mbedtls_ripemd160_context *ctx, unsigned char output[20])
RIPEMD-160 final digest.
RIPEMD-160 context structure.
Definition: ripemd160.h:42