ascon_hash256.h File Reference

Ascon-Hash256 hash function. More...

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

Go to the source code of this file.

Data Structures

struct  AsconHash256Context
 Ascon-Hash256 algorithm context. More...
 

Macros

#define ASCON_HASH256_PRIVATE_CONTEXT
 
#define ASCON_HASH256_BLOCK_SIZE   8
 
#define ASCON_HASH256_DIGEST_SIZE   32
 
#define ASCON_HASH256_MIN_PAD_SIZE   0
 
#define ASCON_HASH256_HASH_ALGO   (&asconHash256HashAlgo)
 

Functions

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]
 
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.

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

Definition in file ascon_hash256.h.

Macro Definition Documentation

◆ ASCON_HASH256_BLOCK_SIZE

#define ASCON_HASH256_BLOCK_SIZE   8

Definition at line 44 of file ascon_hash256.h.

◆ ASCON_HASH256_DIGEST_SIZE

#define ASCON_HASH256_DIGEST_SIZE   32

Definition at line 46 of file ascon_hash256.h.

◆ ASCON_HASH256_HASH_ALGO

#define ASCON_HASH256_HASH_ALGO   (&asconHash256HashAlgo)

Definition at line 50 of file ascon_hash256.h.

◆ ASCON_HASH256_MIN_PAD_SIZE

#define ASCON_HASH256_MIN_PAD_SIZE   0

Definition at line 48 of file ascon_hash256.h.

◆ ASCON_HASH256_PRIVATE_CONTEXT

#define ASCON_HASH256_PRIVATE_CONTEXT

Definition at line 40 of file ascon_hash256.h.

Function Documentation

◆ asconHash256Compute()

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]
extern

Definition at line 47 of file ascon_hash256.c.

◆ asconHash256HashAlgo

const HashAlgo asconHash256HashAlgo
extern

Definition at line 50 of file ascon_hash256.c.