1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-08 17:42:09 +03:00

- Added Blowfish to generic cipher layer

- Renamed POLARSSL_MODE_CFB128 to POLARSSL_MODE_CFB
This commit is contained in:
Paul Bakker
2012-07-04 17:10:40 +00:00
parent 26c4e3cb0b
commit 6132d0aa93
9 changed files with 525 additions and 19 deletions

View File

@@ -54,7 +54,7 @@ extern "C" {
#endif
/**
* \brief Blowfish key schedule (encryption)
* \brief Blowfish key schedule
*
* \param ctx Blowfish context to be initialized
* \param key encryption key

View File

@@ -53,6 +53,7 @@ typedef enum {
POLARSSL_CIPHER_ID_DES,
POLARSSL_CIPHER_ID_3DES,
POLARSSL_CIPHER_ID_CAMELLIA,
POLARSSL_CIPHER_ID_BLOWFISH,
} cipher_id_t;
typedef enum {
@@ -78,14 +79,17 @@ typedef enum {
POLARSSL_CIPHER_CAMELLIA_256_CTR,
POLARSSL_CIPHER_DES_CBC,
POLARSSL_CIPHER_DES_EDE_CBC,
POLARSSL_CIPHER_DES_EDE3_CBC
POLARSSL_CIPHER_DES_EDE3_CBC,
POLARSSL_CIPHER_BLOWFISH_CBC,
POLARSSL_CIPHER_BLOWFISH_CFB64,
POLARSSL_CIPHER_BLOWFISH_CTR,
} cipher_type_t;
typedef enum {
POLARSSL_MODE_NONE = 0,
POLARSSL_MODE_NULL,
POLARSSL_MODE_CBC,
POLARSSL_MODE_CFB128,
POLARSSL_MODE_CFB,
POLARSSL_MODE_OFB,
POLARSSL_MODE_CTR,
} cipher_mode_t;
@@ -121,8 +125,8 @@ typedef struct {
int (*cbc_func)( void *ctx, operation_t mode, size_t length, unsigned char *iv,
const unsigned char *input, unsigned char *output );
/** Encrypt using CFB128 */
int (*cfb128_func)( void *ctx, operation_t mode, size_t length, size_t *iv_off,
/** Encrypt using CFB (Full length) */
int (*cfb_func)( void *ctx, operation_t mode, size_t length, size_t *iv_off,
unsigned char *iv, const unsigned char *input, unsigned char *output );
/** Encrypt using CTR */

View File

@@ -84,6 +84,18 @@ extern const cipher_info_t des_ede3_cbc_info;
#endif /* defined(POLARSSL_DES_C) */
#if defined(POLARSSL_BLOWFISH_C)
extern const cipher_info_t blowfish_cbc_info;
#if defined(POLARSSL_CIPHER_MODE_CFB)
extern const cipher_info_t blowfish_cfb64_info;
#endif /* POLARSSL_CIPHER_MODE_CFB */
#if defined(POLARSSL_CIPHER_MODE_CTR)
extern const cipher_info_t blowfish_ctr_info;
#endif /* POLARSSL_CIPHER_MODE_CTR */
#endif /* defined(POLARSSL_BLOWFISH_C) */
#if defined(POLARSSL_CIPHER_NULL_CIPHER)
extern const cipher_info_t null_cipher_info;
#endif /* defined(POLARSSL_CIPHER_NULL_CIPHER) */