removed status result from crypter interface to be consistent with other crypto interfaces

This commit is contained in:
Martin Willi
2008-04-22 07:14:24 +00:00
parent b638a1009f
commit 4d18175997
5 changed files with 77 additions and 171 deletions
+16 -11
View File
@@ -61,24 +61,28 @@ struct crypter_t {
/**
* Encrypt a chunk of data and allocate space for the encrypted value.
*
* The length of the iv must equal to get_block_size(), while the length
* of data must be a multiple it.
*
* @param data data to encrypt
* @param iv initializing vector
* @param encrypted pointer where the encrypted bytes will be written
* @return SUCCESS, or INVALID_ARG if size invalid
* @param encrypted chunk to allocate encrypted data
*/
status_t (*encrypt) (crypter_t *this, chunk_t data, chunk_t iv,
chunk_t *encrypted);
void (*encrypt) (crypter_t *this, chunk_t data, chunk_t iv,
chunk_t *encrypted);
/**
* Decrypt a chunk of data and allocate space for the decrypted value.
*
* The length of the iv must equal to get_block_size(), while the length
* of data must be a multiple it.
*
* @param data data to decrypt
* @param iv initializing vector
* @param encrypted pointer where the decrypted bytes will be written
* @return SUCCESS, or INVALID_ARG if invalid
* @param encrypted chunk to allocate decrypted data
*/
status_t (*decrypt) (crypter_t *this, chunk_t data, chunk_t iv,
chunk_t *decrypted);
void (*decrypt) (crypter_t *this, chunk_t data, chunk_t iv,
chunk_t *decrypted);
/**
* Get the block size of the crypto algorithm.
@@ -96,11 +100,12 @@ struct crypter_t {
/**
* Set the key.
*
*
* The length of the key must match get_key_size().
*
* @param key key to set
* @return SUCCESS, or INVALID_ARG if key length invalid
*/
status_t (*set_key) (crypter_t *this, chunk_t key);
void (*set_key) (crypter_t *this, chunk_t key);
/**
* Destroys a crypter_t object.