mbed TLS v2.16.7
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 OR GPL-2.0-or-later
13  *
14  * This file is provided under the Apache License 2.0, or the
15  * GNU General Public License v2.0 or later.
16  *
17  * **********
18  * Apache License 2.0:
19  *
20  * Licensed under the Apache License, Version 2.0 (the "License"); you may
21  * not use this file except in compliance with the License.
22  * You may obtain a copy of the License at
23  *
24  * http://www.apache.org/licenses/LICENSE-2.0
25  *
26  * Unless required by applicable law or agreed to in writing, software
27  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
28  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29  * See the License for the specific language governing permissions and
30  * limitations under the License.
31  *
32  * **********
33  *
34  * **********
35  * GNU General Public License v2.0 or later:
36  *
37  * This program is free software; you can redistribute it and/or modify
38  * it under the terms of the GNU General Public License as published by
39  * the Free Software Foundation; either version 2 of the License, or
40  * (at your option) any later version.
41  *
42  * This program is distributed in the hope that it will be useful,
43  * but WITHOUT ANY WARRANTY; without even the implied warranty of
44  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45  * GNU General Public License for more details.
46  *
47  * You should have received a copy of the GNU General Public License along
48  * with this program; if not, write to the Free Software Foundation, Inc.,
49  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
50  *
51  * **********
52  *
53  * This file is part of mbed TLS (https://tls.mbed.org)
54  *
55  */
56 #ifndef MBEDTLS_MD2_H
57 #define MBEDTLS_MD2_H
58 
59 #if !defined(MBEDTLS_CONFIG_FILE)
60 #include "config.h"
61 #else
62 #include MBEDTLS_CONFIG_FILE
63 #endif
64 
65 #include <stddef.h>
66 
67 /* MBEDTLS_ERR_MD2_HW_ACCEL_FAILED is deprecated and should not be used. */
68 #define MBEDTLS_ERR_MD2_HW_ACCEL_FAILED -0x002B
70 #ifdef __cplusplus
71 extern "C" {
72 #endif
73 
74 #if !defined(MBEDTLS_MD2_ALT)
75 // Regular implementation
76 //
77 
86 typedef struct mbedtls_md2_context
87 {
88  unsigned char cksum[16];
89  unsigned char state[48];
90  unsigned char buffer[16];
91  size_t left;
92 }
94 
95 #else /* MBEDTLS_MD2_ALT */
96 #include "md2_alt.h"
97 #endif /* MBEDTLS_MD2_ALT */
98 
110 
122 
135  const mbedtls_md2_context *src );
136 
150 
166  const unsigned char *input,
167  size_t ilen );
168 
183  unsigned char output[16] );
184 
198 
199 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
200 #if defined(MBEDTLS_DEPRECATED_WARNING)
201 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
202 #else
203 #define MBEDTLS_DEPRECATED
204 #endif
205 
218 
234  const unsigned char *input,
235  size_t ilen );
236 
251  unsigned char output[16] );
252 
266 
267 #undef MBEDTLS_DEPRECATED
268 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
269 
282 int mbedtls_md2_ret( const unsigned char *input,
283  size_t ilen,
284  unsigned char output[16] );
285 
286 #if !defined(MBEDTLS_DEPRECATED_REMOVED)
287 #if defined(MBEDTLS_DEPRECATED_WARNING)
288 #define MBEDTLS_DEPRECATED __attribute__((deprecated))
289 #else
290 #define MBEDTLS_DEPRECATED
291 #endif
292 
306 MBEDTLS_DEPRECATED void mbedtls_md2( const unsigned char *input,
307  size_t ilen,
308  unsigned char output[16] );
309 
310 #undef MBEDTLS_DEPRECATED
311 #endif /* !MBEDTLS_DEPRECATED_REMOVED */
312 
313 #if defined(MBEDTLS_SELF_TEST)
314 
325 int mbedtls_md2_self_test( int verbose );
326 
327 #endif /* MBEDTLS_SELF_TEST */
328 
329 #ifdef __cplusplus
330 }
331 #endif
332 
333 #endif /* mbedtls_md2.h */
MBEDTLS_DEPRECATED void mbedtls_md2(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD2( input buffer )
size_t left
Definition: md2.h:91
MBEDTLS_DEPRECATED void mbedtls_md2_starts(mbedtls_md2_context *ctx)
MD2 context setup.
unsigned char cksum[16]
Definition: md2.h:88
int mbedtls_md2_update_ret(mbedtls_md2_context *ctx, const unsigned char *input, size_t ilen)
MD2 process buffer.
Configuration options (set of defines)
MBEDTLS_DEPRECATED void mbedtls_md2_update(mbedtls_md2_context *ctx, const unsigned char *input, size_t ilen)
MD2 process buffer.
int mbedtls_md2_self_test(int verbose)
Checkup routine.
void mbedtls_md2_init(mbedtls_md2_context *ctx)
Initialize MD2 context.
MBEDTLS_DEPRECATED void mbedtls_md2_finish(mbedtls_md2_context *ctx, unsigned char output[16])
MD2 final digest.
int mbedtls_internal_md2_process(mbedtls_md2_context *ctx)
MD2 process data block (internal use only)
int mbedtls_md2_ret(const unsigned char *input, size_t ilen, unsigned char output[16])
Output = MD2( input buffer )
unsigned char buffer[16]
Definition: md2.h:90
void mbedtls_md2_clone(mbedtls_md2_context *dst, const mbedtls_md2_context *src)
Clone (the state of) an MD2 context.
struct mbedtls_md2_context mbedtls_md2_context
MD2 context structure.
int mbedtls_md2_finish_ret(mbedtls_md2_context *ctx, unsigned char output[16])
MD2 final digest.
unsigned char state[48]
Definition: md2.h:89
int mbedtls_md2_starts_ret(mbedtls_md2_context *ctx)
MD2 context setup.
#define MBEDTLS_DEPRECATED
Definition: md2.h:290
MD2 context structure.
Definition: md2.h:86
MBEDTLS_DEPRECATED void mbedtls_md2_process(mbedtls_md2_context *ctx)
MD2 process data block (internal use only)
void mbedtls_md2_free(mbedtls_md2_context *ctx)
Clear MD2 context.