17 #ifndef MBEDTLS_DES_ALT_H 18 #define MBEDTLS_DES_ALT_H 20 #include "mbedtls/des.h" 22 #if defined(MBEDTLS_DES_ALT) 39 uint8_t key[3][MBEDTLS_DES_KEY_SIZE];
49 uint8_t key[3][MBEDTLS_DES_KEY_SIZE];
58 void mbedtls_des_init( mbedtls_des_context *ctx );
65 void mbedtls_des_free( mbedtls_des_context *ctx );
72 void mbedtls_des3_init( mbedtls_des3_context *ctx );
79 void mbedtls_des3_free( mbedtls_des3_context *ctx );
89 void mbedtls_des_key_set_parity(
unsigned char key[MBEDTLS_DES_KEY_SIZE] );
101 int mbedtls_des_key_check_key_parity(
const unsigned char key[MBEDTLS_DES_KEY_SIZE] );
110 int mbedtls_des_key_check_weak(
const unsigned char key[MBEDTLS_DES_KEY_SIZE] );
120 int mbedtls_des_setkey_enc( mbedtls_des_context *ctx,
const unsigned char key[MBEDTLS_DES_KEY_SIZE] );
130 int mbedtls_des_setkey_dec( mbedtls_des_context *ctx,
const unsigned char key[MBEDTLS_DES_KEY_SIZE] );
140 int mbedtls_des3_set2key_enc( mbedtls_des3_context *ctx,
141 const unsigned char key[MBEDTLS_DES_KEY_SIZE * 2] );
151 int mbedtls_des3_set2key_dec( mbedtls_des3_context *ctx,
152 const unsigned char key[MBEDTLS_DES_KEY_SIZE * 2] );
162 int mbedtls_des3_set3key_enc( mbedtls_des3_context *ctx,
163 const unsigned char key[MBEDTLS_DES_KEY_SIZE * 3] );
173 int mbedtls_des3_set3key_dec( mbedtls_des3_context *ctx,
174 const unsigned char key[MBEDTLS_DES_KEY_SIZE * 3] );
185 int mbedtls_des_crypt_ecb( mbedtls_des_context *ctx,
186 const unsigned char input[8],
187 unsigned char output[8] );
189 #if defined(MBEDTLS_CIPHER_MODE_CBC) 208 int mbedtls_des_crypt_cbc( mbedtls_des_context *ctx,
212 const unsigned char *input,
213 unsigned char *output );
225 int mbedtls_des3_crypt_ecb( mbedtls_des3_context *ctx,
226 const unsigned char input[8],
227 unsigned char output[8] );
229 #if defined(MBEDTLS_CIPHER_MODE_CBC) 250 int mbedtls_des3_crypt_cbc( mbedtls_des3_context *ctx,
254 const unsigned char *input,
255 unsigned char *output );
266 void mbedtls_des_setkey( uint32_t SK[32],
267 const unsigned char key[MBEDTLS_DES_KEY_SIZE] );