blob: 5debba1e95eba171fa4c4c34ad8398905e303380 [file] [log] [blame]
Paul Bakker5121ce52009-01-03 21:22:43 +00001/**
2 * \file des.h
Paul Bakkere0ccd0a2009-01-04 16:27:10 +00003 *
Paul Bakkerf3b86c12011-01-27 15:24:17 +00004 * \brief DES block cipher
Hanno Beckerbbca8c52017-09-25 14:53:51 +01005 *
6 * \warning DES is considered a weak cipher and its use constitutes a
7 * security risk. We recommend considering stronger ciphers
8 * instead.
Darryl Greena40a1012018-01-05 15:33:17 +00009 */
10/*
Manuel Pégourié-Gonnard6fb81872015-07-27 11:11:48 +020011 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
Manuel Pégourié-Gonnard37ff1402015-09-04 14:21:07 +020012 * 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 Bakkerb96f1542010-07-18 20:36:00 +000025 *
Manuel Pégourié-Gonnardfe446432015-03-06 13:17:10 +000026 * This file is part of mbed TLS (https://tls.mbed.org)
Hanno Beckerbbca8c52017-09-25 14:53:51 +010027 *
Paul Bakker5121ce52009-01-03 21:22:43 +000028 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020029#ifndef MBEDTLS_DES_H
30#define MBEDTLS_DES_H
Paul Bakker5121ce52009-01-03 21:22:43 +000031
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020032#if !defined(MBEDTLS_CONFIG_FILE)
Jaeden Amero203fdf72019-07-04 20:01:14 +010033#include "mbedtls/config.h"
Manuel Pégourié-Gonnardcef4ad22014-04-29 12:39:06 +020034#else
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020035#include MBEDTLS_CONFIG_FILE
Manuel Pégourié-Gonnardcef4ad22014-04-29 12:39:06 +020036#endif
Paul Bakker90995b52013-06-24 19:20:35 +020037
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +010038#include "mbedtls/platform_util.h"
Rich Evans00ab4702015-02-06 13:43:58 +000039#include <stddef.h>
Manuel Pégourié-Gonnardab229102015-04-15 11:53:16 +020040#include <stdint.h>
Paul Bakker5c2364c2012-10-01 14:41:15 +000041
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020042#define MBEDTLS_DES_ENCRYPT 1
43#define MBEDTLS_DES_DECRYPT 0
Paul Bakker5121ce52009-01-03 21:22:43 +000044
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020045#define MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH -0x0032 /**< The data input has an invalid length. */
Ron Eldor9924bdc2018-10-04 10:59:13 +030046
47/* MBEDTLS_ERR_DES_HW_ACCEL_FAILED is deprecated and should not be used. */
Gilles Peskine7ecab3d2018-01-26 17:56:38 +010048#define MBEDTLS_ERR_DES_HW_ACCEL_FAILED -0x0033 /**< DES hardware accelerator failed. */
Paul Bakkerf3ccc682010-03-18 21:21:02 +000049
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020050#define MBEDTLS_DES_KEY_SIZE 8
Paul Bakker1f87fb62011-01-15 17:32:24 +000051
Paul Bakker407a0da2013-06-27 14:29:21 +020052#ifdef __cplusplus
53extern "C" {
54#endif
55
Ron Eldorb2aacec2017-05-18 16:53:08 +030056#if !defined(MBEDTLS_DES_ALT)
57// Regular implementation
58//
59
Paul Bakker5121ce52009-01-03 21:22:43 +000060/**
61 * \brief DES context structure
Hanno Beckerbbca8c52017-09-25 14:53:51 +010062 *
63 * \warning DES is considered a weak cipher and its use constitutes a
64 * security risk. We recommend considering stronger ciphers
65 * instead.
Paul Bakker5121ce52009-01-03 21:22:43 +000066 */
Dawid Drozd428cc522018-07-24 10:02:47 +020067typedef struct mbedtls_des_context
Paul Bakker5121ce52009-01-03 21:22:43 +000068{
Paul Bakker5c2364c2012-10-01 14:41:15 +000069 uint32_t sk[32]; /*!< DES subkeys */
Paul Bakker5121ce52009-01-03 21:22:43 +000070}
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020071mbedtls_des_context;
Paul Bakker5121ce52009-01-03 21:22:43 +000072
73/**
74 * \brief Triple-DES context structure
75 */
Dawid Drozd428cc522018-07-24 10:02:47 +020076typedef struct mbedtls_des3_context
Paul Bakker5121ce52009-01-03 21:22:43 +000077{
Paul Bakker5c2364c2012-10-01 14:41:15 +000078 uint32_t sk[96]; /*!< 3DES subkeys */
Paul Bakker5121ce52009-01-03 21:22:43 +000079}
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020080mbedtls_des3_context;
Paul Bakker5121ce52009-01-03 21:22:43 +000081
Ron Eldor05d0e512018-04-16 17:40:04 +030082#else /* MBEDTLS_DES_ALT */
83#include "des_alt.h"
84#endif /* MBEDTLS_DES_ALT */
85
Paul Bakker5121ce52009-01-03 21:22:43 +000086/**
Paul Bakkerc7ea99a2014-06-18 11:12:03 +020087 * \brief Initialize DES context
88 *
89 * \param ctx DES context to be initialized
Hanno Beckerbbca8c52017-09-25 14:53:51 +010090 *
91 * \warning DES is considered a weak cipher and its use constitutes a
92 * security risk. We recommend considering stronger ciphers
93 * instead.
Paul Bakkerc7ea99a2014-06-18 11:12:03 +020094 */
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +010095MBEDTLS_DEPRECATED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020096void mbedtls_des_init( mbedtls_des_context *ctx );
Paul Bakkerc7ea99a2014-06-18 11:12:03 +020097
98/**
99 * \brief Clear DES context
100 *
101 * \param ctx DES context to be cleared
Hanno Beckerbbca8c52017-09-25 14:53:51 +0100102 *
103 * \warning DES is considered a weak cipher and its use constitutes a
104 * security risk. We recommend considering stronger ciphers
105 * instead.
Paul Bakkerc7ea99a2014-06-18 11:12:03 +0200106 */
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +0100107MBEDTLS_DEPRECATED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200108void mbedtls_des_free( mbedtls_des_context *ctx );
Paul Bakkerc7ea99a2014-06-18 11:12:03 +0200109
110/**
111 * \brief Initialize Triple-DES context
112 *
113 * \param ctx DES3 context to be initialized
114 */
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +0100115MBEDTLS_DEPRECATED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200116void mbedtls_des3_init( mbedtls_des3_context *ctx );
Paul Bakkerc7ea99a2014-06-18 11:12:03 +0200117
118/**
119 * \brief Clear Triple-DES context
120 *
121 * \param ctx DES3 context to be cleared
122 */
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +0100123MBEDTLS_DEPRECATED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200124void mbedtls_des3_free( mbedtls_des3_context *ctx );
Paul Bakkerc7ea99a2014-06-18 11:12:03 +0200125
126/**
Paul Bakker1f87fb62011-01-15 17:32:24 +0000127 * \brief Set key parity on the given key to odd.
128 *
129 * DES keys are 56 bits long, but each byte is padded with
130 * a parity bit to allow verification.
131 *
132 * \param key 8-byte secret key
Hanno Beckerbbca8c52017-09-25 14:53:51 +0100133 *
134 * \warning DES is considered a weak cipher and its use constitutes a
135 * security risk. We recommend considering stronger ciphers
136 * instead.
Paul Bakker1f87fb62011-01-15 17:32:24 +0000137 */
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +0100138MBEDTLS_DEPRECATED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200139void mbedtls_des_key_set_parity( unsigned char key[MBEDTLS_DES_KEY_SIZE] );
Paul Bakker1f87fb62011-01-15 17:32:24 +0000140
141/**
142 * \brief Check that key parity on the given key is odd.
143 *
144 * DES keys are 56 bits long, but each byte is padded with
145 * a parity bit to allow verification.
146 *
147 * \param key 8-byte secret key
Paul Bakker73206952011-07-06 14:37:33 +0000148 *
149 * \return 0 is parity was ok, 1 if parity was not correct.
Hanno Beckerbbca8c52017-09-25 14:53:51 +0100150 *
151 * \warning DES is considered a weak cipher and its use constitutes a
152 * security risk. We recommend considering stronger ciphers
153 * instead.
Paul Bakker1f87fb62011-01-15 17:32:24 +0000154 */
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +0100155MBEDTLS_DEPRECATED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200156int mbedtls_des_key_check_key_parity( const unsigned char key[MBEDTLS_DES_KEY_SIZE] );
Paul Bakker1f87fb62011-01-15 17:32:24 +0000157
Paul Bakker1f87fb62011-01-15 17:32:24 +0000158/**
159 * \brief Check that key is not a weak or semi-weak DES key
160 *
161 * \param key 8-byte secret key
Paul Bakker73206952011-07-06 14:37:33 +0000162 *
Paul Bakker4793cc42011-08-17 09:40:55 +0000163 * \return 0 if no weak key was found, 1 if a weak key was identified.
Hanno Beckerbbca8c52017-09-25 14:53:51 +0100164 *
165 * \warning DES is considered a weak cipher and its use constitutes a
166 * security risk. We recommend considering stronger ciphers
167 * instead.
Paul Bakker1f87fb62011-01-15 17:32:24 +0000168 */
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +0100169MBEDTLS_DEPRECATED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200170int mbedtls_des_key_check_weak( const unsigned char key[MBEDTLS_DES_KEY_SIZE] );
Paul Bakker1f87fb62011-01-15 17:32:24 +0000171
172/**
Paul Bakker5121ce52009-01-03 21:22:43 +0000173 * \brief DES key schedule (56-bit, encryption)
174 *
175 * \param ctx DES context to be initialized
176 * \param key 8-byte secret key
Paul Bakker8123e9d2011-01-06 15:37:30 +0000177 *
178 * \return 0
Hanno Beckerbbca8c52017-09-25 14:53:51 +0100179 *
180 * \warning DES is considered a weak cipher and its use constitutes a
181 * security risk. We recommend considering stronger ciphers
182 * instead.
Paul Bakker5121ce52009-01-03 21:22:43 +0000183 */
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +0100184MBEDTLS_DEPRECATED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200185int mbedtls_des_setkey_enc( mbedtls_des_context *ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE] );
Paul Bakker5121ce52009-01-03 21:22:43 +0000186
187/**
188 * \brief DES key schedule (56-bit, decryption)
189 *
190 * \param ctx DES context to be initialized
191 * \param key 8-byte secret key
Paul Bakker8123e9d2011-01-06 15:37:30 +0000192 *
193 * \return 0
Hanno Beckerbbca8c52017-09-25 14:53:51 +0100194 *
195 * \warning DES is considered a weak cipher and its use constitutes a
196 * security risk. We recommend considering stronger ciphers
197 * instead.
Paul Bakker5121ce52009-01-03 21:22:43 +0000198 */
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +0100199MBEDTLS_DEPRECATED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200200int mbedtls_des_setkey_dec( mbedtls_des_context *ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE] );
Paul Bakker5121ce52009-01-03 21:22:43 +0000201
202/**
203 * \brief Triple-DES key schedule (112-bit, encryption)
204 *
205 * \param ctx 3DES context to be initialized
206 * \param key 16-byte secret key
Paul Bakker8123e9d2011-01-06 15:37:30 +0000207 *
208 * \return 0
Paul Bakker5121ce52009-01-03 21:22:43 +0000209 */
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +0100210MBEDTLS_DEPRECATED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200211int mbedtls_des3_set2key_enc( mbedtls_des3_context *ctx,
212 const unsigned char key[MBEDTLS_DES_KEY_SIZE * 2] );
Paul Bakker5121ce52009-01-03 21:22:43 +0000213
214/**
215 * \brief Triple-DES key schedule (112-bit, decryption)
216 *
217 * \param ctx 3DES context to be initialized
218 * \param key 16-byte secret key
Paul Bakker8123e9d2011-01-06 15:37:30 +0000219 *
220 * \return 0
Paul Bakker5121ce52009-01-03 21:22:43 +0000221 */
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +0100222MBEDTLS_DEPRECATED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200223int mbedtls_des3_set2key_dec( mbedtls_des3_context *ctx,
224 const unsigned char key[MBEDTLS_DES_KEY_SIZE * 2] );
Paul Bakker5121ce52009-01-03 21:22:43 +0000225
226/**
227 * \brief Triple-DES key schedule (168-bit, encryption)
228 *
229 * \param ctx 3DES context to be initialized
230 * \param key 24-byte secret key
Paul Bakker8123e9d2011-01-06 15:37:30 +0000231 *
232 * \return 0
Paul Bakker5121ce52009-01-03 21:22:43 +0000233 */
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +0100234MBEDTLS_DEPRECATED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200235int mbedtls_des3_set3key_enc( mbedtls_des3_context *ctx,
236 const unsigned char key[MBEDTLS_DES_KEY_SIZE * 3] );
Paul Bakker5121ce52009-01-03 21:22:43 +0000237
238/**
239 * \brief Triple-DES key schedule (168-bit, decryption)
240 *
241 * \param ctx 3DES context to be initialized
242 * \param key 24-byte secret key
Paul Bakker8123e9d2011-01-06 15:37:30 +0000243 *
244 * \return 0
Paul Bakker5121ce52009-01-03 21:22:43 +0000245 */
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +0100246MBEDTLS_DEPRECATED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200247int mbedtls_des3_set3key_dec( mbedtls_des3_context *ctx,
248 const unsigned char key[MBEDTLS_DES_KEY_SIZE * 3] );
Paul Bakker5121ce52009-01-03 21:22:43 +0000249
250/**
251 * \brief DES-ECB block encryption/decryption
252 *
253 * \param ctx DES context
254 * \param input 64-bit input block
255 * \param output 64-bit output block
Paul Bakkerf3ccc682010-03-18 21:21:02 +0000256 *
Paul Bakker27caa8a2010-03-21 15:43:59 +0000257 * \return 0 if successful
Hanno Beckerbbca8c52017-09-25 14:53:51 +0100258 *
259 * \warning DES is considered a weak cipher and its use constitutes a
260 * security risk. We recommend considering stronger ciphers
261 * instead.
Paul Bakker5121ce52009-01-03 21:22:43 +0000262 */
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +0100263MBEDTLS_DEPRECATED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200264int mbedtls_des_crypt_ecb( mbedtls_des_context *ctx,
Paul Bakkerff60ee62010-03-16 21:09:09 +0000265 const unsigned char input[8],
Paul Bakker5121ce52009-01-03 21:22:43 +0000266 unsigned char output[8] );
267
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200268#if defined(MBEDTLS_CIPHER_MODE_CBC)
Paul Bakker5121ce52009-01-03 21:22:43 +0000269/**
270 * \brief DES-CBC buffer encryption/decryption
271 *
Manuel Pégourié-Gonnard2be147a2015-01-23 16:19:47 +0000272 * \note Upon exit, the content of the IV is updated so that you can
273 * call the function same function again on the following
274 * block(s) of data and get the same result as if it was
275 * encrypted in one call. This allows a "streaming" usage.
276 * If on the other hand you need to retain the contents of the
277 * IV, you should either save it manually or use the cipher
278 * module instead.
279 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000280 * \param ctx DES context
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200281 * \param mode MBEDTLS_DES_ENCRYPT or MBEDTLS_DES_DECRYPT
Paul Bakker5121ce52009-01-03 21:22:43 +0000282 * \param length length of the input data
283 * \param iv initialization vector (updated after use)
284 * \param input buffer holding the input data
285 * \param output buffer holding the output data
Hanno Beckerbbca8c52017-09-25 14:53:51 +0100286 *
287 * \warning DES is considered a weak cipher and its use constitutes a
288 * security risk. We recommend considering stronger ciphers
289 * instead.
Paul Bakker5121ce52009-01-03 21:22:43 +0000290 */
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +0100291MBEDTLS_DEPRECATED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200292int mbedtls_des_crypt_cbc( mbedtls_des_context *ctx,
Paul Bakker5121ce52009-01-03 21:22:43 +0000293 int mode,
Paul Bakker23986e52011-04-24 08:57:21 +0000294 size_t length,
Paul Bakker5121ce52009-01-03 21:22:43 +0000295 unsigned char iv[8],
Paul Bakkerff60ee62010-03-16 21:09:09 +0000296 const unsigned char *input,
Paul Bakker5121ce52009-01-03 21:22:43 +0000297 unsigned char *output );
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200298#endif /* MBEDTLS_CIPHER_MODE_CBC */
Paul Bakker5121ce52009-01-03 21:22:43 +0000299
300/**
301 * \brief 3DES-ECB block encryption/decryption
302 *
303 * \param ctx 3DES context
304 * \param input 64-bit input block
305 * \param output 64-bit output block
Paul Bakkerf3ccc682010-03-18 21:21:02 +0000306 *
Paul Bakker27caa8a2010-03-21 15:43:59 +0000307 * \return 0 if successful
Paul Bakker5121ce52009-01-03 21:22:43 +0000308 */
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +0100309MBEDTLS_DEPRECATED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200310int mbedtls_des3_crypt_ecb( mbedtls_des3_context *ctx,
Paul Bakkerff60ee62010-03-16 21:09:09 +0000311 const unsigned char input[8],
Paul Bakker5121ce52009-01-03 21:22:43 +0000312 unsigned char output[8] );
313
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200314#if defined(MBEDTLS_CIPHER_MODE_CBC)
Paul Bakker5121ce52009-01-03 21:22:43 +0000315/**
316 * \brief 3DES-CBC buffer encryption/decryption
317 *
Manuel Pégourié-Gonnard2be147a2015-01-23 16:19:47 +0000318 * \note Upon exit, the content of the IV is updated so that you can
319 * call the function same function again on the following
320 * block(s) of data and get the same result as if it was
321 * encrypted in one call. This allows a "streaming" usage.
322 * If on the other hand you need to retain the contents of the
323 * IV, you should either save it manually or use the cipher
324 * module instead.
325 *
Paul Bakker5121ce52009-01-03 21:22:43 +0000326 * \param ctx 3DES context
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200327 * \param mode MBEDTLS_DES_ENCRYPT or MBEDTLS_DES_DECRYPT
Paul Bakker5121ce52009-01-03 21:22:43 +0000328 * \param length length of the input data
329 * \param iv initialization vector (updated after use)
330 * \param input buffer holding the input data
331 * \param output buffer holding the output data
Paul Bakkerf3ccc682010-03-18 21:21:02 +0000332 *
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200333 * \return 0 if successful, or MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH
Paul Bakker5121ce52009-01-03 21:22:43 +0000334 */
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +0100335MBEDTLS_DEPRECATED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200336int mbedtls_des3_crypt_cbc( mbedtls_des3_context *ctx,
Paul Bakker5121ce52009-01-03 21:22:43 +0000337 int mode,
Paul Bakker23986e52011-04-24 08:57:21 +0000338 size_t length,
Paul Bakker5121ce52009-01-03 21:22:43 +0000339 unsigned char iv[8],
Paul Bakkerff60ee62010-03-16 21:09:09 +0000340 const unsigned char *input,
Paul Bakker5121ce52009-01-03 21:22:43 +0000341 unsigned char *output );
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200342#endif /* MBEDTLS_CIPHER_MODE_CBC */
Paul Bakker5121ce52009-01-03 21:22:43 +0000343
Manuel Pégourié-Gonnard70a50102015-05-12 15:02:45 +0200344/**
345 * \brief Internal function for key expansion.
346 * (Only exposed to allow overriding it,
347 * see MBEDTLS_DES_SETKEY_ALT)
348 *
349 * \param SK Round keys
350 * \param key Base key
Hanno Beckerbbca8c52017-09-25 14:53:51 +0100351 *
352 * \warning DES is considered a weak cipher and its use constitutes a
353 * security risk. We recommend considering stronger ciphers
354 * instead.
Manuel Pégourié-Gonnard70a50102015-05-12 15:02:45 +0200355 */
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +0100356MBEDTLS_DEPRECATED
Manuel Pégourié-Gonnard70a50102015-05-12 15:02:45 +0200357void mbedtls_des_setkey( uint32_t SK[32],
358 const unsigned char key[MBEDTLS_DES_KEY_SIZE] );
Paul Bakker90995b52013-06-24 19:20:35 +0200359
Andrzej Kurekc470b6b2019-01-31 08:20:20 -0500360#if defined(MBEDTLS_SELF_TEST)
361
Paul Bakker9a736322012-11-14 12:39:52 +0000362/**
Paul Bakker5121ce52009-01-03 21:22:43 +0000363 * \brief Checkup routine
364 *
365 * \return 0 if successful, or 1 if the test failed
366 */
Jaeden Amerodfc7f4a2019-07-10 11:33:37 +0100367MBEDTLS_DEPRECATED
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200368int mbedtls_des_self_test( int verbose );
Paul Bakker5121ce52009-01-03 21:22:43 +0000369
Andrzej Kurekc470b6b2019-01-31 08:20:20 -0500370#endif /* MBEDTLS_SELF_TEST */
371
Paul Bakker5121ce52009-01-03 21:22:43 +0000372#ifdef __cplusplus
373}
374#endif
375
376#endif /* des.h */