ETSI STF525 / Internal Testing test suite
This project provides an internal testing test suite and its associated Test Adapter/Codec
Public Member Functions | Private Attributes | List of all members
sha256 Class Reference

This class provides description of SHA-256 helper methods. More...

#include <sha256.hh>

Public Member Functions

 sha256 ()
 SHA context. More...
 
virtual ~sha256 ()
 Default destructor. More...
 
int generate (const std::vector< unsigned char > p_buffer, std::vector< unsigned char > &p_hash)
 Receive bytes formated data from the lower layers. More...
 
int generate (const unsigned char *p_buffer, const size_t p_length, std::vector< unsigned char > &p_hash)
 

Private Attributes

SHA256_CTX _ctx
 

Detailed Description

This class provides description of SHA-256 helper methods.

Constructor & Destructor Documentation

◆ sha256()

sha256::sha256 ( )
inlineexplicit

SHA context.

Default constructor Create a new instance of the sha256 class

◆ ~sha256()

virtual sha256::~sha256 ( )
inlinevirtual

Default destructor.

Member Function Documentation

◆ generate() [1/2]

int sha256::generate ( const std::vector< unsigned char >  p_buffer,
std::vector< unsigned char > &  p_hash 
)
inline

Receive bytes formated data from the lower layers.

Parameters
[in]p_bufferThe data used to generate the SHA-256 hash
[out]p_hashThe SHA-256 hash value based of the provided data
Returns
0 on success, -1 otherwise
Parameters
[in]p_bufferThe data used to generate the SHA-256 hash
[in]Thelength of the data buffer
[out]p_hashThe SHA-256 hash value based of the provided data
Returns
0 on success, -1 otherwise

◆ generate() [2/2]

int sha256::generate ( const unsigned char *  p_buffer,
const size_t  p_length,
std::vector< unsigned char > &  p_hash 
)
inline

Member Data Documentation

◆ _ctx

SHA256_CTX sha256::_ctx
private

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