Botan 3.0.0-alpha0
Crypto and TLS for C&
Public Member Functions | List of all members
Botan::TLS::Handshake_Hash Class Referencefinal

#include <tls_handshake_hash.h>

Public Member Functions

secure_vector< uint8_t > final (const std::string &mac_algo) const
 
const std::vector< uint8_t > & get_contents () const
 
void reset ()
 
void update (const std::vector< uint8_t > &in)
 
void update (const uint8_t in[], size_t length)
 

Detailed Description

TLS Handshake Hash

Definition at line 21 of file tls_handshake_hash.h.

Member Function Documentation

◆ final()

secure_vector< uint8_t > Botan::TLS::Handshake_Hash::final ( const std::string &  mac_algo) const

Return a TLS Handshake Hash

Definition at line 16 of file tls_handshake_hash.cpp.

17 {
18 std::string hash_algo = mac_algo;
19 if(mac_algo == "SHA-1")
20 hash_algo = "SHA-256";
21
22 std::unique_ptr<HashFunction> hash(HashFunction::create_or_throw(hash_algo));
23 hash->update(m_data);
24 return hash->final();
25 }
static std::unique_ptr< HashFunction > create_or_throw(const std::string &algo_spec, const std::string &provider="")
Definition: hash.cpp:312
MechanismType hash
AlgorithmIdentifier hash_algo
Definition: x509_obj.cpp:22

References Botan::HashFunction::create_or_throw(), hash, and hash_algo.

Referenced by Botan::TLS::Session_Keys::Session_Keys().

◆ get_contents()

const std::vector< uint8_t > & Botan::TLS::Handshake_Hash::get_contents ( ) const
inline

◆ reset()

void Botan::TLS::Handshake_Hash::reset ( )
inline

◆ update() [1/2]

void Botan::TLS::Handshake_Hash::update ( const std::vector< uint8_t > &  in)
inline

Definition at line 27 of file tls_handshake_hash.h.

28 { m_data += in; }

◆ update() [2/2]

void Botan::TLS::Handshake_Hash::update ( const uint8_t  in[],
size_t  length 
)
inline

The documentation for this class was generated from the following files: