parallel_hash_xof.h File Reference

ParallelHashXOF (ParallelHash with arbitrary-length output) More...

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

Go to the source code of this file.

Data Structures

struct  ParallelHashXofContext
 ParallelHashXOF algorithm context. More...
 

Functions

error_t parallelHashXofCompute (uint_t strength, size_t blockSize, const void *input, size_t inputLen, const char_t *custom, size_t customLen, uint8_t *output, size_t outputLen)
 Digest a message using ParallelHashXOF. More...
 
error_t parallelHashXofInit (ParallelHashXofContext *context, uint_t strength, size_t blockSize, const char_t *custom, size_t customLen)
 Initialize ParallelHashXOF context. More...
 
void parallelHashXofAbsorb (ParallelHashXofContext *context, const void *input, size_t length)
 Absorb data. More...
 
void parallelHashXofFinal (ParallelHashXofContext *context)
 Finish absorbing phase. More...
 
void parallelHashXofSqueeze (ParallelHashXofContext *context, uint8_t *output, size_t length)
 Extract data from the squeezing phase. More...
 

Detailed Description

ParallelHashXOF (ParallelHash 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 parallel_hash_xof.h.

Function Documentation

◆ parallelHashXofAbsorb()

void parallelHashXofAbsorb ( ParallelHashXofContext *  context,
const void *  input,
size_t  length 
)

Absorb data.

Parameters
[in]contextPointer to the ParallelHashXOF context
[in]dataPointer to the input string
[in]dataLenLength of the string

Definition at line 169 of file parallel_hash_xof.c.

◆ parallelHashXofCompute()

error_t parallelHashXofCompute ( uint_t  strength,
size_t  blockSize,
const void *  input,
size_t  inputLen,
const char_t *  custom,
size_t  customLen,
uint8_t *  output,
size_t  outputLen 
)

Digest a message using ParallelHashXOF.

Parameters
[in]strengthNumber of bits of security (128 for ParallelHashXOF128 and 256 for ParallelHashXOF256)
[in]blockSizeBlock size in bytes for parallel hashing (B)
[in]inputPointer to the input string (X)
[in]inputLenLength of the input string
[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 52 of file parallel_hash_xof.c.

◆ parallelHashXofFinal()

void parallelHashXofFinal ( ParallelHashXofContext *  context)

Finish absorbing phase.

Parameters
[in]contextPointer to the ParallelHashXOF context

Definition at line 217 of file parallel_hash_xof.c.

◆ parallelHashXofInit()

error_t parallelHashXofInit ( ParallelHashXofContext *  context,
uint_t  strength,
size_t  blockSize,
const char_t *  custom,
size_t  customLen 
)

Initialize ParallelHashXOF context.

Parameters
[in]contextPointer to the ParallelHashXOF context to initialize
[in]strengthNumber of bits of security (128 for ParallelHashXOF128 and 256 for ParallelHashXOF256)
[in]blockSizeBlock size in bytes for parallel hashing (B)
[in]customCustomization string (S)
[in]customLenLength of the customization string
Returns
Error code

Definition at line 114 of file parallel_hash_xof.c.

◆ parallelHashXofSqueeze()

void parallelHashXofSqueeze ( ParallelHashXofContext *  context,
uint8_t *  output,
size_t  length 
)

Extract data from the squeezing phase.

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

Definition at line 243 of file parallel_hash_xof.c.