Botan
2.1.0
Crypto and TLS for C++11
|
#include <gmac.h>
Public Member Functions | |
void | clear () override |
MessageAuthenticationCode * | clone () const override |
void | final (uint8_t out[]) |
secure_vector< uint8_t > | final () |
template<typename Alloc > | |
void | final (std::vector< uint8_t, Alloc > &out) |
secure_vector< uint8_t > | final () |
std::vector< uint8_t > | final_stdvec () |
GMAC (BlockCipher *cipher) | |
GMAC (const GMAC &)=delete | |
Key_Length_Specification | key_spec () const override |
size_t | maximum_keylength () const |
size_t | maximum_keylength () const |
size_t | minimum_keylength () const |
size_t | minimum_keylength () const |
std::string | name () const override |
secure_vector< uint8_t > | nonce_hash (const uint8_t nonce[], size_t len) |
GMAC & | operator= (const GMAC &)=delete |
size_t | output_length () const override |
secure_vector< uint8_t > | process (const uint8_t in[], size_t length) |
secure_vector< uint8_t > | process (const secure_vector< uint8_t > &in) |
secure_vector< uint8_t > | process (const std::vector< uint8_t > &in) |
secure_vector< uint8_t > | process (const std::string &in) |
virtual std::string | provider () const |
void | reset () |
void | set_associated_data (const uint8_t ad[], size_t ad_len) |
void | set_key (const SymmetricKey &key) |
void | set_key (const SymmetricKey &key) |
template<typename Alloc > | |
void | set_key (const std::vector< uint8_t, Alloc > &key) |
template<typename Alloc > | |
void | set_key (const std::vector< uint8_t, Alloc > &key) |
void | set_key (const uint8_t key[], size_t length) |
void | set_key (const uint8_t key[], size_t length) |
void | start (const uint8_t nonce[], size_t nonce_len) |
void | start (const secure_vector< uint8_t > &nonce) |
void | start (const std::vector< uint8_t > &nonce) |
template<typename Alloc > | |
void | start (const std::vector< uint8_t, Alloc > &nonce) |
void | start () |
void | update (const uint8_t in[], size_t length) |
void | update (const secure_vector< uint8_t > &in) |
void | update (const std::vector< uint8_t > &in) |
void | update (const std::string &str) |
void | update (uint8_t in) |
void | update (const uint8_t in[], size_t len) |
template<typename T > | |
void | update_be (const T in) |
bool | valid_keylength (size_t length) const |
bool | valid_keylength (size_t length) const |
virtual bool | verify_mac (const uint8_t in[], size_t length) |
virtual bool | verify_mac (const std::vector< uint8_t > &in) |
virtual bool | verify_mac (const secure_vector< uint8_t > &in) |
Static Public Member Functions | |
static std::unique_ptr< MessageAuthenticationCode > | create (const std::string &algo_spec, const std::string &provider="") |
static std::unique_ptr< MessageAuthenticationCode > | create_or_throw (const std::string &algo_spec, const std::string &provider="") |
static std::vector< std::string > | providers (const std::string &algo_spec) |
Protected Member Functions | |
void | add_final_block (secure_vector< uint8_t > &x, size_t ad_len, size_t pt_len) |
void | ghash_update (secure_vector< uint8_t > &x, const uint8_t input[], size_t input_len) |
Protected Attributes | |
size_t | m_ad_len = 0 |
secure_vector< uint8_t > | m_ghash |
secure_vector< uint8_t > | m_H |
secure_vector< uint8_t > | m_H_ad |
|
explicit |
|
delete |
|
protectedinherited |
Definition at line 120 of file gcm.cpp.
References Botan::GHASH::ghash_update().
Referenced by Botan::GHASH::final(), and Botan::GHASH::nonce_hash().
|
overridevirtual |
Reset the state.
Implements Botan::SymmetricAlgorithm.
Definition at line 19 of file gmac.cpp.
References Botan::GHASH::clear(), Botan::GHASH::m_ghash, Botan::GHASH::m_H, and Botan::GHASH::m_H_ad.
|
overridevirtual |
Get a new object representing the same algorithm as *this
Implements Botan::MessageAuthenticationCode.
Definition at line 109 of file gmac.cpp.
References GMAC().
|
staticinherited |
Create an instance based on a name If provider is empty then best available is chosen.
algo_spec | algorithm name |
provider | provider implementation to use |
Definition at line 43 of file mac.cpp.
References Botan::SCAN_Name::algo_name(), Botan::SCAN_Name::arg(), Botan::SCAN_Name::arg_as_integer(), Botan::SCAN_Name::arg_count(), BOTAN_UNUSED, Botan::HashFunction::create(), and Botan::BlockCipher::create().
Referenced by botan_mac_init(), Botan::PBKDF::create(), Botan::KDF::create(), Botan::MessageAuthenticationCode::create_or_throw(), Botan::TLS::Session::decrypt(), Botan::TLS::Session::encrypt(), Botan::get_mac(), Botan::TLS::Hello_Verify_Request::Hello_Verify_Request(), Botan::make_message_auth(), and Botan::RFC6979_Nonce_Generator::RFC6979_Nonce_Generator().
|
staticinherited |
Definition at line 138 of file mac.cpp.
References Botan::MessageAuthenticationCode::create().
Referenced by Botan::AutoSeeded_RNG::AutoSeeded_RNG(), Botan::ECIES_System_Params::create_mac(), and Botan::TLS::TLS_CBC_HMAC_AEAD_Mode::TLS_CBC_HMAC_AEAD_Mode().
|
inlineinherited |
Complete the computation and retrieve the final result.
out | The byte array to be filled with the result. Must be of length output_length() |
Definition at line 89 of file buf_comp.h.
Referenced by botan_hash_final(), botan_mac_final(), Botan::TLS::TLS_CBC_HMAC_AEAD_Encryption::finish(), Botan::TLS::TLS_CBC_HMAC_AEAD_Decryption::finish(), Botan::mgf1_mask(), and Botan::pbkdf2().
|
inlineinherited |
Complete the computation and retrieve the final result.
Definition at line 96 of file buf_comp.h.
|
inlineinherited |
Definition at line 111 of file buf_comp.h.
|
inherited |
Definition at line 128 of file gcm.cpp.
References Botan::GHASH::add_final_block(), Botan::GHASH::m_ad_len, and Botan::GHASH::m_ghash.
|
inlineinherited |
Definition at line 103 of file buf_comp.h.
|
protectedinherited |
Definition at line 69 of file gcm.cpp.
References Botan::CT::min(), and Botan::xor_buf().
Referenced by Botan::GHASH::add_final_block(), Botan::GHASH::nonce_hash(), Botan::GHASH::set_associated_data(), and Botan::GHASH::update().
|
inlineoverridevirtual |
Implements Botan::SymmetricAlgorithm.
|
inlineinherited |
Definition at line 39 of file sym_algo.h.
|
inlineinherited |
Definition at line 39 of file sym_algo.h.
|
inlineinherited |
Definition at line 47 of file sym_algo.h.
|
inlineinherited |
Definition at line 47 of file sym_algo.h.
|
overridevirtual |
Implements Botan::SymmetricAlgorithm.
|
inherited |
Definition at line 140 of file gcm.cpp.
References Botan::GHASH::add_final_block(), BOTAN_ASSERT, Botan::GHASH::ghash_update(), and Botan::GHASH::m_ghash.
|
overridevirtual |
Implements Botan::Buffered_Computation.
|
inlineinherited |
Update and finalize computation. Does the same as calling update() and final() consecutively.
in | the input to process as a byte array |
length | the length of the byte array |
Definition at line 124 of file buf_comp.h.
Referenced by Botan::RTSS_Share::split().
|
inlineinherited |
Update and finalize computation. Does the same as calling update() and final() consecutively.
in | the input to process |
Definition at line 136 of file buf_comp.h.
|
inlineinherited |
Update and finalize computation. Does the same as calling update() and final() consecutively.
in | the input to process |
Definition at line 148 of file buf_comp.h.
|
inlineinherited |
Update and finalize computation. Does the same as calling update() and final() consecutively.
in | the input to process as a string |
Definition at line 160 of file buf_comp.h.
|
inlinevirtualinherited |
|
staticinherited |
Definition at line 131 of file mac.cpp.
Referenced by Botan::get_mac_providers().
|
inherited |
Definition at line 157 of file gcm.cpp.
References Botan::GHASH::m_ad_len, Botan::GHASH::m_ghash, Botan::GHASH::m_H_ad, and Botan::zeroise().
Referenced by Botan::GHASH::clear().
|
inherited |
Definition at line 103 of file gcm.cpp.
References Botan::GHASH::ghash_update(), Botan::GHASH::m_ad_len, Botan::GHASH::m_H_ad, and Botan::zeroise().
|
inlineinherited |
Set the symmetric key of this object.
key | the SymmetricKey to be set. |
Definition at line 66 of file sym_algo.h.
References Botan::OctetString::begin(), and Botan::OctetString::length().
Referenced by Botan::aont_package(), Botan::aont_unpackage(), botan_block_cipher_set_key(), botan_mac_set_key(), and Botan::pbkdf2().
|
inlineinherited |
Set the symmetric key of this object.
key | the SymmetricKey to be set. |
Definition at line 66 of file sym_algo.h.
References Botan::OctetString::begin(), and Botan::OctetString::length().
Referenced by Botan::aont_package(), Botan::aont_unpackage(), botan_block_cipher_set_key(), botan_mac_set_key(), and Botan::pbkdf2().
|
inlineinherited |
Definition at line 72 of file sym_algo.h.
|
inlineinherited |
Definition at line 72 of file sym_algo.h.
|
inlineinherited |
Set the symmetric key of this object.
key | the to be set as a byte array. |
length | in bytes of key param |
Definition at line 82 of file sym_algo.h.
|
inlineinherited |
Set the symmetric key of this object.
key | the to be set as a byte array. |
length | in bytes of key param |
Definition at line 82 of file sym_algo.h.
void Botan::GMAC::start | ( | const uint8_t | nonce[], |
size_t | nonce_len | ||
) |
Must be called to set the initialization vector prior to GMAC calculation.
nonce | Initialization vector. |
nonce_len | size of initialization vector. |
void Botan::GMAC::start | ( | const secure_vector< uint8_t > & | nonce | ) |
Must be called to set the initialization vector prior to GMAC calculation.
nonce | Initialization vector. |
void Botan::GMAC::start | ( | const std::vector< uint8_t > & | nonce | ) |
Must be called to set the initialization vector prior to GMAC calculation.
nonce | Initialization vector. |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Add new input to process.
in | the input to process as a byte array |
length | of param in in bytes |
Definition at line 34 of file buf_comp.h.
Referenced by botan_hash_update(), botan_mac_update(), Botan::TLS::TLS_CBC_HMAC_AEAD_Encryption::finish(), Botan::TLS::TLS_CBC_HMAC_AEAD_Decryption::finish(), Botan::mgf1_mask(), and Botan::pbkdf2().
|
inlineinherited |
Add new input to process.
in | the input to process as a secure_vector |
Definition at line 40 of file buf_comp.h.
|
inlineinherited |
Add new input to process.
in | the input to process as a std::vector |
Definition at line 49 of file buf_comp.h.
|
inlineinherited |
Add new input to process.
str | the input to process as a std::string. Will be interpreted as a byte array based on the strings encoding. |
Definition at line 72 of file buf_comp.h.
|
inlineinherited |
|
inherited |
Definition at line 111 of file gcm.cpp.
References BOTAN_ASSERT, Botan::GHASH::ghash_update(), and Botan::GHASH::m_ghash.
|
inlineinherited |
Add an integer in big-endian order
in | the value |
Definition at line 58 of file buf_comp.h.
References Botan::get_byte().
Referenced by Botan::mgf1_mask(), and Botan::pbkdf2().
|
inlineinherited |
Check whether a given key length is valid for this algorithm.
length | the key length to be checked. |
Definition at line 57 of file sym_algo.h.
Referenced by Botan::aont_package(), and Botan::aont_unpackage().
|
inlineinherited |
Check whether a given key length is valid for this algorithm.
length | the key length to be checked. |
Definition at line 57 of file sym_algo.h.
Referenced by Botan::aont_package(), and Botan::aont_unpackage().
|
virtualinherited |
Verify a MAC.
in | the MAC to verify as a byte array |
length | the length of param in |
Definition at line 151 of file mac.cpp.
References Botan::same_mem().
|
inlinevirtualinherited |
Verify a MAC.
in | the MAC to verify as a byte array |
Definition at line 115 of file mac.h.
|
inlinevirtualinherited |
Verify a MAC.
in | the MAC to verify as a byte array |
Definition at line 125 of file mac.h.
|
protectedinherited |
Definition at line 147 of file gcm.h.
Referenced by Botan::GHASH::final(), Botan::GHASH::reset(), and Botan::GHASH::set_associated_data().
|
protectedinherited |
Definition at line 146 of file gcm.h.
Referenced by clear(), Botan::GHASH::final(), Botan::GHASH::nonce_hash(), Botan::GHASH::reset(), Botan::GHASH::start(), and Botan::GHASH::update().
|
protectedinherited |
Definition at line 144 of file gcm.h.
Referenced by clear(), and Botan::GHASH::clear().
|
protectedinherited |
Definition at line 145 of file gcm.h.
Referenced by clear(), Botan::GHASH::reset(), Botan::GHASH::set_associated_data(), and Botan::GHASH::start().