mbed TLS v2.7.0
ripemd160.h
Go to the documentation of this file.
1 
6 /*
7  * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
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  * This file is part of mbed TLS (https://tls.mbed.org)
23  */
24 #ifndef MBEDTLS_RIPEMD160_H
25 #define MBEDTLS_RIPEMD160_H
26 
27 #if !defined(MBEDTLS_CONFIG_FILE)
28 #include "config.h"
29 #else
30 #include MBEDTLS_CONFIG_FILE
31 #endif
32 
33 #include <stddef.h>
34 #include <stdint.h>
35 
36 #define MBEDTLS_ERR_RIPEMD160_HW_ACCEL_FAILED -0x0031
38 #if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
39  !defined(inline) && !defined(__cplusplus)
40 #define inline __inline
41 #endif
42 
43 #if !defined(MBEDTLS_RIPEMD160_ALT)
44 // Regular implementation
45 //
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
54 typedef struct
55 {
56  uint32_t total[2];
57  uint32_t state[5];
58  unsigned char buffer[64];
59 }
61 
68 
75 
83  const mbedtls_ripemd160_context *src );
84 
93 
104  const unsigned char *input,
105  size_t ilen );
106 
116  unsigned char output[20] );
117 
127  const unsigned char data[64] );
128 
129 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
130 #if defined(MBEDTLS_DEPRECATED_WARNING)
131 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
132 #else
133 #define MBEDTLS_DEPRECATED
134 #endif
135 
144 {
146 }
147 
159  const unsigned char *input,
160  size_t ilen )
161 {
162  mbedtls_ripemd160_update_ret( ctx, input, ilen );
163 }
164 
175  unsigned char output[20] )
176 {
177  mbedtls_ripemd160_finish_ret( ctx, output );
178 }
179 
190  const unsigned char data[64] )
191 {
193 }
194 
195 #undef MBEDTLS_DEPRECATED
196 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
197 
198 #ifdef __cplusplus
199 }
200 #endif
201 
202 #else /* MBEDTLS_RIPEMD160_ALT */
203 #include "ripemd160_alt.h"
204 #endif /* MBEDTLS_RIPEMD160_ALT */
205 
206 #ifdef __cplusplus
207 extern "C" {
208 #endif
209 
219 int mbedtls_ripemd160_ret( const unsigned char *input,
220  size_t ilen,
221  unsigned char output[20] );
222 
223 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
224 #if defined(MBEDTLS_DEPRECATED_WARNING)
225 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
226 #else
227 #define MBEDTLS_DEPRECATED
228 #endif
229 
239  const unsigned char *input,
240  size_t ilen,
241  unsigned char output[20] )
242 {
243  mbedtls_ripemd160_ret( input, ilen, output );
244 }
245 
246 #undef MBEDTLS_DEPRECATED
247 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
248 
254 int mbedtls_ripemd160_self_test( int verbose );
255 
256 #ifdef __cplusplus
257 }
258 #endif
259 
260 #endif /* mbedtls_ripemd160.h */
int mbedtls_ripemd160_self_test(int verbose)
Checkup routine.
static MBEDTLS_DEPRECATED void mbedtls_ripemd160_finish(mbedtls_ripemd160_context *ctx, unsigned char output[20])
RIPEMD-160 final digest.
Definition: ripemd160.h:173
int mbedtls_ripemd160_ret(const unsigned char *input, size_t ilen, unsigned char output[20])
Output = RIPEMD-160( input buffer )
Configuration options (set of defines)
int mbedtls_ripemd160_update_ret(mbedtls_ripemd160_context *ctx, const unsigned char *input, size_t ilen)
RIPEMD-160 process buffer.
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)
#define MBEDTLS_DEPRECATED
Definition: ripemd160.h:225
int mbedtls_ripemd160_finish_ret(mbedtls_ripemd160_context *ctx, unsigned char output[20])
RIPEMD-160 final digest.
static MBEDTLS_DEPRECATED void mbedtls_ripemd160_update(mbedtls_ripemd160_context *ctx, const unsigned char *input, size_t ilen)
RIPEMD-160 process buffer.
Definition: ripemd160.h:157
static MBEDTLS_DEPRECATED void mbedtls_ripemd160_process(mbedtls_ripemd160_context *ctx, const unsigned char data[64])
RIPEMD-160 process data block (internal use only)
Definition: ripemd160.h:188
RIPEMD-160 context structure.
Definition: ripemd160.h:54
static MBEDTLS_DEPRECATED void mbedtls_ripemd160_starts(mbedtls_ripemd160_context *ctx)
RIPEMD-160 context setup.
Definition: ripemd160.h:142
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_starts_ret(mbedtls_ripemd160_context *ctx)
RIPEMD-160 context setup.
static MBEDTLS_DEPRECATED void mbedtls_ripemd160(const unsigned char *input, size_t ilen, unsigned char output[20])
Output = RIPEMD-160( input buffer )
Definition: ripemd160.h:238