diff options
author | René Korthaus <[email protected]> | 2016-10-16 17:19:18 +0200 |
---|---|---|
committer | René Korthaus <[email protected]> | 2016-10-19 09:13:34 +0200 |
commit | 446f2a0289cca0de11e748e73071a39c06940239 (patch) | |
tree | c22651dea9e9505341e92fbb33d7b488b6444980 /src/lib/stream | |
parent | a08e0160301f20e4f5d620a146a1556e0ac7c95d (diff) |
Improve stream doxygen [ci skip]
Diffstat (limited to 'src/lib/stream')
-rw-r--r-- | src/lib/stream/chacha/chacha.h | 3 | ||||
-rw-r--r-- | src/lib/stream/stream_cipher.h | 26 |
2 files changed, 24 insertions, 5 deletions
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; |