tuple_hash_xof.h File Reference

TupleHashXOF (TupleHash with arbitrary-length output) More...

#include "core/crypto.h"
#include "xof/cshake.h"

Go to the source code of this file.

Data Structures

struct  TupleHashXofContext
 TupleHashXOF algorithm context. More...
 

Functions

error_t tupleHashXofCompute (uint_t strength, const DataFrag *inputFrags, uint_t inputNumFrags, const char_t *custom, size_t customLen, uint8_t *output, size_t outputLen)
 Digest a message using TupleHashXOF. More...
 
error_t tupleHashXofInit (TupleHashXofContext *context, uint_t strength, const char_t *custom, size_t customLen)
 Initialize TupleHashXOF context. More...
 
void tupleHashXofAbsorb (TupleHashXofContext *context, const void *input, size_t length)
 Absorb data. More...
 
void tupleHashXofFinal (TupleHashXofContext *context)
 Finish absorbing phase. More...
 
void tupleHashXofSqueeze (TupleHashXofContext *context, uint8_t *output, size_t length)
 Extract data from the squeezing phase. More...
 

Detailed Description

TupleHashXOF (TupleHash with arbitrary-length output)

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2026 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneCRYPTO Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.6.6

Definition in file tuple_hash_xof.h.

Function Documentation

◆ tupleHashXofAbsorb()

void tupleHashXofAbsorb ( TupleHashXofContext *  context,
const void *  input,
size_t  length 
)

Absorb data.

Parameters
[in]contextPointer to the TupleHashXOF context
[in]inputPointer to the input string
[in]lengthLength of the string

Definition at line 141 of file tuple_hash_xof.c.

◆ tupleHashXofCompute()

error_t tupleHashXofCompute ( uint_t  strength,
const DataFrag *  inputFrags,
uint_t  inputNumFrags,
const char_t *  custom,
size_t  customLen,
uint8_t *  output,
size_t  outputLen 
)

Digest a message using TupleHashXOF.

Parameters
[in]strengthNumber of bits of security (128 for TupleHashXOF128 and 256 for TupleHashXOF256)
[in]keyPointer to the secret key (K)
[in]keyLenLength of the secret key
[in]inputFragsTuple of input strings (X)
[in]inputNumFragsNumber of input strings in the tuple (n)
[in]customCustomization string (S)
[in]customLenLength of the customization string
[out]outputPointer to the output data
[in]outputLenExpected length of the output data (L)
Returns
Error code

Definition at line 53 of file tuple_hash_xof.c.

◆ tupleHashXofFinal()

void tupleHashXofFinal ( TupleHashXofContext *  context)

Finish absorbing phase.

Parameters
[in]contextPointer to the TupleHashXOF context

Definition at line 159 of file tuple_hash_xof.c.

◆ tupleHashXofInit()

error_t tupleHashXofInit ( TupleHashXofContext *  context,
uint_t  strength,
const char_t *  custom,
size_t  customLen 
)

Initialize TupleHashXOF context.

Parameters
[in]contextPointer to the TupleHashXOF context to initialize
[in]strengthNumber of bits of security (128 for TupleHashXOF128 and 256 for TupleHashXOF256)
[in]customCustomization string (S)
[in]customLenLength of the customization string
Returns
Error code

Definition at line 119 of file tuple_hash_xof.c.

◆ tupleHashXofSqueeze()

void tupleHashXofSqueeze ( TupleHashXofContext *  context,
uint8_t *  output,
size_t  length 
)

Extract data from the squeezing phase.

Parameters
[in]contextPointer to the TupleHashXOF context
[out]outputOutput string
[in]lengthDesired output length, in bytes

Definition at line 181 of file tuple_hash_xof.c.