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

#include <kerl.hpp>

Public Member Functions

void reset ()
 
void absorb (const std::vector< uint8_t > &bytes, std::size_t offset=0, std::size_t length=0)
 
void squeeze (std::vector< uint8_t > &bytes, std::size_t offset=0)
 
void finalSqueeze (std::vector< uint8_t > &bytes, std::size_t offset=0)
 

Detailed Description

Hashing algorithm, based on keccak. Trits are absorbed by the sponge function and later squeezed to provide message digest, derive keys etc.

Member Function Documentation

◆ absorb()

void IOTA::Crypto::Kerl::absorb ( const std::vector< uint8_t > &  bytes,
std::size_t  offset = 0,
std::size_t  length = 0 
)

Absorb the input bytes into the current state of the sponge.

Parameters
bytesInput bytes to be absorbed on current state of the sponge.
offsetOffset at which the current state of the sponge should be modified.
lengthLength of the given input that should be used for absorption.

◆ finalSqueeze()

void IOTA::Crypto::Kerl::finalSqueeze ( std::vector< uint8_t > &  bytes,
std::size_t  offset = 0 
)

Squeeze the final current state of the sponge to the given trits. Kerl should not be used after this function is called, unless it is reset.

Parameters
bytesBytes to be squeezed based on current state of the sponge.
offsetOffset at which the bytes should be modified.

◆ reset()

void IOTA::Crypto::Kerl::reset ( )

Reset current state of the sponge.

◆ squeeze()

void IOTA::Crypto::Kerl::squeeze ( std::vector< uint8_t > &  bytes,
std::size_t  offset = 0 
)

Squeeze the current state of the sponge to the given trits.

Parameters
bytesBytes to be squeezed based on current state of the sponge.
offsetOffset at which the bytes should be modified.

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