ascon_cxof128.c File Reference

Ascon-CXOF128 customizable extendable-output function. More...

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

Go to the source code of this file.

Macros

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL
 

Functions

error_t asconCxof128Compute (const void *input, size_t inputLen, const char_t *custom, size_t customLen, uint8_t *output, size_t outputLen)
 Digest a message using Ascon-CXOF128. More...
 
error_t asconCxof128Init (AsconCxof128Context *context, const char_t *custom, size_t customLen)
 Initialize Ascon-CXOF128 context. More...
 
void asconCxof128Absorb (AsconCxof128Context *context, const void *input, size_t length)
 Absorb data. More...
 
void asconCxof128Final (AsconCxof128Context *context)
 Finish absorbing phase. More...
 
void asconCxof128Squeeze (AsconCxof128Context *context, uint8_t *output, size_t length)
 Extract data from the squeezing phase. More...
 

Variables

const uint8_t ASCON_CXOF128_OID [1] = {0x00}
 
const XofAlgo asconCxof128XofAlgo
 

Detailed Description

Ascon-CXOF128 customizable extendable-output 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.

Description

Ascon-CXOF128 is a customized eXtendable Output Functions (XOF) that allows users to specify a customization string and choose the output size of the message hash. It supports a security strength of up to 128 bits

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

Definition in file ascon_cxof128.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   CRYPTO_TRACE_LEVEL

Definition at line 38 of file ascon_cxof128.c.

Function Documentation

◆ asconCxof128Absorb()

void asconCxof128Absorb ( AsconCxof128Context *  context,
const void *  input,
size_t  length 
)

Absorb data.

Parameters
[in]contextPointer to the Ascon-CXOF128 context
[in]inputPointer to the buffer being hashed
[in]lengthLength of the buffer

Definition at line 214 of file ascon_cxof128.c.

◆ asconCxof128Compute()

error_t asconCxof128Compute ( const void *  input,
size_t  inputLen,
const char_t *  custom,
size_t  customLen,
uint8_t *  output,
size_t  outputLen 
)

Digest a message using Ascon-CXOF128.

Parameters
[in]inputPointer to the input data
[in]inputLenLength of the input data
[in]customCustomization string (Z)
[in]customLenLength of the customization string
[out]outputPointer to the output data
[in]outputLenExpected length of the output data
Returns
Error code

Definition at line 78 of file ascon_cxof128.c.

◆ asconCxof128Final()

void asconCxof128Final ( AsconCxof128Context *  context)

Finish absorbing phase.

Parameters
[in]contextPointer to the Ascon-CXOF128 context

Definition at line 258 of file ascon_cxof128.c.

◆ asconCxof128Init()

error_t asconCxof128Init ( AsconCxof128Context *  context,
const char_t *  custom,
size_t  customLen 
)

Initialize Ascon-CXOF128 context.

Parameters
[in]contextPointer to the Ascon-CXOF128 context to initialize
[in]customCustomization string (Z)
[in]customLenLength of the customization string, in bytes
Returns
Error code

Definition at line 135 of file ascon_cxof128.c.

◆ asconCxof128Squeeze()

void asconCxof128Squeeze ( AsconCxof128Context *  context,
uint8_t *  output,
size_t  length 
)

Extract data from the squeezing phase.

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

Definition at line 297 of file ascon_cxof128.c.

Variable Documentation

◆ ASCON_CXOF128_OID

const uint8_t ASCON_CXOF128_OID[1] = {0x00}

Definition at line 48 of file ascon_cxof128.c.

◆ asconCxof128XofAlgo

void(* XofAlgoAbsorb)(void *context, const void *input, size_t length)
Definition: crypto.h:1191
error_t(* XofAlgoInit)(void *context)
Definition: crypto.h:1186
error_t(* XofAlgoInitEx)(void *context, const char_t *custom, size_t customLen)
Definition: crypto.h:1188
error_t asconCxof128Init(AsconCxof128Context *context, const char_t *custom, size_t customLen)
Initialize Ascon-CXOF128 context.
Ascon-CXOF128 algorithm context.
Definition: ascon_cxof128.h:52
void asconCxof128Final(AsconCxof128Context *context)
Finish absorbing phase.
const uint8_t ASCON_CXOF128_OID[1]
Definition: ascon_cxof128.c:48
error_t(* XofAlgoCompute)(const void *input, size_t inputLen, uint8_t *output, size_t outputLen)
Definition: crypto.h:1180
error_t asconCxof128Compute(const void *input, size_t inputLen, const char_t *custom, size_t customLen, uint8_t *output, size_t outputLen)
Digest a message using Ascon-CXOF128.
Definition: ascon_cxof128.c:78
void asconCxof128Squeeze(AsconCxof128Context *context, uint8_t *output, size_t length)
Extract data from the squeezing phase.
void asconCxof128Absorb(AsconCxof128Context *context, const void *input, size_t length)
Absorb data.
void(* XofAlgoSqueeze)(void *context, uint8_t *output, size_t length)
Definition: crypto.h:1193
error_t(* XofAlgoComputeEx)(const void *input, size_t inputLen, const char_t *custom, size_t customLen, uint8_t *output, size_t outputLen)
Definition: crypto.h:1183
void(* XofAlgoFinal)(void *context)
Definition: crypto.h:1192