cSHAKE128 and cSHAKE256 (customizable SHAKE function) More...
Go to the source code of this file.
| Data Structures | |
| struct | CshakeContext | 
| cSHAKE algorithm context  More... | |
| Functions | |
| error_t | cshakeCompute (uint_t strength, const void *input, size_t inputLen, const char_t *name, size_t nameLen, const char_t *custom, size_t customLen, uint8_t *output, size_t outputLen) | 
| Digest a message using cSHAKE128 or cSHAKE256.  More... | |
| error_t | cshakeInit (CshakeContext *context, uint_t strength, const char_t *name, size_t nameLen, const char_t *custom, size_t customLen) | 
| Initialize cSHAKE context.  More... | |
| void | cshakeAbsorb (CshakeContext *context, const void *input, size_t length) | 
| Absorb data.  More... | |
| void | cshakeFinal (CshakeContext *context) | 
| Finish absorbing phase.  More... | |
| void | cshakeSqueeze (CshakeContext *context, uint8_t *output, size_t length) | 
| Extract data from the squeezing phase.  More... | |
| void | cshakeLeftEncode (size_t value, uint8_t *buffer, size_t *length) | 
| Encode integer as byte string.  More... | |
Detailed Description
cSHAKE128 and cSHAKE256 (customizable SHAKE function)
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2025 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.
- Version
- 2.5.4
Definition in file cshake.h.
Function Documentation
◆ cshakeAbsorb()
| void cshakeAbsorb | ( | CshakeContext * | context, | 
| const void * | input, | ||
| size_t | length | ||
| ) | 
◆ cshakeCompute()
| error_t cshakeCompute | ( | uint_t | strength, | 
| const void * | input, | ||
| size_t | inputLen, | ||
| const char_t * | name, | ||
| size_t | nameLen, | ||
| const char_t * | custom, | ||
| size_t | customLen, | ||
| uint8_t * | output, | ||
| size_t | outputLen | ||
| ) | 
Digest a message using cSHAKE128 or cSHAKE256.
- Parameters
- 
  [in] strength Number of bits of security (128 for cSHAKE128 and 256 for cSHAKE256) [in] input Pointer to the input data (X) [in] inputLen Length of the input data [in] name Function name (N) [in] nameLen Length of the function name [in] custom Customization string (S) [in] customLen Length of the customization string [out] output Pointer to the output data [in] outputLen Expected length of the output data (L) 
- Returns
- Error code
◆ cshakeFinal()
| void cshakeFinal | ( | CshakeContext * | context | ) | 
◆ cshakeInit()
| error_t cshakeInit | ( | CshakeContext * | context, | 
| uint_t | strength, | ||
| const char_t * | name, | ||
| size_t | nameLen, | ||
| const char_t * | custom, | ||
| size_t | customLen | ||
| ) | 
Initialize cSHAKE context.
- Parameters
- 
  [in] context Pointer to the cSHAKE context to initialize [in] strength Number of bits of security (128 for cSHAKE128 and 256 for cSHAKE256) [in] name Function name (N) [in] nameLen Length of the function name [in] custom Customization string (S) [in] customLen Length of the customization string 
- Returns
- Error code
◆ cshakeLeftEncode()
| void cshakeLeftEncode | ( | size_t | value, | 
| uint8_t * | buffer, | ||
| size_t * | length | ||
| ) | 
◆ cshakeSqueeze()
| void cshakeSqueeze | ( | CshakeContext * | context, | 
| uint8_t * | output, | ||
| size_t | length | ||
| ) | 
