AnCH Framework 0.1
Another C++ Hack Framework
Loading...
Searching...
No Matches
anch::crypto::SHA1 Class Reference

SHA1 hash algorithm implementation. More...

#include <sha1.hpp>

Inheritance diagram for anch::crypto::SHA1:
Collaboration diagram for anch::crypto::SHA1:

Public Member Functions

 SHA1 ()
 SHA1 (const std::string &data)
 SHA1 (std::istream &stream)
virtual ~SHA1 ()
virtual const std::array< uint8_t, 20 > & digest () const override

Protected Member Functions

virtual void reset () override
virtual void addData (const uint8_t *data, std::size_t len) override
virtual void finalize () override

Friends

SHA1 anch::crypto::HMAC (const std::string &, const std::string &)

Additional Inherited Members

Static Public Member Functions inherited from anch::crypto::Hash< 20, 64 >
static constexpr std::size_t getOutputSize ()
static constexpr std::size_t getBlockSize ()
Protected Attributes inherited from anch::crypto::Hash< 20, 64 >
std::array< uint8_t, O > * _digest

Detailed Description

SHA1 hash algorithm implementation.

This algorithm is based on Qt framework algorithm.

Author
Vincent Lachenal

Constructor & Destructor Documentation

◆ SHA1() [1/3]

anch::crypto::SHA1::SHA1 ( )

SHA1 default constructor

◆ SHA1() [2/3]

anch::crypto::SHA1::SHA1 ( const std::string & data)

SHA1 constructor with string

Parameters
dataThe string data to process

◆ SHA1() [3/3]

anch::crypto::SHA1::SHA1 ( std::istream & stream)

SHA1 constructor with input stream.

Parameters
streamThe input stream to process

◆ ~SHA1()

virtual anch::crypto::SHA1::~SHA1 ( )
virtual

SHA1 destructor

Member Function Documentation

◆ addData()

virtual void anch::crypto::SHA1::addData ( const uint8_t * data,
std::size_t len )
overrideprotectedvirtual

Compute hash for data with the current hash

Parameters
dataThe data to add
lenThe data length

Implements anch::crypto::Hash< 20, 64 >.

◆ digest()

virtual const std::array< uint8_t, 20 > & anch::crypto::SHA1::digest ( ) const
overridevirtual

Get the SHA1 hash result

Returns
the SHA1 hash result

Implements anch::crypto::Hash< 20, 64 >.

◆ finalize()

virtual void anch::crypto::SHA1::finalize ( )
overrideprotectedvirtual

Finalize hash

Implements anch::crypto::Hash< 20, 64 >.

◆ reset()

virtual void anch::crypto::SHA1::reset ( )
overrideprotectedvirtual

Reset hash context

Implements anch::crypto::Hash< 20, 64 >.


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