KMACXOF (KMAC with arbitrary-length output) More...
Go to the source code of this file.
Data Structures | |
| struct | KmacXofContext |
| KMACXOF algorithm context. More... | |
Functions | |
| error_t | kmacXofCompute (uint_t strength, const void *key, size_t keyLen, const void *data, size_t dataLen, const char_t *custom, size_t customLen, uint8_t *mac, size_t macLen) |
| Digest a message using KMACXOF. More... | |
| error_t | kmacXofInit (KmacXofContext *context, uint_t strength, const void *key, size_t keyLen, const char_t *custom, size_t customLen) |
| Initialize KMACXOF context. More... | |
| void | kmacXofAbsorb (KmacXofContext *context, const void *input, size_t length) |
| Absorb data. More... | |
| void | kmacXofFinal (KmacXofContext *context) |
| Finish absorbing phase. More... | |
| void | kmacXofSqueeze (KmacXofContext *context, uint8_t *output, size_t length) |
| Extract data from the squeezing phase. More... | |
Variables | |
| const uint8_t | KMAC_XOF128_OID [9] |
| const uint8_t | KMAC_XOF256_OID [9] |
Detailed Description
KMACXOF (KMAC with arbitrary-length output)
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.
- Version
- 2.6.6
Definition in file kmac_xof.h.
Function Documentation
◆ kmacXofAbsorb()
| void kmacXofAbsorb | ( | KmacXofContext * | context, |
| const void * | input, | ||
| size_t | length | ||
| ) |
Absorb data.
- Parameters
-
[in] context Pointer to the KMACXOF context [in] input Pointer to the buffer being hashed [in] length Length of the buffer
Definition at line 183 of file kmac_xof.c.
◆ kmacXofCompute()
| error_t kmacXofCompute | ( | uint_t | strength, |
| const void * | key, | ||
| size_t | keyLen, | ||
| const void * | input, | ||
| size_t | inputLen, | ||
| const char_t * | custom, | ||
| size_t | customLen, | ||
| uint8_t * | output, | ||
| size_t | outputLen | ||
| ) |
Digest a message using KMACXOF.
- Parameters
-
[in] strength Number of bits of security (128 for KMACXOF128 and 256 for KMACXOF256) [in] key Pointer to the secret key (K) [in] keyLen Length of the secret key [in] input Pointer to the input data (X) [in] inputLen Length of the input data [in] custom Customization string (S) [in] customLen Length of the customization string [out] output Pointer to the output data [in] outputLen Expected length of the output data (L)
- Returns
- Error code
Definition at line 58 of file kmac_xof.c.
◆ kmacXofFinal()
| void kmacXofFinal | ( | KmacXofContext * | context | ) |
Finish absorbing phase.
- Parameters
-
[in] context Pointer to the KMACXOF context
Definition at line 195 of file kmac_xof.c.
◆ kmacXofInit()
| error_t kmacXofInit | ( | KmacXofContext * | context, |
| uint_t | strength, | ||
| const void * | key, | ||
| size_t | keyLen, | ||
| const char_t * | custom, | ||
| size_t | customLen | ||
| ) |
Initialize KMACXOF context.
- Parameters
-
[in] context Pointer to the KMACXOF context to initialize [in] strength Number of bits of security (128 for KMACXOF128 and 256 for KMACXOF256) [in] key Pointer to the secret key (K) [in] keyLen Length of the secret key [in] custom Customization string (S) [in] customLen Length of the customization string
- Returns
- Error code
Definition at line 120 of file kmac_xof.c.
◆ kmacXofSqueeze()
| void kmacXofSqueeze | ( | KmacXofContext * | context, |
| uint8_t * | output, | ||
| size_t | length | ||
| ) |
Extract data from the squeezing phase.
- Parameters
-
[in] context Pointer to the KMACXOF context [out] output Output string [in] length Desired output length, in bytes
Definition at line 217 of file kmac_xof.c.
Variable Documentation
◆ KMAC_XOF128_OID
|
extern |
Definition at line 38 of file kmac_xof.c.
◆ KMAC_XOF256_OID
|
extern |
Definition at line 40 of file kmac_xof.c.
