cipher layer: IV length is not always block size
This commit is contained in:
parent
e0dca4ad78
commit
0b58c150d6
1 changed files with 6 additions and 3 deletions
|
@ -152,10 +152,13 @@ enum {
|
||||||
POLARSSL_KEY_LENGTH_DES_EDE = 128,
|
POLARSSL_KEY_LENGTH_DES_EDE = 128,
|
||||||
/** Key length, in bits (including parity), for DES in three-key EDE */
|
/** Key length, in bits (including parity), for DES in three-key EDE */
|
||||||
POLARSSL_KEY_LENGTH_DES_EDE3 = 192,
|
POLARSSL_KEY_LENGTH_DES_EDE3 = 192,
|
||||||
/** Maximum length of any IV, in bytes */
|
|
||||||
POLARSSL_MAX_IV_LENGTH = 16,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Maximum length of any IV, in bytes */
|
||||||
|
#define POLARSSL_MAX_IV_LENGTH 16
|
||||||
|
/** Maximum block size of any cipher, in bytes */
|
||||||
|
#define POLARSSL_MAX_BLOCK_LENGTH 16
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base cipher information. The non-mode specific functions and values.
|
* Base cipher information. The non-mode specific functions and values.
|
||||||
*/
|
*/
|
||||||
|
@ -248,7 +251,7 @@ typedef struct {
|
||||||
int (*get_padding)( unsigned char *input, size_t ilen, size_t *data_len );
|
int (*get_padding)( unsigned char *input, size_t ilen, size_t *data_len );
|
||||||
|
|
||||||
/** Buffer for data that hasn't been encrypted yet */
|
/** Buffer for data that hasn't been encrypted yet */
|
||||||
unsigned char unprocessed_data[POLARSSL_MAX_IV_LENGTH];
|
unsigned char unprocessed_data[POLARSSL_MAX_BLOCK_LENGTH];
|
||||||
|
|
||||||
/** Number of bytes that still need processing */
|
/** Number of bytes that still need processing */
|
||||||
size_t unprocessed_len;
|
size_t unprocessed_len;
|
||||||
|
|
Loading…
Reference in a new issue