ascon_hash256.c File Reference

Ascon-Hash256 hash function. More...

#include "core/crypto.h"
#include "lwc/ascon_hash256.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL
 

Functions

__weak_func error_t asconHash256Compute (const void *data, size_t length, uint8_t *digest)
 Digest a message using Ascon-Hash256. More...
 
void asconHash256Init (AsconHash256Context *context)
 Initialize Ascon-Hash256 message digest context. More...
 
void asconHash256Update (AsconHash256Context *context, const void *data, size_t length)
 Update the Ascon-Hash256 context with a portion of the message being hashed. More...
 
void asconHash256Final (AsconHash256Context *context, uint8_t *digest)
 Finish the Ascon-Hash256 message digest. More...
 

Variables

const uint8_t ASCON_HASH256_OID [1] = {0x00}
 
const HashAlgo asconHash256HashAlgo
 

Detailed Description

Ascon-Hash256 hash 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.

Description

Ascon-Hash256 is a cryptographic hash function that produces a 256-bit hash of the input messages, offering a security strength of 128 bits

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

Definition in file ascon_hash256.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL

Definition at line 37 of file ascon_hash256.c.

Function Documentation

◆ asconHash256Compute()

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

Digest a message using Ascon-Hash256.

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 76 of file ascon_hash256.c.

◆ asconHash256Final()

void asconHash256Final ( AsconHash256Context context,
uint8_t *  digest 
)

Finish the Ascon-Hash256 message digest.

Parameters
[in]contextPointer to the Ascon-Hash256 context
[out]digestCalculated digest

Definition at line 195 of file ascon_hash256.c.

◆ asconHash256Init()

void asconHash256Init ( AsconHash256Context context)

Initialize Ascon-Hash256 message digest context.

Parameters
[in]contextPointer to the Ascon-Hash256 context to initialize

Definition at line 121 of file ascon_hash256.c.

◆ asconHash256Update()

void asconHash256Update ( AsconHash256Context context,
const void *  data,
size_t  length 
)

Update the Ascon-Hash256 context with a portion of the message being hashed.

Parameters
[in]contextPointer to the Ascon-Hash256 context
[in]dataPointer to the buffer being hashed
[in]lengthLength of the buffer

Definition at line 151 of file ascon_hash256.c.

Variable Documentation

◆ ASCON_HASH256_OID

const uint8_t ASCON_HASH256_OID[1] = {0x00}

Definition at line 47 of file ascon_hash256.c.

◆ asconHash256HashAlgo

void(* HashAlgoInit)(void *context)
Definition: crypto.h:1027
void asconHash256Init(AsconHash256Context *context)
Initialize Ascon-Hash256 message digest context.
void asconHash256Update(AsconHash256Context *context, const void *data, size_t length)
Update the Ascon-Hash256 context with a portion of the message being hashed.
const uint8_t ASCON_HASH256_OID[1]
Definition: ascon_hash256.c:47
__weak_func error_t asconHash256Compute(const void *data, size_t length, uint8_t *digest)
Digest a message using Ascon-Hash256.
Definition: ascon_hash256.c:76
void asconHash256Final(AsconHash256Context *context, uint8_t *digest)
Finish the Ascon-Hash256 message digest.
#define ASCON_HASH256_DIGEST_SIZE
Definition: ascon_hash256.h:46
void(* HashAlgoUpdate)(void *context, const void *data, size_t length)
Definition: crypto.h:1029
#define ASCON_HASH256_BLOCK_SIZE
Definition: ascon_hash256.h:44
#define FALSE
Definition: os_port.h:46
Ascon-Hash256 algorithm context.
Definition: ascon_hash256.h:63
void(* HashAlgoFinal)(void *context, uint8_t *digest)
Definition: crypto.h:1031
#define ASCON_HASH256_MIN_PAD_SIZE
Definition: ascon_hash256.h:48
error_t(* HashAlgoCompute)(const void *data, size_t length, uint8_t *digest)
Definition: crypto.h:1024