aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/modes/cipher_mode.h
diff options
context:
space:
mode:
authorRenĂ© Korthaus <[email protected]>2016-10-16 14:04:04 +0200
committerRenĂ© Korthaus <[email protected]>2016-10-19 09:13:23 +0200
commitae74d71df63abee42875d0f7bcef799808476b48 (patch)
tree9debca0e738665ef94a5a744a749b0ea1c6d2625 /src/lib/modes/cipher_mode.h
parentfd741ac1ef348cc3f843fbf22aca698f86e87dbf (diff)
Improve modes doxygen [ci skip]
Diffstat (limited to 'src/lib/modes/cipher_mode.h')
-rw-r--r--src/lib/modes/cipher_mode.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/lib/modes/cipher_mode.h b/src/lib/modes/cipher_mode.h
index d890870c1..2abaa7ac8 100644
--- a/src/lib/modes/cipher_mode.h
+++ b/src/lib/modes/cipher_mode.h
@@ -69,7 +69,10 @@ class BOTAN_DLL Cipher_Mode
* Processes msg in place and returns bytes written. Normally
* this will be either msg_len (indicating the entire message was
* processes) or for certain AEAD modes zero (indicating that the
- * mode requires the entire message be processed in one pass.
+ * mode requires the entire message be processed in one pass).
+ *
+ * @param msg the message to be processed
+ * @param msg_len length of the message in bytes
*/
virtual size_t process(uint8_t msg[], size_t msg_len) = 0;
@@ -116,12 +119,12 @@ class BOTAN_DLL Cipher_Mode
virtual size_t minimum_final_size() const = 0;
/**
- * Return the default size for a nonce
+ * @return the default size for a nonce
*/
virtual size_t default_nonce_length() const = 0;
/**
- * Return true iff nonce_len is a valid length for the nonce
+ * @return true iff nonce_len is a valid length for the nonce
*/
virtual bool valid_nonce_length(size_t nonce_len) const = 0;
@@ -130,13 +133,13 @@ class BOTAN_DLL Cipher_Mode
virtual void clear() = 0;
/**
- * Returns true iff this mode provides authentication as well as
+ * @return true iff this mode provides authentication as well as
* confidentiality.
*/
virtual bool authenticated() const { return false; }
/**
- * Return the size of the authentication tag used (in bytes)
+ * @return the size of the authentication tag used (in bytes)
*/
virtual size_t tag_size() const { return 0; }
@@ -155,12 +158,20 @@ class BOTAN_DLL Cipher_Mode
return key_spec().valid_keylength(length);
}
+ /**
+ * Set the symmetric key of this transform
+ * @param key contains the key material
+ */
template<typename Alloc>
void set_key(const std::vector<byte, Alloc>& key)
{
set_key(key.data(), key.size());
}
+ /**
+ * Set the symmetric key of this transform
+ * @param key contains the key material
+ */
void set_key(const SymmetricKey& key)
{
set_key(key.begin(), key.length());
@@ -194,6 +205,11 @@ class BOTAN_DLL Cipher_Mode
*/
enum Cipher_Dir { ENCRYPTION, DECRYPTION };
+/**
+* Get a cipher mode by name (eg "AES-128/CBC" or "Serpent/XTS")
+* @param algo_spec cipher name
+* @param direction ENCRYPTION or DECRYPTION
+*/
BOTAN_DLL Cipher_Mode* get_cipher_mode(const std::string& algo_spec, Cipher_Dir direction);
}