mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-02-19 00:39:46 +00:00
Add cipher_set_padding() (no effect yet)
Fix pattern in tests/.gitignore along the way.
This commit is contained in:
committed by
Paul Bakker
parent
0f2f0bfc87
commit
d5fdcaf9e5
@@ -104,6 +104,10 @@ typedef enum {
|
||||
POLARSSL_MODE_STREAM,
|
||||
} cipher_mode_t;
|
||||
|
||||
typedef enum {
|
||||
POLARSSL_PADDING_PKCS7 = 0, /**< PKCS7 padding (default) */
|
||||
} cipher_padding_t;
|
||||
|
||||
typedef enum {
|
||||
POLARSSL_OPERATION_NONE = -1,
|
||||
POLARSSL_DECRYPT = 0,
|
||||
@@ -398,6 +402,18 @@ static inline operation_t cipher_get_operation( const cipher_context_t *ctx )
|
||||
int cipher_setkey( cipher_context_t *ctx, const unsigned char *key, int key_length,
|
||||
const operation_t operation );
|
||||
|
||||
/**
|
||||
* \brief Set padding mode, for cipher modes that use padding.
|
||||
* (Default: PKCS7 padding.)
|
||||
*
|
||||
* \param ctx generic cipher context
|
||||
* \param mode padding mode
|
||||
*
|
||||
* \returns 0 on success, POLARSSL_ERR_CIPHER_BAD_INPUT_DATA
|
||||
* if parameters verification fails.
|
||||
*/
|
||||
int cipher_set_padding_mode( cipher_context_t *ctx, cipher_padding_t mode );
|
||||
|
||||
/**
|
||||
* \brief Reset the given context, setting the IV to iv
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user