24 #ifndef POLARSSL_DES_H
25 #define POLARSSL_DES_H
27 #if !defined(POLARSSL_CONFIG_FILE)
30 #include POLARSSL_CONFIG_FILE
35 #if defined(_MSC_VER) && !defined(EFIX64) && !defined(EFI32)
37 typedef UINT32 uint32_t;
45 #define POLARSSL_ERR_DES_INVALID_INPUT_LENGTH -0x0032
47 #define DES_KEY_SIZE 8
49 #if !defined(POLARSSL_DES_ALT)
210 const unsigned char input[8],
211 unsigned char output[8] );
213 #if defined(POLARSSL_CIPHER_MODE_CBC)
236 const unsigned char *input,
237 unsigned char *output );
250 const unsigned char input[8],
251 unsigned char output[8] );
253 #if defined(POLARSSL_CIPHER_MODE_CBC)
278 const unsigned char *input,
279 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