Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 1 | /** |
Simon Butcher | 5b331b9 | 2016-01-03 16:14:14 +0000 | [diff] [blame] | 2 | * \file md2.h |
Paul Bakker | e0ccd0a | 2009-01-04 16:27:10 +0000 | [diff] [blame] | 3 | * |
Paul Bakker | 37ca75d | 2011-01-06 12:28:03 +0000 | [diff] [blame] | 4 | * \brief MD2 message digest algorithm (hash function) |
Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 5 | * |
| 6 | * \warning MD2 is considered a weak message digest and its use constitutes a |
| 7 | * security risk. We recommend considering stronger message digests |
| 8 | * instead. |
Darryl Green | a40a101 | 2018-01-05 15:33:17 +0000 | [diff] [blame] | 9 | */ |
| 10 | /* |
Manuel Pégourié-Gonnard | 6fb8187 | 2015-07-27 11:11:48 +0200 | [diff] [blame] | 11 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved |
Manuel Pégourié-Gonnard | 37ff140 | 2015-09-04 14:21:07 +0200 | [diff] [blame] | 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. |
Paul Bakker | b96f154 | 2010-07-18 20:36:00 +0000 | [diff] [blame] | 25 | * |
Manuel Pégourié-Gonnard | fe44643 | 2015-03-06 13:17:10 +0000 | [diff] [blame] | 26 | * This file is part of mbed TLS (https://tls.mbed.org) |
Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 27 | * |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 28 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 29 | #ifndef MBEDTLS_MD2_H |
| 30 | #define MBEDTLS_MD2_H |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 31 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 32 | #if !defined(MBEDTLS_CONFIG_FILE) |
Paul Bakker | 90995b5 | 2013-06-24 19:20:35 +0200 | [diff] [blame] | 33 | #include "config.h" |
Manuel Pégourié-Gonnard | cef4ad2 | 2014-04-29 12:39:06 +0200 | [diff] [blame] | 34 | #else |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 35 | #include MBEDTLS_CONFIG_FILE |
Manuel Pégourié-Gonnard | cef4ad2 | 2014-04-29 12:39:06 +0200 | [diff] [blame] | 36 | #endif |
Paul Bakker | 90995b5 | 2013-06-24 19:20:35 +0200 | [diff] [blame] | 37 | |
Rich Evans | 00ab470 | 2015-02-06 13:43:58 +0000 | [diff] [blame] | 38 | #include <stddef.h> |
Paul Bakker | 23986e5 | 2011-04-24 08:57:21 +0000 | [diff] [blame] | 39 | |
Gilles Peskine | a381fe8 | 2018-01-23 18:16:11 +0100 | [diff] [blame] | 40 | #define MBEDTLS_ERR_MD2_HW_ACCEL_FAILED -0x002B /**< MD2 hardware accelerator failed */ |
| 41 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 42 | #if !defined(MBEDTLS_MD2_ALT) |
Paul Bakker | 90995b5 | 2013-06-24 19:20:35 +0200 | [diff] [blame] | 43 | // Regular implementation |
| 44 | // |
| 45 | |
Paul Bakker | 407a0da | 2013-06-27 14:29:21 +0200 | [diff] [blame] | 46 | #ifdef __cplusplus |
| 47 | extern "C" { |
| 48 | #endif |
| 49 | |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 50 | /** |
| 51 | * \brief MD2 context structure |
Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 52 | * |
| 53 | * \warning MD2 is considered a weak message digest and its use |
| 54 | * constitutes a security risk. We recommend considering |
| 55 | * stronger message digests instead. |
| 56 | * |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 57 | */ |
| 58 | typedef struct |
| 59 | { |
| 60 | unsigned char cksum[16]; /*!< checksum of the data block */ |
| 61 | unsigned char state[48]; /*!< intermediate digest state */ |
| 62 | unsigned char buffer[16]; /*!< data block being processed */ |
Paul Bakker | 23986e5 | 2011-04-24 08:57:21 +0000 | [diff] [blame] | 63 | size_t left; /*!< amount of data in buffer */ |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 64 | } |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 65 | mbedtls_md2_context; |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 66 | |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 67 | /** |
Paul Bakker | 5b4af39 | 2014-06-26 12:09:34 +0200 | [diff] [blame] | 68 | * \brief Initialize MD2 context |
| 69 | * |
| 70 | * \param ctx MD2 context to be initialized |
Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 71 | * |
| 72 | * \warning MD2 is considered a weak message digest and its use |
| 73 | * constitutes a security risk. We recommend considering |
| 74 | * stronger message digests instead. |
| 75 | * |
Paul Bakker | 5b4af39 | 2014-06-26 12:09:34 +0200 | [diff] [blame] | 76 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 77 | void mbedtls_md2_init( mbedtls_md2_context *ctx ); |
Paul Bakker | 5b4af39 | 2014-06-26 12:09:34 +0200 | [diff] [blame] | 78 | |
| 79 | /** |
| 80 | * \brief Clear MD2 context |
| 81 | * |
| 82 | * \param ctx MD2 context to be cleared |
Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 83 | * |
| 84 | * \warning MD2 is considered a weak message digest and its use |
| 85 | * constitutes a security risk. We recommend considering |
| 86 | * stronger message digests instead. |
| 87 | * |
Paul Bakker | 5b4af39 | 2014-06-26 12:09:34 +0200 | [diff] [blame] | 88 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 89 | void mbedtls_md2_free( mbedtls_md2_context *ctx ); |
Paul Bakker | 5b4af39 | 2014-06-26 12:09:34 +0200 | [diff] [blame] | 90 | |
| 91 | /** |
Manuel Pégourié-Gonnard | 16d412f | 2015-07-06 15:26:26 +0200 | [diff] [blame] | 92 | * \brief Clone (the state of) an MD2 context |
| 93 | * |
| 94 | * \param dst The destination context |
| 95 | * \param src The context to be cloned |
Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 96 | * |
| 97 | * \warning MD2 is considered a weak message digest and its use |
| 98 | * constitutes a security risk. We recommend considering |
| 99 | * stronger message digests instead. |
| 100 | * |
Manuel Pégourié-Gonnard | 16d412f | 2015-07-06 15:26:26 +0200 | [diff] [blame] | 101 | */ |
| 102 | void mbedtls_md2_clone( mbedtls_md2_context *dst, |
| 103 | const mbedtls_md2_context *src ); |
| 104 | |
| 105 | /** |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 106 | * \brief MD2 context setup |
| 107 | * |
| 108 | * \param ctx context to be initialized |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 109 | * |
| 110 | * \return 0 if successful |
Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 111 | * |
| 112 | * \warning MD2 is considered a weak message digest and its use |
| 113 | * constitutes a security risk. We recommend considering |
| 114 | * stronger message digests instead. |
| 115 | * |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 116 | */ |
Gilles Peskine | 9e4f77c | 2018-01-22 11:48:08 +0100 | [diff] [blame] | 117 | int mbedtls_md2_starts_ret( mbedtls_md2_context *ctx ); |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 118 | |
| 119 | /** |
| 120 | * \brief MD2 process buffer |
| 121 | * |
| 122 | * \param ctx MD2 context |
Andres Amaya Garcia | a21247e | 2017-07-20 14:01:08 +0100 | [diff] [blame] | 123 | * \param input buffer holding the data |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 124 | * \param ilen length of the input data |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 125 | * |
| 126 | * \return 0 if successful |
Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 127 | * |
| 128 | * \warning MD2 is considered a weak message digest and its use |
| 129 | * constitutes a security risk. We recommend considering |
| 130 | * stronger message digests instead. |
| 131 | * |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 132 | */ |
Gilles Peskine | 9e4f77c | 2018-01-22 11:48:08 +0100 | [diff] [blame] | 133 | int mbedtls_md2_update_ret( mbedtls_md2_context *ctx, |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 134 | const unsigned char *input, |
| 135 | size_t ilen ); |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 136 | |
| 137 | /** |
| 138 | * \brief MD2 final digest |
| 139 | * |
| 140 | * \param ctx MD2 context |
| 141 | * \param output MD2 checksum result |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 142 | * |
| 143 | * \return 0 if successful |
Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 144 | * |
| 145 | * \warning MD2 is considered a weak message digest and its use |
| 146 | * constitutes a security risk. We recommend considering |
| 147 | * stronger message digests instead. |
| 148 | * |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 149 | */ |
Gilles Peskine | 9e4f77c | 2018-01-22 11:48:08 +0100 | [diff] [blame] | 150 | int mbedtls_md2_finish_ret( mbedtls_md2_context *ctx, |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 151 | unsigned char output[16] ); |
| 152 | |
| 153 | /** |
| 154 | * \brief MD2 process data block (internal use only) |
| 155 | * |
| 156 | * \param ctx MD2 context |
| 157 | * |
| 158 | * \return 0 if successful |
Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 159 | * |
| 160 | * \warning MD2 is considered a weak message digest and its use |
| 161 | * constitutes a security risk. We recommend considering |
| 162 | * stronger message digests instead. |
| 163 | * |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 164 | */ |
Andres Amaya Garcia | cccfe08 | 2017-06-28 10:36:39 +0100 | [diff] [blame] | 165 | int mbedtls_internal_md2_process( mbedtls_md2_context *ctx ); |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 166 | |
| 167 | #if !defined(MBEDTLS_DEPRECATED_REMOVED) |
| 168 | #if defined(MBEDTLS_DEPRECATED_WARNING) |
| 169 | #define MBEDTLS_DEPRECATED __attribute__((deprecated)) |
| 170 | #else |
| 171 | #define MBEDTLS_DEPRECATED |
| 172 | #endif |
| 173 | /** |
| 174 | * \brief MD2 context setup |
| 175 | * |
Gilles Peskine | 3e28d70 | 2018-01-22 12:18:59 +0100 | [diff] [blame] | 176 | * \deprecated Superseded by mbedtls_md2_starts_ret() in 2.7.0 |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 177 | * |
| 178 | * \param ctx context to be initialized |
Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 179 | * |
| 180 | * \warning MD2 is considered a weak message digest and its use |
| 181 | * constitutes a security risk. We recommend considering |
| 182 | * stronger message digests instead. |
| 183 | * |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 184 | */ |
Jaeden Amero | 041039f | 2018-02-19 15:28:08 +0000 | [diff] [blame] | 185 | MBEDTLS_DEPRECATED void mbedtls_md2_starts( mbedtls_md2_context *ctx ); |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 186 | |
| 187 | /** |
| 188 | * \brief MD2 process buffer |
| 189 | * |
Gilles Peskine | 3e28d70 | 2018-01-22 12:18:59 +0100 | [diff] [blame] | 190 | * \deprecated Superseded by mbedtls_md2_update_ret() in 2.7.0 |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 191 | * |
| 192 | * \param ctx MD2 context |
Andres Amaya Garcia | a21247e | 2017-07-20 14:01:08 +0100 | [diff] [blame] | 193 | * \param input buffer holding the data |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 194 | * \param ilen length of the input data |
Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 195 | * |
| 196 | * \warning MD2 is considered a weak message digest and its use |
| 197 | * constitutes a security risk. We recommend considering |
| 198 | * stronger message digests instead. |
| 199 | * |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 200 | */ |
Jaeden Amero | 041039f | 2018-02-19 15:28:08 +0000 | [diff] [blame] | 201 | MBEDTLS_DEPRECATED void mbedtls_md2_update( mbedtls_md2_context *ctx, |
| 202 | const unsigned char *input, |
| 203 | size_t ilen ); |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 204 | |
| 205 | /** |
| 206 | * \brief MD2 final digest |
| 207 | * |
Gilles Peskine | 3e28d70 | 2018-01-22 12:18:59 +0100 | [diff] [blame] | 208 | * \deprecated Superseded by mbedtls_md2_finish_ret() in 2.7.0 |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 209 | * |
| 210 | * \param ctx MD2 context |
| 211 | * \param output MD2 checksum result |
Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 212 | * |
| 213 | * \warning MD2 is considered a weak message digest and its use |
| 214 | * constitutes a security risk. We recommend considering |
| 215 | * stronger message digests instead. |
| 216 | * |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 217 | */ |
Jaeden Amero | 041039f | 2018-02-19 15:28:08 +0000 | [diff] [blame] | 218 | MBEDTLS_DEPRECATED void mbedtls_md2_finish( mbedtls_md2_context *ctx, |
| 219 | unsigned char output[16] ); |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 220 | |
| 221 | /** |
| 222 | * \brief MD2 process data block (internal use only) |
| 223 | * |
Gilles Peskine | 3e28d70 | 2018-01-22 12:18:59 +0100 | [diff] [blame] | 224 | * \deprecated Superseded by mbedtls_internal_md2_process() in 2.7.0 |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 225 | * |
| 226 | * \param ctx MD2 context |
Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 227 | * |
| 228 | * \warning MD2 is considered a weak message digest and its use |
| 229 | * constitutes a security risk. We recommend considering |
| 230 | * stronger message digests instead. |
| 231 | * |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 232 | */ |
Jaeden Amero | 041039f | 2018-02-19 15:28:08 +0000 | [diff] [blame] | 233 | MBEDTLS_DEPRECATED void mbedtls_md2_process( mbedtls_md2_context *ctx ); |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 234 | |
| 235 | #undef MBEDTLS_DEPRECATED |
| 236 | #endif /* !MBEDTLS_DEPRECATED_REMOVED */ |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 237 | |
Paul Bakker | 90995b5 | 2013-06-24 19:20:35 +0200 | [diff] [blame] | 238 | #ifdef __cplusplus |
| 239 | } |
| 240 | #endif |
| 241 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 242 | #else /* MBEDTLS_MD2_ALT */ |
Paul Bakker | 90995b5 | 2013-06-24 19:20:35 +0200 | [diff] [blame] | 243 | #include "md2_alt.h" |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 244 | #endif /* MBEDTLS_MD2_ALT */ |
Paul Bakker | 90995b5 | 2013-06-24 19:20:35 +0200 | [diff] [blame] | 245 | |
| 246 | #ifdef __cplusplus |
| 247 | extern "C" { |
| 248 | #endif |
| 249 | |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 250 | /** |
| 251 | * \brief Output = MD2( input buffer ) |
| 252 | * |
Andres Amaya Garcia | a21247e | 2017-07-20 14:01:08 +0100 | [diff] [blame] | 253 | * \param input buffer holding the data |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 254 | * \param ilen length of the input data |
| 255 | * \param output MD2 checksum result |
Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 256 | * |
| 257 | * \warning MD2 is considered a weak message digest and its use |
| 258 | * constitutes a security risk. We recommend considering |
| 259 | * stronger message digests instead. |
| 260 | * |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 261 | */ |
Gilles Peskine | 9e4f77c | 2018-01-22 11:48:08 +0100 | [diff] [blame] | 262 | int mbedtls_md2_ret( const unsigned char *input, |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 263 | size_t ilen, |
| 264 | unsigned char output[16] ); |
| 265 | |
| 266 | #if !defined(MBEDTLS_DEPRECATED_REMOVED) |
| 267 | #if defined(MBEDTLS_DEPRECATED_WARNING) |
| 268 | #define MBEDTLS_DEPRECATED __attribute__((deprecated)) |
| 269 | #else |
| 270 | #define MBEDTLS_DEPRECATED |
| 271 | #endif |
| 272 | /** |
| 273 | * \brief Output = MD2( input buffer ) |
| 274 | * |
Gilles Peskine | 3e28d70 | 2018-01-22 12:18:59 +0100 | [diff] [blame] | 275 | * \deprecated Superseded by mbedtls_md2_ret() in 2.7.0 |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 276 | * |
Andres Amaya Garcia | a21247e | 2017-07-20 14:01:08 +0100 | [diff] [blame] | 277 | * \param input buffer holding the data |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 278 | * \param ilen length of the input data |
| 279 | * \param output MD2 checksum result |
Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 280 | * |
| 281 | * \warning MD2 is considered a weak message digest and its use |
| 282 | * constitutes a security risk. We recommend considering |
| 283 | * stronger message digests instead. |
| 284 | * |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 285 | */ |
Jaeden Amero | 041039f | 2018-02-19 15:28:08 +0000 | [diff] [blame] | 286 | MBEDTLS_DEPRECATED void mbedtls_md2( const unsigned char *input, |
| 287 | size_t ilen, |
| 288 | unsigned char output[16] ); |
Andres Amaya Garcia | 1d85213 | 2017-04-28 16:21:40 +0100 | [diff] [blame] | 289 | |
| 290 | #undef MBEDTLS_DEPRECATED |
| 291 | #endif /* !MBEDTLS_DEPRECATED_REMOVED */ |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 292 | |
| 293 | /** |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 294 | * \brief Checkup routine |
| 295 | * |
| 296 | * \return 0 if successful, or 1 if the test failed |
Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 297 | * |
| 298 | * \warning MD2 is considered a weak message digest and its use |
| 299 | * constitutes a security risk. We recommend considering |
| 300 | * stronger message digests instead. |
| 301 | * |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 302 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 303 | int mbedtls_md2_self_test( int verbose ); |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 304 | |
Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 305 | #ifdef __cplusplus |
| 306 | } |
| 307 | #endif |
| 308 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 309 | #endif /* mbedtls_md2.h */ |