mbed TLS v2.16.0: md2.h Source File

mbed TLS v2.16.0

md2.h
Go to the documentation of this file.
1
10 /*
11 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
12 * SPDX-License-Identifier: Apache-2.0
13 *
14 * Licensed under the Apache License, Version 2.0 (the "License"); you may
15 * not use this file except in compliance with the License.
16 * You may obtain a copy of the License at
17 *
18 * http://www.apache.org/licenses/LICENSE-2.0
19 *
20 * Unless required by applicable law or agreed to in writing, software
21 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
22 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 * See the License for the specific language governing permissions and
24 * limitations under the License.
25 *
26 * This file is part of mbed TLS (https://tls.mbed.org)
27 *
28 */
29 #ifndef MBEDTLS_MD2_H
30 #define MBEDTLS_MD2_H
31
32 #if !defined(MBEDTLS_CONFIG_FILE)
33 #include "config.h"
34 #else
35 #include MBEDTLS_CONFIG_FILE
36 #endif
37
38 #include <stddef.h>
39
40 /* MBEDTLS_ERR_MD2_HW_ACCEL_FAILED is deprecated and should not be used. */
41 #define MBEDTLS_ERR_MD2_HW_ACCEL_FAILED -0x002B
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46
47 #if !defined(MBEDTLS_MD2_ALT)
48 // Regular implementation
49 //
50
59 typedef struct mbedtls_md2_context
60 {
61 unsigned char cksum[16];
62 unsigned char state[48];
63 unsigned char buffer[16];
64 size_t left;
65 }
66 mbedtls_md2_context;
67
68 #else /* MBEDTLS_MD2_ALT */
69 #include "md2_alt.h"
70 #endif /* MBEDTLS_MD2_ALT */
71
82 void mbedtls_md2_init( mbedtls_md2_context *ctx );
83
94 void mbedtls_md2_free( mbedtls_md2_context *ctx );
95
107 void mbedtls_md2_clone( mbedtls_md2_context *dst,
108 const mbedtls_md2_context *src );
109
122 int mbedtls_md2_starts_ret( mbedtls_md2_context *ctx );
123
138 int mbedtls_md2_update_ret( mbedtls_md2_context *ctx,
139 const unsigned char *input,
140 size_t ilen );
141
155 int mbedtls_md2_finish_ret( mbedtls_md2_context *ctx,
156 unsigned char output[16] );
157
170 int mbedtls_internal_md2_process( mbedtls_md2_context *ctx );
171
172 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
173 #if defined(MBEDTLS_DEPRECATED_WARNING)
174 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
175 #else
176 #define MBEDTLS_DEPRECATED
177 #endif
178
190 MBEDTLS_DEPRECATED void mbedtls_md2_starts( mbedtls_md2_context *ctx );
191
206 MBEDTLS_DEPRECATED void mbedtls_md2_update( mbedtls_md2_context *ctx,
207 const unsigned char *input,
208 size_t ilen );
209
223 MBEDTLS_DEPRECATED void mbedtls_md2_finish( mbedtls_md2_context *ctx,
224 unsigned char output[16] );
225
238 MBEDTLS_DEPRECATED void mbedtls_md2_process( mbedtls_md2_context *ctx );
239
240 #undef MBEDTLS_DEPRECATED
241 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
242
255 int mbedtls_md2_ret( const unsigned char *input,
256 size_t ilen,
257 unsigned char output[16] );
258
259 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
260 #if defined(MBEDTLS_DEPRECATED_WARNING)
261 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
262 #else
263 #define MBEDTLS_DEPRECATED
264 #endif
265
279 MBEDTLS_DEPRECATED void mbedtls_md2( const unsigned char *input,
280 size_t ilen,
281 unsigned char output[16] );
282
283 #undef MBEDTLS_DEPRECATED
284 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
285
296 int mbedtls_md2_self_test( int verbose );
297
298 #ifdef __cplusplus
299 }
300 #endif
301
302 #endif /* mbedtls_md2.h */
mbedtls_md2
MBEDTLS_DEPRECATED void mbedtls_md2(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD2( input buffer )
mbedtls_md2_context::left
size_t left
Definition: md2.h:64
mbedtls_md2_starts
MBEDTLS_DEPRECATED void mbedtls_md2_starts(mbedtls_md2_context *ctx)
MD2 context setup.
mbedtls_md2_context::cksum
unsigned char cksum[16]
Definition: md2.h:61
mbedtls_md2_update_ret
int mbedtls_md2_update_ret(mbedtls_md2_context *ctx, const unsigned char *input, size_t ilen)
MD2 process buffer.
config.h
Configuration options (set of defines)
mbedtls_md2_update
MBEDTLS_DEPRECATED void mbedtls_md2_update(mbedtls_md2_context *ctx, const unsigned char *input, size_t ilen)
MD2 process buffer.
mbedtls_md2_self_test
int mbedtls_md2_self_test(int verbose)
Checkup routine.
mbedtls_md2_init
void mbedtls_md2_init(mbedtls_md2_context *ctx)
Initialize MD2 context.
mbedtls_md2_finish
MBEDTLS_DEPRECATED void mbedtls_md2_finish(mbedtls_md2_context *ctx, unsigned char output[16])
MD2 final digest.
mbedtls_internal_md2_process
int mbedtls_internal_md2_process(mbedtls_md2_context *ctx)
MD2 process data block (internal use only)
mbedtls_md2_ret
int mbedtls_md2_ret(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD2( input buffer )
mbedtls_md2_context::buffer
unsigned char buffer[16]
Definition: md2.h:63
mbedtls_md2_clone
void mbedtls_md2_clone(mbedtls_md2_context *dst, const mbedtls_md2_context *src)
Clone (the state of) an MD2 context.
mbedtls_md2_context
struct mbedtls_md2_context mbedtls_md2_context
MD2 context structure.
mbedtls_md2_finish_ret
int mbedtls_md2_finish_ret(mbedtls_md2_context *ctx, unsigned char output[16])
MD2 final digest.
mbedtls_md2_context::state
unsigned char state[48]
Definition: md2.h:62
mbedtls_md2_starts_ret
int mbedtls_md2_starts_ret(mbedtls_md2_context *ctx)
MD2 context setup.
MBEDTLS_DEPRECATED
#define MBEDTLS_DEPRECATED
Definition: md2.h:263
mbedtls_md2_context
MD2 context structure.
Definition: md2.h:59
mbedtls_md2_process
MBEDTLS_DEPRECATED void mbedtls_md2_process(mbedtls_md2_context *ctx)
MD2 process data block (internal use only)
mbedtls_md2_free
void mbedtls_md2_free(mbedtls_md2_context *ctx)
Clear MD2 context.