| 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 md4.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 MD4 message digest algorithm (hash function) | 
| Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 5 | * | 
|  | 6 | * \warning MD4 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_MD4_H | 
|  | 30 | #define MBEDTLS_MD4_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> | 
| Manuel Pégourié-Gonnard | ab22910 | 2015-04-15 11:53:16 +0200 | [diff] [blame] | 39 | #include <stdint.h> | 
| Paul Bakker | 5c2364c | 2012-10-01 14:41:15 +0000 | [diff] [blame] | 40 |  | 
| Gilles Peskine | a381fe8 | 2018-01-23 18:16:11 +0100 | [diff] [blame] | 41 | #define MBEDTLS_ERR_MD4_HW_ACCEL_FAILED                   -0x002D  /**< MD4 hardware accelerator failed */ | 
|  | 42 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 43 | #if !defined(MBEDTLS_MD4_ALT) | 
| Paul Bakker | 90995b5 | 2013-06-24 19:20:35 +0200 | [diff] [blame] | 44 | // Regular implementation | 
|  | 45 | // | 
|  | 46 |  | 
| Paul Bakker | 407a0da | 2013-06-27 14:29:21 +0200 | [diff] [blame] | 47 | #ifdef __cplusplus | 
|  | 48 | extern "C" { | 
|  | 49 | #endif | 
|  | 50 |  | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 51 | /** | 
|  | 52 | * \brief          MD4 context structure | 
| Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 53 | * | 
|  | 54 | * \warning        MD4 is considered a weak message digest and its use | 
|  | 55 | *                 constitutes a security risk. We recommend considering | 
|  | 56 | *                 stronger message digests instead. | 
|  | 57 | * | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 58 | */ | 
|  | 59 | typedef struct | 
|  | 60 | { | 
| Paul Bakker | 5c2364c | 2012-10-01 14:41:15 +0000 | [diff] [blame] | 61 | uint32_t total[2];          /*!< number of bytes processed  */ | 
|  | 62 | uint32_t state[4];          /*!< intermediate digest state  */ | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 63 | unsigned char buffer[64];   /*!< data block being processed */ | 
| 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_md4_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 MD4 context | 
|  | 69 | * | 
|  | 70 | * \param ctx      MD4 context to be initialized | 
| Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 71 | * | 
|  | 72 | * \warning        MD4 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_md4_init( mbedtls_md4_context *ctx ); | 
| Paul Bakker | 5b4af39 | 2014-06-26 12:09:34 +0200 | [diff] [blame] | 78 |  | 
|  | 79 | /** | 
|  | 80 | * \brief          Clear MD4 context | 
|  | 81 | * | 
|  | 82 | * \param ctx      MD4 context to be cleared | 
| Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 83 | * | 
|  | 84 | * \warning        MD4 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_md4_free( mbedtls_md4_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 MD4 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        MD4 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_md4_clone( mbedtls_md4_context *dst, | 
|  | 103 | const mbedtls_md4_context *src ); | 
|  | 104 |  | 
|  | 105 | /** | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 106 | * \brief          MD4 context setup | 
|  | 107 | * | 
|  | 108 | * \param ctx      context to be initialized | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 109 | * | 
|  | 110 | * \return         0 if successful | 
| Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 111 | * | 
|  | 112 | * \warning        MD4 is considered a weak message digest and its use | 
|  | 113 | *                 constitutes a security risk. We recommend considering | 
|  | 114 | *                 stronger message digests instead. | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 115 | */ | 
| Gilles Peskine | 9e4f77c | 2018-01-22 11:48:08 +0100 | [diff] [blame] | 116 | int mbedtls_md4_starts_ret( mbedtls_md4_context *ctx ); | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 117 |  | 
|  | 118 | /** | 
|  | 119 | * \brief          MD4 process buffer | 
|  | 120 | * | 
|  | 121 | * \param ctx      MD4 context | 
| Andres Amaya Garcia | a21247e | 2017-07-20 14:01:08 +0100 | [diff] [blame] | 122 | * \param input    buffer holding the data | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 123 | * \param ilen     length of the input data | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 124 | * | 
|  | 125 | * \return         0 if successful | 
| Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 126 | * | 
|  | 127 | * \warning        MD4 is considered a weak message digest and its use | 
|  | 128 | *                 constitutes a security risk. We recommend considering | 
|  | 129 | *                 stronger message digests instead. | 
|  | 130 | * | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 131 | */ | 
| Gilles Peskine | 9e4f77c | 2018-01-22 11:48:08 +0100 | [diff] [blame] | 132 | int mbedtls_md4_update_ret( mbedtls_md4_context *ctx, | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 133 | const unsigned char *input, | 
|  | 134 | size_t ilen ); | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 135 |  | 
|  | 136 | /** | 
|  | 137 | * \brief          MD4 final digest | 
|  | 138 | * | 
|  | 139 | * \param ctx      MD4 context | 
|  | 140 | * \param output   MD4 checksum result | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 141 | * | 
|  | 142 | * \return         0 if successful | 
| Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 143 | * | 
|  | 144 | * \warning        MD4 is considered a weak message digest and its use | 
|  | 145 | *                 constitutes a security risk. We recommend considering | 
|  | 146 | *                 stronger message digests instead. | 
|  | 147 | * | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 148 | */ | 
| Gilles Peskine | 9e4f77c | 2018-01-22 11:48:08 +0100 | [diff] [blame] | 149 | int mbedtls_md4_finish_ret( mbedtls_md4_context *ctx, | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 150 | unsigned char output[16] ); | 
|  | 151 |  | 
|  | 152 | /** | 
|  | 153 | * \brief          MD4 process data block (internal use only) | 
|  | 154 | * | 
|  | 155 | * \param ctx      MD4 context | 
|  | 156 | * \param data     buffer holding one block of data | 
|  | 157 | * | 
|  | 158 | * \return         0 if successful | 
| Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 159 | * | 
|  | 160 | * \warning        MD4 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 | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 164 | */ | 
| Andres Amaya Garcia | cccfe08 | 2017-06-28 10:36:39 +0100 | [diff] [blame] | 165 | int mbedtls_internal_md4_process( mbedtls_md4_context *ctx, | 
|  | 166 | const unsigned char data[64] ); | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 167 |  | 
|  | 168 | #if !defined(MBEDTLS_DEPRECATED_REMOVED) | 
|  | 169 | #if defined(MBEDTLS_DEPRECATED_WARNING) | 
|  | 170 | #define MBEDTLS_DEPRECATED      __attribute__((deprecated)) | 
|  | 171 | #else | 
|  | 172 | #define MBEDTLS_DEPRECATED | 
|  | 173 | #endif | 
|  | 174 | /** | 
|  | 175 | * \brief          MD4 context setup | 
|  | 176 | * | 
| Gilles Peskine | 3e28d70 | 2018-01-22 12:18:59 +0100 | [diff] [blame] | 177 | * \deprecated     Superseded by mbedtls_md4_starts_ret() in 2.7.0 | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 178 | * | 
|  | 179 | * \param ctx      context to be initialized | 
| Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 180 | * | 
|  | 181 | * \warning        MD4 is considered a weak message digest and its use | 
|  | 182 | *                 constitutes a security risk. We recommend considering | 
|  | 183 | *                 stronger message digests instead. | 
|  | 184 | * | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 185 | */ | 
| Jaeden Amero | 041039f | 2018-02-19 15:28:08 +0000 | [diff] [blame] | 186 | MBEDTLS_DEPRECATED void mbedtls_md4_starts( mbedtls_md4_context *ctx ); | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 187 |  | 
|  | 188 | /** | 
|  | 189 | * \brief          MD4 process buffer | 
|  | 190 | * | 
| Gilles Peskine | 3e28d70 | 2018-01-22 12:18:59 +0100 | [diff] [blame] | 191 | * \deprecated     Superseded by mbedtls_md4_update_ret() in 2.7.0 | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 192 | * | 
|  | 193 | * \param ctx      MD4 context | 
| Andres Amaya Garcia | a21247e | 2017-07-20 14:01:08 +0100 | [diff] [blame] | 194 | * \param input    buffer holding the data | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 195 | * \param ilen     length of the input data | 
| Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 196 | * | 
|  | 197 | * \warning        MD4 is considered a weak message digest and its use | 
|  | 198 | *                 constitutes a security risk. We recommend considering | 
|  | 199 | *                 stronger message digests instead. | 
|  | 200 | * | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 201 | */ | 
| Jaeden Amero | 041039f | 2018-02-19 15:28:08 +0000 | [diff] [blame] | 202 | MBEDTLS_DEPRECATED void mbedtls_md4_update( mbedtls_md4_context *ctx, | 
|  | 203 | const unsigned char *input, | 
|  | 204 | size_t ilen ); | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 205 |  | 
|  | 206 | /** | 
|  | 207 | * \brief          MD4 final digest | 
|  | 208 | * | 
| Gilles Peskine | 3e28d70 | 2018-01-22 12:18:59 +0100 | [diff] [blame] | 209 | * \deprecated     Superseded by mbedtls_md4_finish_ret() in 2.7.0 | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 210 | * | 
|  | 211 | * \param ctx      MD4 context | 
|  | 212 | * \param output   MD4 checksum result | 
| Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 213 | * | 
|  | 214 | * \warning        MD4 is considered a weak message digest and its use | 
|  | 215 | *                 constitutes a security risk. We recommend considering | 
|  | 216 | *                 stronger message digests instead. | 
|  | 217 | * | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 218 | */ | 
| Jaeden Amero | 041039f | 2018-02-19 15:28:08 +0000 | [diff] [blame] | 219 | MBEDTLS_DEPRECATED void mbedtls_md4_finish( mbedtls_md4_context *ctx, | 
|  | 220 | unsigned char output[16] ); | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 221 |  | 
|  | 222 | /** | 
|  | 223 | * \brief          MD4 process data block (internal use only) | 
|  | 224 | * | 
| Gilles Peskine | 3e28d70 | 2018-01-22 12:18:59 +0100 | [diff] [blame] | 225 | * \deprecated     Superseded by mbedtls_internal_md4_process() in 2.7.0 | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 226 | * | 
|  | 227 | * \param ctx      MD4 context | 
|  | 228 | * \param data     buffer holding one block of data | 
| Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 229 | * | 
|  | 230 | * \warning        MD4 is considered a weak message digest and its use | 
|  | 231 | *                 constitutes a security risk. We recommend considering | 
|  | 232 | *                 stronger message digests instead. | 
|  | 233 | * | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 234 | */ | 
| Jaeden Amero | 041039f | 2018-02-19 15:28:08 +0000 | [diff] [blame] | 235 | MBEDTLS_DEPRECATED void mbedtls_md4_process( mbedtls_md4_context *ctx, | 
|  | 236 | const unsigned char data[64] ); | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 237 |  | 
|  | 238 | #undef MBEDTLS_DEPRECATED | 
|  | 239 | #endif /* !MBEDTLS_DEPRECATED_REMOVED */ | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 240 |  | 
| Paul Bakker | 90995b5 | 2013-06-24 19:20:35 +0200 | [diff] [blame] | 241 | #ifdef __cplusplus | 
|  | 242 | } | 
|  | 243 | #endif | 
|  | 244 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 245 | #else  /* MBEDTLS_MD4_ALT */ | 
| Paul Bakker | 90995b5 | 2013-06-24 19:20:35 +0200 | [diff] [blame] | 246 | #include "md4_alt.h" | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 247 | #endif /* MBEDTLS_MD4_ALT */ | 
| Paul Bakker | 90995b5 | 2013-06-24 19:20:35 +0200 | [diff] [blame] | 248 |  | 
|  | 249 | #ifdef __cplusplus | 
|  | 250 | extern "C" { | 
|  | 251 | #endif | 
|  | 252 |  | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 253 | /** | 
|  | 254 | * \brief          Output = MD4( input buffer ) | 
|  | 255 | * | 
| Andres Amaya Garcia | a21247e | 2017-07-20 14:01:08 +0100 | [diff] [blame] | 256 | * \param input    buffer holding the data | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 257 | * \param ilen     length of the input data | 
|  | 258 | * \param output   MD4 checksum result | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 259 | * | 
|  | 260 | * \return         0 if successful | 
| Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 261 | * | 
|  | 262 | * \warning        MD4 is considered a weak message digest and its use | 
|  | 263 | *                 constitutes a security risk. We recommend considering | 
|  | 264 | *                 stronger message digests instead. | 
|  | 265 | * | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 266 | */ | 
| Gilles Peskine | 9e4f77c | 2018-01-22 11:48:08 +0100 | [diff] [blame] | 267 | int mbedtls_md4_ret( const unsigned char *input, | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 268 | size_t ilen, | 
|  | 269 | unsigned char output[16] ); | 
|  | 270 |  | 
|  | 271 | #if !defined(MBEDTLS_DEPRECATED_REMOVED) | 
|  | 272 | #if defined(MBEDTLS_DEPRECATED_WARNING) | 
|  | 273 | #define MBEDTLS_DEPRECATED      __attribute__((deprecated)) | 
|  | 274 | #else | 
|  | 275 | #define MBEDTLS_DEPRECATED | 
|  | 276 | #endif | 
|  | 277 | /** | 
|  | 278 | * \brief          Output = MD4( input buffer ) | 
|  | 279 | * | 
| Gilles Peskine | 3e28d70 | 2018-01-22 12:18:59 +0100 | [diff] [blame] | 280 | * \deprecated     Superseded by mbedtls_md4_ret() in 2.7.0 | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 281 | * | 
| Andres Amaya Garcia | a21247e | 2017-07-20 14:01:08 +0100 | [diff] [blame] | 282 | * \param input    buffer holding the data | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 283 | * \param ilen     length of the input data | 
|  | 284 | * \param output   MD4 checksum result | 
| Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 285 | * | 
|  | 286 | * \warning        MD4 is considered a weak message digest and its use | 
|  | 287 | *                 constitutes a security risk. We recommend considering | 
|  | 288 | *                 stronger message digests instead. | 
|  | 289 | * | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 290 | */ | 
| Jaeden Amero | 041039f | 2018-02-19 15:28:08 +0000 | [diff] [blame] | 291 | MBEDTLS_DEPRECATED void mbedtls_md4( const unsigned char *input, | 
|  | 292 | size_t ilen, | 
|  | 293 | unsigned char output[16] ); | 
| Andres Amaya Garcia | bee0635 | 2017-04-28 17:00:30 +0100 | [diff] [blame] | 294 |  | 
|  | 295 | #undef MBEDTLS_DEPRECATED | 
|  | 296 | #endif /* !MBEDTLS_DEPRECATED_REMOVED */ | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 297 |  | 
|  | 298 | /** | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 299 | * \brief          Checkup routine | 
|  | 300 | * | 
|  | 301 | * \return         0 if successful, or 1 if the test failed | 
| Hanno Becker | bbca8c5 | 2017-09-25 14:53:51 +0100 | [diff] [blame] | 302 | * | 
|  | 303 | * \warning        MD4 is considered a weak message digest and its use | 
|  | 304 | *                 constitutes a security risk. We recommend considering | 
|  | 305 | *                 stronger message digests instead. | 
|  | 306 | * | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 307 | */ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 308 | int mbedtls_md4_self_test( int verbose ); | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 309 |  | 
| Paul Bakker | 5121ce5 | 2009-01-03 21:22:43 +0000 | [diff] [blame] | 310 | #ifdef __cplusplus | 
|  | 311 | } | 
|  | 312 | #endif | 
|  | 313 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 314 | #endif /* mbedtls_md4.h */ |