aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRenĂ© Korthaus <[email protected]>2016-10-16 17:19:18 +0200
committerRenĂ© Korthaus <[email protected]>2016-10-19 09:13:34 +0200
commit446f2a0289cca0de11e748e73071a39c06940239 (patch)
treec22651dea9e9505341e92fbb33d7b488b6444980 /src
parenta08e0160301f20e4f5d620a146a1556e0ac7c95d (diff)
Improve stream doxygen [ci skip]
Diffstat (limited to 'src')
-rw-r--r--src/lib/hash/hash.h2
-rw-r--r--src/lib/mac/mac.h2
-rw-r--r--src/lib/stream/chacha/chacha.h3
-rw-r--r--src/lib/stream/stream_cipher.h26
4 files changed, 26 insertions, 7 deletions
diff --git a/src/lib/hash/hash.h b/src/lib/hash/hash.h
index 9bc06e953..206333b9f 100644
--- a/src/lib/hash/hash.h
+++ b/src/lib/hash/hash.h
@@ -26,7 +26,7 @@ class BOTAN_DLL HashFunction : public Buffered_Computation
* Create an instance based on a name
* If provider is empty then best available is chosen.
* @param algo_spec algorithm name
- * @param provider provider implementation to choose
+ * @param provider provider implementation to use
* @return a null pointer if the algo/provider combination cannot be found
*/
static std::unique_ptr<HashFunction> create(const std::string& algo_spec,
diff --git a/src/lib/mac/mac.h b/src/lib/mac/mac.h
index f742d7db4..69b7ea581 100644
--- a/src/lib/mac/mac.h
+++ b/src/lib/mac/mac.h
@@ -28,7 +28,7 @@ class BOTAN_DLL MessageAuthenticationCode : public Buffered_Computation,
* Create an instance based on a name
* If provider is empty then best available is chosen.
* @param algo_spec algorithm name
- * @param provider provider implementation to choose
+ * @param provider provider implementation to use
* @return a null pointer if the algo/provider combination cannot be found
*/
static std::unique_ptr<MessageAuthenticationCode> create(const std::string& algo_spec,
diff --git a/src/lib/stream/chacha/chacha.h b/src/lib/stream/chacha/chacha.h
index eafeac2fd..6b1c989e2 100644
--- a/src/lib/stream/chacha/chacha.h
+++ b/src/lib/stream/chacha/chacha.h
@@ -21,7 +21,8 @@ class BOTAN_DLL ChaCha final : public StreamCipher
StreamCipher* clone() const override { return new ChaCha(m_rounds); }
/**
- * Currently only 8, 12 or 20 rounds are supported, all others
+ * @param rounds number of rounds
+ * @note Currently only 8, 12 or 20 rounds are supported, all others
* will throw an exception
*/
ChaCha(size_t rounds = 20);
diff --git a/src/lib/stream/stream_cipher.h b/src/lib/stream/stream_cipher.h
index b24a99e39..a5ecc373b 100644
--- a/src/lib/stream/stream_cipher.h
+++ b/src/lib/stream/stream_cipher.h
@@ -23,14 +23,16 @@ class BOTAN_DLL StreamCipher : public SymmetricAlgorithm
/**
* Create an instance based on a name
- * Will return a null pointer if the algo/provider combination cannot
- * be found. If provider is empty then best available is chosen.
+ * If provider is empty then best available is chosen.
+ * @param algo_spec algorithm name
+ * @param provider provider implementation to use
+ * @return a null pointer if the algo/provider combination cannot be found
*/
static std::unique_ptr<StreamCipher> create(const std::string& algo_spec,
const std::string& provider = "");
/**
- * Returns the list of available providers for this algorithm, empty if not available
+ * @return list of available providers for this algorithm, empty if not available
*/
static std::vector<std::string> providers(const std::string& algo_spec);
@@ -44,20 +46,36 @@ class BOTAN_DLL StreamCipher : public SymmetricAlgorithm
/**
* Encrypt or decrypt a message
+ * The message is encrypted/decrypted in place.
* @param buf the plaintext / ciphertext
* @param len the length of buf in bytes
*/
void cipher1(byte buf[], size_t len)
{ cipher(buf, buf, len); }
+ /**
+ * Encrypt a message
+ * The message is encrypted/decrypted in place.
+ * @param inout the plaintext / ciphertext
+ */
template<typename Alloc>
void encipher(std::vector<byte, Alloc>& inout)
{ cipher(inout.data(), inout.data(), inout.size()); }
+ /**
+ * Encrypt a message
+ * The message is encrypted in place.
+ * @param inout the plaintext / ciphertext
+ */
template<typename Alloc>
void encrypt(std::vector<byte, Alloc>& inout)
{ cipher(inout.data(), inout.data(), inout.size()); }
+ /**
+ * Decrypt a message in place
+ * The message is decrypted in place.
+ * @param inout the plaintext / ciphertext
+ */
template<typename Alloc>
void decrypt(std::vector<byte, Alloc>& inout)
{ cipher(inout.data(), inout.data(), inout.size()); }
@@ -76,7 +94,7 @@ class BOTAN_DLL StreamCipher : public SymmetricAlgorithm
virtual bool valid_iv_length(size_t iv_len) const { return (iv_len == 0); }
/**
- * Get a new object representing the same algorithm as *this
+ * @return a new object representing the same algorithm as *this
*/
virtual StreamCipher* clone() const = 0;