4 * Based on XySSL: Copyright (C) 2006-2008 Christophe Devine
6 * Copyright (C) 2009 Paul Bakker <polarssl_maintainer at polarssl dot org>
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
14 * * Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * * Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * * Neither the names of PolarSSL or XySSL nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 #include "netif/ppp/ppp_opts.h"
37 #if LWIP_INCLUDED_POLARSSL_DES
39 #ifndef LWIP_INCLUDED_POLARSSL_DES_H
40 #define LWIP_INCLUDED_POLARSSL_DES_H
46 * \brief DES context structure
50 int mode; /*!< encrypt/decrypt */
51 unsigned long sk[32]; /*!< DES subkeys */
60 * \brief DES key schedule (56-bit, encryption)
62 * \param ctx DES context to be initialized
63 * \param key 8-byte secret key
65 void des_setkey_enc( des_context *ctx, unsigned char key[8] );
68 * \brief DES key schedule (56-bit, decryption)
70 * \param ctx DES context to be initialized
71 * \param key 8-byte secret key
73 void des_setkey_dec( des_context *ctx, unsigned char key[8] );
76 * \brief DES-ECB block encryption/decryption
78 * \param ctx DES context
79 * \param input 64-bit input block
80 * \param output 64-bit output block
82 void des_crypt_ecb( des_context *ctx,
83 const unsigned char input[8],
84 unsigned char output[8] );
90 #endif /* LWIP_INCLUDED_POLARSSL_DES_H */
92 #endif /* LWIP_INCLUDED_POLARSSL_DES */