Skip to content

Struct TrueKeccak

ClassList > TrueKeccak

WV: turned this in a class for lazy inlining. More...

  • #include <libkeccak.h>

Public Types

Type Name
typedef uint64_t UINT64
typedef uint8_t UINT8
typedef UINT64 tKeccakLane

Public Functions

Type Name
void FIPS202_SHA3_224 (const uint8_t * input, unsigned int inputByteLen, uint8_t * output)
void FIPS202_SHA3_256 (const uint8_t * input, unsigned int inputByteLen, uint8_t * output)
void FIPS202_SHA3_384 (const uint8_t * input, unsigned int inputByteLen, uint8_t * output)
void FIPS202_SHA3_512 (const uint8_t * input, unsigned int inputByteLen, uint8_t * output)
void FIPS202_SHAKE128 (const uint8_t * input, unsigned int inputByteLen, uint8_t * output, int outputByteLen)
void FIPS202_SHAKE256 (const uint8_t * input, unsigned int inputByteLen, uint8_t * output, int outputByteLen)
void Keccak (unsigned int rate, unsigned int capacity, const uint8_t * input, unsigned long long int inputByteLen, uint8_t delimitedSuffix, uint8_t * output, unsigned long long int outputByteLen)
void KeccakF1600_StatePermute (void * state)
int LFSR86540 (UINT8 * LFSR)

Public Static Functions

Type Name
UINT64 load64 (const UINT8 * x)
void store64 (UINT8 * x, UINT64 u)
void xor64 (UINT8 * x, UINT64 u)

Detailed Description

Function to compute the Keccak[r, c] sponge function over a given input.

Parameters:

  • rate The value of the rate r.
  • capacity The value of the capacity c.
  • input Pointer to the input message.
  • inputByteLen The number of input bytes provided in the input message.
  • delimitedSuffix Bits that will be automatically appended to the end of the input message, as in domain separation. This is a byte containing from 0 to 7 bits These n bits must be in the least significant bit positions and must be delimited with a bit 1 at position n (counting from 0=LSB to 7=MSB) and followed by bits 0 from position n+1 to position 7. Some examples:
  • If no bits are to be appended, then delimitedSuffix must be 0x01.
  • If the 2-bit sequence 0,1 is to be appended (as for SHA3-*), delimitedSuffix must be 0x06.
  • If the 4-bit sequence 1,1,1,1 is to be appended (as for SHAKE*), delimitedSuffix must be 0x1F.
  • If the 7-bit sequence 1,1,0,1,0,0,0 is to be absorbed, delimitedSuffix must be 0x8B.

  • output Pointer to the buffer where to store the output.

  • outputByteLen The number of output bytes desired.

Precondition:

One must have r+c=1600 and the rate a multiple of 8 bits in this implementation.

Public Types Documentation

typedef UINT64

typedef uint64_t TrueKeccak::UINT64;

typedef UINT8

typedef uint8_t TrueKeccak::UINT8;

typedef tKeccakLane

typedef UINT64 TrueKeccak::tKeccakLane;

Public Functions Documentation

function FIPS202_SHA3_224

inline void TrueKeccak::FIPS202_SHA3_224 (
    const uint8_t * input,
    unsigned int inputByteLen,
    uint8_t * output
) 

Function to compute SHA3-224 on the input message. The output length is fixed to 28 bytes.


function FIPS202_SHA3_256

inline void TrueKeccak::FIPS202_SHA3_256 (
    const uint8_t * input,
    unsigned int inputByteLen,
    uint8_t * output
) 

Function to compute SHA3-256 on the input message. The output length is fixed to 32 bytes.


function FIPS202_SHA3_384

inline void TrueKeccak::FIPS202_SHA3_384 (
    const uint8_t * input,
    unsigned int inputByteLen,
    uint8_t * output
) 

Function to compute SHA3-384 on the input message. The output length is fixed to 48 bytes.


function FIPS202_SHA3_512

inline void TrueKeccak::FIPS202_SHA3_512 (
    const uint8_t * input,
    unsigned int inputByteLen,
    uint8_t * output
) 

Function to compute SHA3-512 on the input message. The output length is fixed to 64 bytes.


function FIPS202_SHAKE128

inline void TrueKeccak::FIPS202_SHAKE128 (
    const uint8_t * input,
    unsigned int inputByteLen,
    uint8_t * output,
    int outputByteLen
) 

Function to compute SHAKE128 on the input message with any output length.


function FIPS202_SHAKE256

inline void TrueKeccak::FIPS202_SHAKE256 (
    const uint8_t * input,
    unsigned int inputByteLen,
    uint8_t * output,
    int outputByteLen
) 

Function to compute SHAKE256 on the input message with any output length.


function Keccak

inline void TrueKeccak::Keccak (
    unsigned int rate,
    unsigned int capacity,
    const uint8_t * input,
    unsigned long long int inputByteLen,
    uint8_t delimitedSuffix,
    uint8_t * output,
    unsigned long long int outputByteLen
) 

function KeccakF1600_StatePermute

inline void TrueKeccak::KeccakF1600_StatePermute (
    void * state
) 

Function that computes the Keccak-f[1600] permutation on the given state.


function LFSR86540

inline int TrueKeccak::LFSR86540 (
    UINT8 * LFSR
) 

Function that computes the linear feedback shift register (LFSR) used to define the round constants (see [Keccak Reference, Section 1.2]).


Public Static Functions Documentation

function load64

static inline UINT64 TrueKeccak::load64 (
    const UINT8 * x
) 

Function to load a 64-bit value using the little-endian (LE) convention. On a LE platform, this could be greatly simplified using a cast.


function store64

static inline void TrueKeccak::store64 (
    UINT8 * x,
    UINT64 u
) 

Function to store a 64-bit value using the little-endian (LE) convention. On a LE platform, this could be greatly simplified using a cast.


function xor64

static inline void TrueKeccak::xor64 (
    UINT8 * x,
    UINT64 u
) 

Function to XOR into a 64-bit value using the little-endian (LE) convention. On a LE platform, this could be greatly simplified using a cast.



The documentation for this class was generated from the following file cosmolatticeweb/tmp/code_source/templat/include/TempLat/util/hash/libkeccak.h