27 #ifndef POLARSSL_DES_H
28 #define POLARSSL_DES_H
30 #if !defined(POLARSSL_CONFIG_FILE)
33 #include POLARSSL_CONFIG_FILE
38 #if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
40 typedef UINT32 uint32_t;
48 #define POLARSSL_ERR_DES_INVALID_INPUT_LENGTH -0x0032
50 #define DES_KEY_SIZE 8
52 #if !defined(POLARSSL_DES_ALT)
213 const unsigned char input[8],
214 unsigned char output[8] );
216 #if defined(POLARSSL_CIPHER_MODE_CBC)
231 const unsigned char *input,
232 unsigned char *output );
245 const unsigned char input[8],
246 unsigned char output[8] );
248 #if defined(POLARSSL_CIPHER_MODE_CBC)
265 const unsigned char *input,
266 unsigned char *output );
void des3_init(des3_context *ctx)
Initialize Triple-DES context.
int des_self_test(int verbose)
Checkup routine.
int des_crypt_ecb(des_context *ctx, const unsigned char input[8], unsigned char output[8])
DES-ECB block encryption/decryption.
Configuration options (set of defines)
int des3_set3key_enc(des3_context *ctx, const unsigned char key[DES_KEY_SIZE *3])
Triple-DES key schedule (168-bit, encryption)
void des3_free(des3_context *ctx)
Clear Triple-DES context.
int des3_set3key_dec(des3_context *ctx, const unsigned char key[DES_KEY_SIZE *3])
Triple-DES key schedule (168-bit, decryption)
Triple-DES context structure.
int des3_set2key_enc(des3_context *ctx, const unsigned char key[DES_KEY_SIZE *2])
Triple-DES key schedule (112-bit, encryption)
void des_init(des_context *ctx)
Initialize DES context.
void des_key_set_parity(unsigned char key[DES_KEY_SIZE])
Set key parity on the given key to odd.
void des_free(des_context *ctx)
Clear DES context.
int des_crypt_cbc(des_context *ctx, int mode, size_t length, unsigned char iv[8], const unsigned char *input, unsigned char *output)
DES-CBC buffer encryption/decryption.
int des_setkey_enc(des_context *ctx, const unsigned char key[DES_KEY_SIZE])
DES key schedule (56-bit, encryption)
int des_setkey_dec(des_context *ctx, const unsigned char key[DES_KEY_SIZE])
DES key schedule (56-bit, decryption)
int des3_crypt_ecb(des3_context *ctx, const unsigned char input[8], unsigned char output[8])
3DES-ECB block encryption/decryption
int des_key_check_weak(const unsigned char key[DES_KEY_SIZE])
Check that key is not a weak or semi-weak DES key.
int des_key_check_key_parity(const unsigned char key[DES_KEY_SIZE])
Check that key parity on the given key is odd.
int des3_set2key_dec(des3_context *ctx, const unsigned char key[DES_KEY_SIZE *2])
Triple-DES key schedule (112-bit, decryption)
int des3_crypt_cbc(des3_context *ctx, int mode, size_t length, unsigned char iv[8], const unsigned char *input, unsigned char *output)
3DES-CBC buffer encryption/decryption