diff options
author | René Korthaus <[email protected]> | 2016-10-16 14:04:04 +0200 |
---|---|---|
committer | René Korthaus <[email protected]> | 2016-10-19 09:13:23 +0200 |
commit | ae74d71df63abee42875d0f7bcef799808476b48 (patch) | |
tree | 9debca0e738665ef94a5a744a749b0ea1c6d2625 /src/lib/modes/aead | |
parent | fd741ac1ef348cc3f843fbf22aca698f86e87dbf (diff) |
Improve modes doxygen [ci skip]
Diffstat (limited to 'src/lib/modes/aead')
-rw-r--r-- | src/lib/modes/aead/aead.h | 24 | ||||
-rw-r--r-- | src/lib/modes/aead/siv/siv.h | 6 |
2 files changed, 28 insertions, 2 deletions
diff --git a/src/lib/modes/aead/aead.h b/src/lib/modes/aead/aead.h index 3214187db..0769a1829 100644 --- a/src/lib/modes/aead/aead.h +++ b/src/lib/modes/aead/aead.h @@ -38,12 +38,30 @@ class BOTAN_DLL AEAD_Mode : public Cipher_Mode */ virtual void set_associated_data(const byte ad[], size_t ad_len) = 0; + /** + * Set associated data that is not included in the ciphertext but + * that should be authenticated. Must be called after set_key and + * before start. + * + * See @ref set_associated_data(). + * + * @param ad the associated data + */ template<typename Alloc> void set_associated_data_vec(const std::vector<byte, Alloc>& ad) { set_associated_data(ad.data(), ad.size()); } + /** + * Set associated data that is not included in the ciphertext but + * that should be authenticated. Must be called after set_key and + * before start. + * + * See @ref set_associated_data(). + * + * @param ad the associated data + */ template<typename Alloc> void set_ad(const std::vector<byte, Alloc>& ad) { @@ -51,8 +69,8 @@ class BOTAN_DLL AEAD_Mode : public Cipher_Mode } /** - * Default AEAD nonce size (a commonly supported value among AEAD - * modes, and large enough that random collisions are unlikely). + * @return default AEAD nonce size (a commonly supported value among AEAD + * modes, and large enough that random collisions are unlikely) */ size_t default_nonce_length() const override { return 12; } @@ -61,6 +79,8 @@ class BOTAN_DLL AEAD_Mode : public Cipher_Mode /** * Get an AEAD mode by name (eg "AES-128/GCM" or "Serpent/EAX") +* @param name AEAD name +* @param direction ENCRYPTION or DECRYPTION */ BOTAN_DLL AEAD_Mode* get_aead(const std::string& name, Cipher_Dir direction); diff --git a/src/lib/modes/aead/siv/siv.h b/src/lib/modes/aead/siv/siv.h index 6acfe515a..ca3e7df37 100644 --- a/src/lib/modes/aead/siv/siv.h +++ b/src/lib/modes/aead/siv/siv.h @@ -23,6 +23,12 @@ class BOTAN_DLL SIV_Mode : public AEAD_Mode public: size_t process(uint8_t buf[], size_t size) override; + /** + * Sets the nth element of the vector of associated data + * @param n index into the AD vector + * @param ad associated data + * @param ad_len length of associated data in bytes + */ void set_associated_data_n(size_t n, const byte ad[], size_t ad_len); void set_associated_data(const byte ad[], size_t ad_len) override |