mbed TLS v3.1.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
24 #include "mbedtls/private_access.h"
25 
26 #include "mbedtls/build_info.h"
27 
28 #include <stddef.h>
29 #include <stdint.h>
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #if !defined(MBEDTLS_RIPEMD160_ALT)
36 // Regular implementation
37 //
38 
42 typedef struct mbedtls_ripemd160_context
43 {
44  uint32_t MBEDTLS_PRIVATE(total)[2];
45  uint32_t MBEDTLS_PRIVATE(state)[5];
46  unsigned char MBEDTLS_PRIVATE(buffer)[64];
47 }
48 mbedtls_ripemd160_context;
49 
50 #else /* MBEDTLS_RIPEMD160_ALT */
51 #include "ripemd160_alt.h"
52 #endif /* MBEDTLS_RIPEMD160_ALT */
53 
59 void mbedtls_ripemd160_init( mbedtls_ripemd160_context *ctx );
60 
66 void mbedtls_ripemd160_free( mbedtls_ripemd160_context *ctx );
67 
74 void mbedtls_ripemd160_clone( mbedtls_ripemd160_context *dst,
75  const mbedtls_ripemd160_context *src );
76 
84 int mbedtls_ripemd160_starts( mbedtls_ripemd160_context *ctx );
85 
95 int mbedtls_ripemd160_update( mbedtls_ripemd160_context *ctx,
96  const unsigned char *input,
97  size_t ilen );
98 
107 int mbedtls_ripemd160_finish( mbedtls_ripemd160_context *ctx,
108  unsigned char output[20] );
109 
118 int mbedtls_internal_ripemd160_process( mbedtls_ripemd160_context *ctx,
119  const unsigned char data[64] );
120 
130 int mbedtls_ripemd160( const unsigned char *input,
131  size_t ilen,
132  unsigned char output[20] );
133 
134 #if defined(MBEDTLS_SELF_TEST)
135 
141 int mbedtls_ripemd160_self_test( int verbose );
142 
143 #endif /* MBEDTLS_SELF_TEST */
144 
145 #ifdef __cplusplus
146 }
147 #endif
148 
149 #endif /* mbedtls_ripemd160.h */
int mbedtls_ripemd160_self_test(int verbose)
Checkup routine.
#define MBEDTLS_PRIVATE(member)
int mbedtls_ripemd160_finish(mbedtls_ripemd160_context *ctx, unsigned char output[20])
RIPEMD-160 final digest.
void mbedtls_ripemd160_free(mbedtls_ripemd160_context *ctx)
Clear 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)
Macro wrapper for struct's memebrs.
Build-time configuration info.
int mbedtls_ripemd160_update(mbedtls_ripemd160_context *ctx, const unsigned char *input, size_t ilen)
RIPEMD-160 process buffer.
int mbedtls_ripemd160_starts(mbedtls_ripemd160_context *ctx)
RIPEMD-160 context setup.
void mbedtls_ripemd160_clone(mbedtls_ripemd160_context *dst, const mbedtls_ripemd160_context *src)
Clone (the state of) an RIPEMD-160 context.
void mbedtls_ripemd160_init(mbedtls_ripemd160_context *ctx)
Initialize RIPEMD-160 context.
int mbedtls_ripemd160(const unsigned char *input, size_t ilen, unsigned char output[20])
Output = RIPEMD-160( input buffer )