iota.lib.cpp
IOTA C++ Library
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
IOTA::Crypto::Keccak384 Class Reference

#include <keccak384.hpp>

Public Member Functions

void reset ()
 
void absorb (const uint8_t *bytes, size_t size=hashBitLength/8)
 
void squeeze (uint8_t *bytes)
 

Static Public Attributes

static constexpr unsigned int rate = 832
 
static constexpr unsigned int capacity = 768
 
static constexpr unsigned int hashBitLength = 384
 
static constexpr unsigned int delimitedSuffix = 0x01
 

Protected Member Functions

virtual bool hashUpdate (const uint8_t *bytes, size_t size)
 
virtual bool hashSqueeze (uint8_t *bytes)
 
virtual bool hashInitialize (void)
 

Detailed Description

Keccak sponge construction with a 384 bits output.

Member Function Documentation

◆ absorb()

void IOTA::Crypto::Keccak384::absorb ( const uint8_t *  bytes,
size_t  size = hashBitLength/8 
)

Absorb the given bytes into the internal state of the sponge.

Parameters
bytesThe bytes.
sizeThe number of bytes.

◆ hashInitialize()

virtual bool IOTA::Crypto::Keccak384::hashInitialize ( void  )
protectedvirtual

Keccak_HashInitialize wrapper to allow mock testing.

Returns
The initialization status.

◆ hashSqueeze()

virtual bool IOTA::Crypto::Keccak384::hashSqueeze ( uint8_t *  bytes)
protectedvirtual

Keccak_HashSqueeze wrapper to allow mock testing.

Parameters
bytesBytes where to squeeze out the internal state of the sponge.
Returns
The squeeze status.

◆ hashUpdate()

virtual bool IOTA::Crypto::Keccak384::hashUpdate ( const uint8_t *  bytes,
size_t  size 
)
protectedvirtual

Keccak_HashUpdate wrapper to allow mock testing.

Parameters
bytesBytes to be absorbed into the internal state of the sponge.
Returns
The update status.

◆ reset()

void IOTA::Crypto::Keccak384::reset ( )

Reset internal state of the sponge.

◆ squeeze()

void IOTA::Crypto::Keccak384::squeeze ( uint8_t *  bytes)

Squeeze out bytes from the internal state of the sponge into the given bytes.

Parameters
bytesThe bytes.

Member Data Documentation

◆ capacity

constexpr unsigned int IOTA::Crypto::Keccak384::capacity = 768
static

The value of the capacity c (size of the part that is untouched by input/output).

◆ delimitedSuffix

constexpr unsigned int IOTA::Crypto::Keccak384::delimitedSuffix = 0x01
static

Bits that will be automatically appended to the end of the input message, as in domain separation.

◆ hashBitLength

constexpr unsigned int IOTA::Crypto::Keccak384::hashBitLength = 384
static

The desired number of output bits.

◆ rate

constexpr unsigned int IOTA::Crypto::Keccak384::rate = 832
static

The value of the rate r (size of the part of the state that is written and read).


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