shake256.c File Reference

SHAKE256 extendable-output function (XOF) More...

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

Go to the source code of this file.

Macros

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL
 

Functions

error_t shake256Compute (const void *input, size_t inputLen, uint8_t *output, size_t outputLen)
 Digest a message using SHAKE256. More...
 
void shake256Init (Shake256Context *context)
 Initialize SHAKE256 context. More...
 
void shake256Absorb (Shake256Context *context, const void *input, size_t length)
 Absorb data. More...
 
void shake256Final (Shake256Context *context)
 Finish absorbing phase. More...
 
void shake256Squeeze (Shake256Context *context, uint8_t *output, size_t length)
 Extract data from the squeezing phase. More...
 

Variables

const uint8_t shake256Oid [9] = {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x0C}
 

Detailed Description

SHAKE256 extendable-output function (XOF)

License

Copyright (C) 2010-2018 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

SHAKE256 is a function on binary data in which the output can be extended to any desired length. SHAKE256 supports 256 bits of security strength. Refer to FIPS 202 for more details

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

Definition in file shake256.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL

Definition at line 36 of file shake256.c.

Function Documentation

◆ shake256Absorb()

void shake256Absorb ( Shake256Context context,
const void *  input,
size_t  length 
)

Absorb data.

Parameters
[in]contextPointer to the SHAKE256 context
[in]inputPointer to the buffer being hashed
[in]lengthLength of the buffer

Definition at line 104 of file shake256.c.

◆ shake256Compute()

error_t shake256Compute ( const void *  input,
size_t  inputLen,
uint8_t *  output,
size_t  outputLen 
)

Digest a message using SHAKE256.

Parameters
[in]inputPointer to the input data
[in]inputLenLength of the input data
[out]outputPointer to the output data
[in]outputLenExpected length of the output data
Returns
Error code

Definition at line 58 of file shake256.c.

◆ shake256Final()

void shake256Final ( Shake256Context context)

Finish absorbing phase.

Parameters
[in]contextPointer to the SHAKE256 context

Definition at line 116 of file shake256.c.

◆ shake256Init()

void shake256Init ( Shake256Context context)

Initialize SHAKE256 context.

Parameters
[in]contextPointer to the SHAKE256 context to initialize

Definition at line 90 of file shake256.c.

◆ shake256Squeeze()

void shake256Squeeze ( Shake256Context context,
uint8_t *  output,
size_t  length 
)

Extract data from the squeezing phase.

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

Definition at line 130 of file shake256.c.

Variable Documentation

◆ shake256Oid

const uint8_t shake256Oid[9] = {0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x0C}

Definition at line 46 of file shake256.c.