Belle II Software  release-08-01-10
SHA3Hash Class Reference

Simple interface to calculate SHA3 hash sum (FIPS 202 draft) with fixed size from given data inputs. More...

#include <Hash.h>

Collaboration diagram for SHA3Hash:

Public Types

enum  EHashMode {
  c_SHA3_224 = 224 / 8 ,
  c_SHA3_256 = 256 / 8 ,
  c_SHA3_384 = 384 / 8 ,
  c_SHA3_512 = 512 / 8
}
 Available hash modes according to FIPS 202 draft. More...
 

Public Member Functions

 SHA3Hash (EHashMode length)
 Constructor initializing the hash structure with a given output size.
 
 SHA3Hash (const SHA3Hash &)=delete
 No copying.
 
 ~SHA3Hash ()
 destructor freeing the memory
 
void clear ()
 reinit the hash structure to create a new hash sum
 
void update (int n, unsigned char *buff)
 update the internal state by adding n bytes of data from buff
 
void getHash (unsigned char *buff)
 obtain the hash value into buff. More...
 
std::vector< unsigned char > getHash ()
 obtain the hash value as a vector of unsigned char
 

Private Attributes

KeccakHashInstancem_instance
 memory structure to calculate the hash value
 
EHashMode m_mode
 chosen hash mode
 

Detailed Description

Simple interface to calculate SHA3 hash sum (FIPS 202 draft) with fixed size from given data inputs.

Definition at line 23 of file Hash.h.

Member Enumeration Documentation

◆ EHashMode

enum EHashMode

Available hash modes according to FIPS 202 draft.

Enumerator
c_SHA3_256 

224bit output size

c_SHA3_384 

256bit output size

c_SHA3_512 

384bit output size

Definition at line 26 of file Hash.h.

26  {
27  c_SHA3_224 = 224 / 8,
28  c_SHA3_256 = 256 / 8,
29  c_SHA3_384 = 384 / 8,
30  c_SHA3_512 = 512 / 8
31  };
@ c_SHA3_512
384bit output size
Definition: Hash.h:30
@ c_SHA3_384
256bit output size
Definition: Hash.h:29
@ c_SHA3_256
224bit output size
Definition: Hash.h:28

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