SHAKE128 and SHAKE256 extendable-output functions. More...
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL CRYPTO_TRACE_LEVEL |
Functions | |
error_t | shakeCompute (uint_t strength, const void *input, size_t inputLen, uint8_t *output, size_t outputLen) |
Digest a message using SHAKE128 or SHAKE256. More... | |
error_t | shakeInit (ShakeContext *context, uint_t strength) |
Initialize SHAKE context. More... | |
void | shakeAbsorb (ShakeContext *context, const void *input, size_t length) |
Absorb data. More... | |
void | shakeFinal (ShakeContext *context) |
Finish absorbing phase. More... | |
void | shakeSqueeze (ShakeContext *context, uint8_t *output, size_t length) |
Extract data from the squeezing phase. More... | |
Variables | |
const uint8_t | shake128Oid [9] = {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x0B} |
const uint8_t | shake256Oid [9] = {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x0C} |
Detailed Description
SHAKE128 and SHAKE256 extendable-output functions.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 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.
Description
SHAKE is a function on binary data in which the output can be extended to any desired length. SHAKE128 supports 128 bits of security strength. SHAKE256 supports 256 bits of security strength. Refer to FIPS 202 for more details
- Version
- 2.4.4
Definition in file shake.c.
Macro Definition Documentation
◆ TRACE_LEVEL
Function Documentation
◆ shakeAbsorb()
void shakeAbsorb | ( | ShakeContext * | context, |
const void * | input, | ||
size_t | length | ||
) |
◆ shakeCompute()
error_t shakeCompute | ( | uint_t | strength, |
const void * | input, | ||
size_t | inputLen, | ||
uint8_t * | output, | ||
size_t | outputLen | ||
) |
Digest a message using SHAKE128 or SHAKE256.
- Parameters
-
[in] strength Number of bits of security (128 for SHAKE128 and 256 for SHAKE256) [in] input Pointer to the input data [in] inputLen Length of the input data [out] output Pointer to the output data [in] outputLen Expected length of the output data
- Returns
- Error code
◆ shakeFinal()
void shakeFinal | ( | ShakeContext * | context | ) |
◆ shakeInit()
error_t shakeInit | ( | ShakeContext * | context, |
uint_t | strength | ||
) |
◆ shakeSqueeze()
void shakeSqueeze | ( | ShakeContext * | context, |
uint8_t * | output, | ||
size_t | length | ||
) |
Variable Documentation
◆ shake128Oid
const uint8_t shake128Oid[9] = {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x0B} |