shake128_256.c File Reference

SHAKE128/256 hash function. More...

#include "core/crypto.h"
#include "hash/shake128_256.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL
 

Functions

__weak_func error_t shake128_256Compute (const void *data, size_t length, uint8_t *digest)
 Digest a message using SHAKE128/256. More...
 
__weak_func void shake128_256Init (Shake128_256Context *context)
 Initialize SHAKE128/256 message digest context. More...
 
__weak_func void shake128_256Update (Shake128_256Context *context, const void *data, size_t length)
 Update the SHAKE128/256 context with a portion of the message being hashed. More...
 
__weak_func void shake128_256Final (Shake128_256Context *context, uint8_t *digest)
 Finish the SHAKE128/256 message digest. More...
 

Variables

const HashAlgo shake128_256HashAlgo
 

Detailed Description

SHAKE128/256 hash function.

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 shake128_256.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL

Definition at line 32 of file shake128_256.c.

Function Documentation

◆ shake128_256Compute()

__weak_func error_t shake128_256Compute ( const void *  data,
size_t  length,
uint8_t *  digest 
)

Digest a message using SHAKE128/256.

Parameters
[in]dataPointer to the message being hashed
[in]lengthLength of the message
[out]digestPointer to the calculated digest
Returns
Error code

Definition at line 68 of file shake128_256.c.

◆ shake128_256Final()

__weak_func void shake128_256Final ( Shake128_256Context *  context,
uint8_t *  digest 
)

Finish the SHAKE128/256 message digest.

Parameters
[in]contextPointer to the SHAKE128/256 context
[out]digestCalculated digest

Definition at line 140 of file shake128_256.c.

◆ shake128_256Init()

__weak_func void shake128_256Init ( Shake128_256Context *  context)

Initialize SHAKE128/256 message digest context.

Parameters
[in]contextPointer to the SHAKE128/256 context to initialize

Definition at line 113 of file shake128_256.c.

◆ shake128_256Update()

__weak_func void shake128_256Update ( Shake128_256Context *  context,
const void *  data,
size_t  length 
)

Update the SHAKE128/256 context with a portion of the message being hashed.

Parameters
[in]contextPointer to the SHAKE128/256 context
[in]dataPointer to the buffer being hashed
[in]lengthLength of the buffer

Definition at line 127 of file shake128_256.c.

Variable Documentation

◆ shake128_256HashAlgo

void(* HashAlgoInit)(void *context)
Definition: crypto.h:1174
#define TRUE
Definition: os_port.h:50
#define SHAKE128_256_MIN_PAD_SIZE
Definition: shake128_256.h:43
void(* HashAlgoUpdate)(void *context, const void *data, size_t length)
Definition: crypto.h:1175
#define SHAKE128_256_DIGEST_SIZE
Definition: shake128_256.h:41
__weak_func void shake128_256Final(Shake128_256Context *context, uint8_t *digest)
Finish the SHAKE128/256 message digest.
Definition: shake128_256.c:140
SHAKE algorithm context.
Definition: shake.h:53
void(* HashAlgoFinal)(void *context, uint8_t *digest)
Definition: crypto.h:1176
__weak_func void shake128_256Init(Shake128_256Context *context)
Initialize SHAKE128/256 message digest context.
Definition: shake128_256.c:113
__weak_func void shake128_256Update(Shake128_256Context *context, const void *data, size_t length)
Update the SHAKE128/256 context with a portion of the message being hashed.
Definition: shake128_256.c:127
#define SHAKE128_256_BLOCK_SIZE
Definition: shake128_256.h:39
error_t(* HashAlgoCompute)(const void *data, size_t length, uint8_t *digest)
Definition: crypto.h:1171
__weak_func error_t shake128_256Compute(const void *data, size_t length, uint8_t *digest)
Digest a message using SHAKE128/256.
Definition: shake128_256.c:68
const uint8_t SHAKE128_OID[9]
Definition: shake.c:48