Go to the source code of this file.
Data Structures | |
struct | des_context |
DES context structure. More... | |
struct | des3_context |
Triple-DES context structure. More... | |
Functions | |
void | des_set_key (des_context *ctx, unsigned char key[8]) |
DES key schedule (56-bit). | |
void | des_encrypt (des_context *ctx, unsigned char input[8], unsigned char output[8]) |
DES block encryption (ECB mode). | |
void | des_decrypt (des_context *ctx, unsigned char input[8], unsigned char output[8]) |
DES block decryption (ECB mode). | |
void | des_cbc_encrypt (des_context *ctx, unsigned char iv[8], unsigned char *input, unsigned char *output, int len) |
DES-CBC buffer encryption. | |
void | des_cbc_decrypt (des_context *ctx, unsigned char iv[8], unsigned char *input, unsigned char *output, int len) |
DES-CBC buffer decryption. | |
void | des3_set_2keys (des3_context *ctx, unsigned char key[16]) |
Triple-DES key schedule (112-bit). | |
void | des3_set_3keys (des3_context *ctx, unsigned char key[24]) |
Triple-DES key schedule (168-bit). | |
void | des3_encrypt (des3_context *ctx, unsigned char input[8], unsigned char output[8]) |
Triple-DES block encryption (ECB mode). | |
void | des3_decrypt (des3_context *ctx, unsigned char input[8], unsigned char output[8]) |
Triple-DES block decryption (ECB mode). | |
void | des3_cbc_encrypt (des3_context *ctx, unsigned char iv[8], unsigned char *input, unsigned char *output, int len) |
3DES-CBC buffer encryption | |
void | des3_cbc_decrypt (des3_context *ctx, unsigned char iv[8], unsigned char *input, unsigned char *output, int len) |
3DES-CBC buffer decryption | |
int | des_self_test (int verbose) |
Definition in file des.h.
void des3_cbc_decrypt | ( | des3_context * | ctx, | |
unsigned char | iv[8], | |||
unsigned char * | input, | |||
unsigned char * | output, | |||
int | len | |||
) |
3DES-CBC buffer decryption
ctx | 3DES context | |
iv | initialization vector (modified after use) | |
input | buffer holding the ciphertext | |
output | buffer holding the plaintext | |
len | length of the data to be decrypted |
Definition at line 611 of file des.c.
References des3_crypt(), and des3_context::dsk.
Referenced by ssl_decrypt_buf(), and x509_des3_decrypt().
void des3_cbc_encrypt | ( | des3_context * | ctx, | |
unsigned char | iv[8], | |||
unsigned char * | input, | |||
unsigned char * | output, | |||
int | len | |||
) |
3DES-CBC buffer encryption
ctx | 3DES context | |
iv | initialization vector (modified after use) | |
input | buffer holding the plaintext | |
output | buffer holding the ciphertext | |
len | length of the data to be encrypted |
Definition at line 586 of file des.c.
References des3_crypt(), and des3_context::esk.
Referenced by main(), and ssl_encrypt_buf().
void des3_decrypt | ( | des3_context * | ctx, | |
unsigned char | input[8], | |||
unsigned char | output[8] | |||
) |
Triple-DES block decryption (ECB mode).
ctx | 3DES context | |
input | ciphertext block | |
output | plaintext block |
Definition at line 576 of file des.c.
References des3_crypt(), and des3_context::dsk.
void des3_encrypt | ( | des3_context * | ctx, | |
unsigned char | input[8], | |||
unsigned char | output[8] | |||
) |
Triple-DES block encryption (ECB mode).
ctx | 3DES context | |
input | plaintext block | |
output | ciphertext block |
Definition at line 566 of file des.c.
References des3_crypt(), and des3_context::esk.
void des3_set_2keys | ( | des3_context * | ctx, | |
unsigned char | key[16] | |||
) |
Triple-DES key schedule (112-bit).
ctx | 3DES context to be initialized | |
key | 16-byte secret key |
Definition at line 472 of file des.c.
References des_main_ks(), des3_context::dsk, and des3_context::esk.
void des3_set_3keys | ( | des3_context * | ctx, | |
unsigned char | key[24] | |||
) |
Triple-DES key schedule (168-bit).
ctx | 3DES context to be initialized | |
key | 24-byte secret key |
Definition at line 498 of file des.c.
References des_main_ks(), des3_context::dsk, and des3_context::esk.
Referenced by main(), ssl_derive_keys(), and x509_des3_decrypt().
void des_cbc_decrypt | ( | des_context * | ctx, | |
unsigned char | iv[8], | |||
unsigned char * | input, | |||
unsigned char * | output, | |||
int | len | |||
) |
DES-CBC buffer decryption.
ctx | DES context | |
iv | initialization vector (modified after use) | |
input | buffer holding the ciphertext | |
output | buffer holding the plaintext | |
len | length of the data to be decrypted |
Definition at line 444 of file des.c.
References des_crypt(), and des_context::dsk.
void des_cbc_encrypt | ( | des_context * | ctx, | |
unsigned char | iv[8], | |||
unsigned char * | input, | |||
unsigned char * | output, | |||
int | len | |||
) |
DES-CBC buffer encryption.
ctx | DES context | |
iv | initialization vector (modified after use) | |
input | buffer holding the plaintext | |
output | buffer holding the ciphertext | |
len | length of the data to be encrypted |
Definition at line 419 of file des.c.
References des_crypt(), and des_context::esk.
Referenced by main().
void des_decrypt | ( | des_context * | ctx, | |
unsigned char | input[8], | |||
unsigned char | output[8] | |||
) |
DES block decryption (ECB mode).
ctx | DES context | |
input | ciphertext block | |
output | plaintext block |
Definition at line 409 of file des.c.
References des_crypt(), and des_context::dsk.
void des_encrypt | ( | des_context * | ctx, | |
unsigned char | input[8], | |||
unsigned char | output[8] | |||
) |
DES block encryption (ECB mode).
ctx | DES context | |
input | plaintext block | |
output | ciphertext block |
Definition at line 399 of file des.c.
References des_crypt(), and des_context::esk.
void des_set_key | ( | des_context * | ctx, | |
unsigned char | key[8] | |||
) |
DES key schedule (56-bit).
ctx | DES context to be initialized | |
key | 8-byte secret key |
Definition at line 357 of file des.c.
References des_main_ks(), des_context::dsk, and des_context::esk.
Referenced by main().