aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon/transforms/crypters/crypter.h
diff options
context:
space:
mode:
authorJan Hutter <jhutter@hsr.ch>2005-12-06 15:21:26 +0000
committerJan Hutter <jhutter@hsr.ch>2005-12-06 15:21:26 +0000
commit62abe4a37dade51bc122e97d566ec7b728648638 (patch)
treed64b4ea5f764461b8c1b61626cc6aa43d141864a /Source/charon/transforms/crypters/crypter.h
parent1e7d52a611b602f6a60a593e419173d70cd84f0f (diff)
downloadstrongswan-62abe4a37dade51bc122e97d566ec7b728648638.tar.bz2
strongswan-62abe4a37dade51bc122e97d566ec7b728648638.tar.xz
- code cleaned up
Diffstat (limited to 'Source/charon/transforms/crypters/crypter.h')
-rw-r--r--Source/charon/transforms/crypters/crypter.h57
1 files changed, 37 insertions, 20 deletions
diff --git a/Source/charon/transforms/crypters/crypter.h b/Source/charon/transforms/crypters/crypter.h
index 1ff42299f..d4ba40e1d 100644
--- a/Source/charon/transforms/crypters/crypter.h
+++ b/Source/charon/transforms/crypters/crypter.h
@@ -28,7 +28,18 @@
typedef enum encryption_algorithm_t encryption_algorithm_t;
/**
- * @brief Encryption algorithm, as in IKEv2 draft 3.3.2
+ * @brief Encryption algorithm, as in IKEv2 draft 3.3.2.
+ *
+ * Currently only the following algorithms are implemented and therefore supported:
+ * - ENCR_AES_CBC
+ *
+ * @b Constructors:
+ * - crypter_create()
+ * - aes_cbc_crypter_create()
+ *
+ * @todo Implement more enryption algorithm, especially 3DES
+ *
+ * @ingroup crypters
*/
enum encryption_algorithm_t {
ENCR_UNDEFINED = 1024,
@@ -41,17 +52,20 @@ enum encryption_algorithm_t {
ENCR_BLOWFISH = 7,
ENCR_3IDEA = 8,
ENCR_DES_IV32 = 9,
- RESERVED = 10,
ENCR_NULL = 11,
+ /**
+ * Implemented in class aes_cbc_crypter_t.
+ */
ENCR_AES_CBC = 12,
ENCR_AES_CTR = 13
};
/**
- * string mappings for encryption_algorithm_t
+ * String mappings for encryption_algorithm_t.
*/
extern mapping_t encryption_algorithm_m[];
+
typedef struct crypter_t crypter_t;
/**
@@ -67,13 +81,13 @@ struct crypter_t {
* @brief Encrypt a chunk of data and allocate space for
* the encrypted value.
*
- * @param this calling crypter
+ * @param this calling object
* @param data data to encrypt
- * @param iv iv
+ * @param iv initializing vector
* @param [out]encrypted pointer where the encrypted bytes will be written
* @return
- * - SUCCESS, or
- * - INVALID_ARG if data size not a multiple of block size
+ * - SUCCESS
+ * - INVALID_ARG if data size not a multiple of block size
*/
status_t (*encrypt) (crypter_t *this, chunk_t data, chunk_t iv, chunk_t *encrypted);
@@ -81,31 +95,31 @@ struct crypter_t {
* @brief Decrypt a chunk of data and allocate space for
* the decrypted value.
*
- * @param this calling crypter
+ * @param this calling object
* @param data data to decrypt
- * @param iv iv
+ * @param iv initializing vector
* @param [out]encrypted pointer where the decrypted bytes will be written
* @return
- * - SUCCESS, or
- * - INVALID_ARG if data size not a multiple of block size
+ * - SUCCESS
+ * - INVALID_ARG if data size not a multiple of block size
*/
status_t (*decrypt) (crypter_t *this, chunk_t data, chunk_t iv, chunk_t *decrypted);
/**
- * @brief get the block size of this crypter
+ * @brief Get the block size of this crypter_t object.
*
- * @param this calling crypter
+ * @param this calling object
* @return block size in bytes
*/
size_t (*get_block_size) (crypter_t *this);
/**
- * @brief Set the key for this crypter
+ * @brief Set the key for this crypter_t object.
*
- * @param this calling crypter
+ * @param this calling object
* @param key key to set
* @return
- * - SUCCESS, or
+ * - SUCCESS
* - INVALID_ARG if key size != block size
*/
status_t (*set_key) (crypter_t *this, chunk_t key);
@@ -113,7 +127,7 @@ struct crypter_t {
/**
* @brief Destroys a crypter_t object.
*
- * @param this crypter_t object to destroy
+ * @param this calling object
*/
void (*destroy) (crypter_t *this);
};
@@ -121,11 +135,14 @@ struct crypter_t {
/**
* @brief Generic constructor for crypter_t objects.
*
+ * Currently only the following algorithms are implemented and therefore supported:
+ * - ENCR_AES_CBC
+ *
* @param encryption_algorithm Algorithm to use for crypter
- * @param blocksize block size in bytes
+ * @param blocksize block size in bytes
* @return
- * - crypter_t if successfully
- * - NULL if crypter not supported
+ * - crypter_t object
+ * - NULL if encryption algorithm or blocksize is not supported
*/
crypter_t *crypter_create(encryption_algorithm_t encryption_algorithm, size_t blocksize);