XCBC-MAC message authentication code. More...
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL CRYPTO_TRACE_LEVEL |
Functions | |
error_t | xcbcMacCompute (const CipherAlgo *cipher, const void *key, size_t keyLen, const void *data, size_t dataLen, uint8_t *mac, size_t macLen) |
Compute XCBC-MAC using the specified cipher algorithm. More... | |
error_t | xcbcMacInit (XcbcMacContext *context, const CipherAlgo *cipher, const void *key, size_t keyLen) |
Initialize XCBC-MAC calculation. More... | |
void | xcbcMacReset (XcbcMacContext *context) |
Reset XCBC-MAC context. More... | |
void | xcbcMacUpdate (XcbcMacContext *context, const void *data, size_t dataLen) |
Update the XCBC-MAC context with a portion of the message being hashed. More... | |
error_t | xcbcMacFinal (XcbcMacContext *context, uint8_t *mac, size_t macLen) |
Finish the XCBC-MAC calculation. More... | |
void | xcbcMacDeinit (XcbcMacContext *context) |
Release XCBC-MAC context. More... | |
void | xcbcMacXorBlock (uint8_t *x, const uint8_t *a, const uint8_t *b, size_t n) |
XOR operation. More... | |
Detailed Description
XCBC-MAC message authentication code.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 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
XCBC-MAC is a block cipher-based MAC algorithm specified in NIST SP 800-38B
- Version
- 2.4.4
Definition in file xcbc_mac.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL CRYPTO_TRACE_LEVEL |
Definition at line 36 of file xcbc_mac.c.
Function Documentation
◆ xcbcMacCompute()
error_t xcbcMacCompute | ( | const CipherAlgo * | cipher, |
const void * | key, | ||
size_t | keyLen, | ||
const void * | data, | ||
size_t | dataLen, | ||
uint8_t * | mac, | ||
size_t | macLen | ||
) |
Compute XCBC-MAC using the specified cipher algorithm.
- Parameters
-
[in] cipher Cipher algorithm used to compute XCBC-MAC [in] key Pointer to the secret key [in] keyLen Length of the secret key [in] data Pointer to the input message [in] dataLen Length of the input data [out] mac Calculated MAC value [in] macLen Expected length of the MAC
- Returns
- Error code
Definition at line 58 of file xcbc_mac.c.
◆ xcbcMacDeinit()
void xcbcMacDeinit | ( | XcbcMacContext * | context | ) |
Release XCBC-MAC context.
- Parameters
-
[in] context Pointer to the XCBC-MAC context
Definition at line 294 of file xcbc_mac.c.
◆ xcbcMacFinal()
error_t xcbcMacFinal | ( | XcbcMacContext * | context, |
uint8_t * | mac, | ||
size_t | macLen | ||
) |
Finish the XCBC-MAC calculation.
- Parameters
-
[in] context Pointer to the XCBC-MAC context [out] mac Calculated MAC value (optional parameter) [in] macLen Expected length of the MAC
- Returns
- Error code
Definition at line 229 of file xcbc_mac.c.
◆ xcbcMacInit()
error_t xcbcMacInit | ( | XcbcMacContext * | context, |
const CipherAlgo * | cipher, | ||
const void * | key, | ||
size_t | keyLen | ||
) |
Initialize XCBC-MAC calculation.
- Parameters
-
[in] context Pointer to the XCBC-MAC context to initialize [in] cipher Cipher algorithm used to compute XCBC-MAC [in] key Pointer to the secret key [in] keyLen Length of the secret key
- Returns
- Error code
Definition at line 107 of file xcbc_mac.c.
◆ xcbcMacReset()
void xcbcMacReset | ( | XcbcMacContext * | context | ) |
Reset XCBC-MAC context.
- Parameters
-
[in] context Pointer to the XCBC-MAC context
Definition at line 164 of file xcbc_mac.c.
◆ xcbcMacUpdate()
void xcbcMacUpdate | ( | XcbcMacContext * | context, |
const void * | data, | ||
size_t | dataLen | ||
) |
Update the XCBC-MAC context with a portion of the message being hashed.
- Parameters
-
[in] context Pointer to the XCBC-MAC context [in] data Pointer to the input data [in] dataLen Length of the buffer
Definition at line 183 of file xcbc_mac.c.
◆ xcbcMacXorBlock()
void xcbcMacXorBlock | ( | uint8_t * | x, |
const uint8_t * | a, | ||
const uint8_t * | b, | ||
size_t | n | ||
) |
XOR operation.
- Parameters
-
[out] x Block resulting from the XOR operation [in] a First input block [in] b Second input block [in] n Size of the block, in bytes
Definition at line 316 of file xcbc_mac.c.