CMAC (Cipher-based Message Authentication Code) More...
Go to the source code of this file.
Data Structures | |
struct | CmacContext |
CMAC algorithm context. More... | |
Macros | |
#define | CMAC_PRIVATE_CONTEXT |
Functions | |
error_t | cmacCompute (const CipherAlgo *cipher, const void *key, size_t keyLen, const void *data, size_t dataLen, uint8_t *mac, size_t macLen) |
Compute CMAC using the specified cipher algorithm. More... | |
error_t | cmacInit (CmacContext *context, const CipherAlgo *cipher, const void *key, size_t keyLen) |
Initialize CMAC calculation. More... | |
void | cmacReset (CmacContext *context) |
Reset CMAC context. More... | |
void | cmacUpdate (CmacContext *context, const void *data, size_t dataLen) |
Update the CMAC context with a portion of the message being hashed. More... | |
error_t | cmacFinal (CmacContext *context, uint8_t *mac, size_t macLen) |
Finish the CMAC calculation. More... | |
void | cmacDeinit (CmacContext *context) |
Release CMAC context. More... | |
void | cmacMul (uint8_t *x, const uint8_t *a, size_t n, uint8_t rb) |
Multiplication by x in GF(2^128) More... | |
void | cmacXorBlock (uint8_t *x, const uint8_t *a, const uint8_t *b, size_t n) |
XOR operation. More... | |
Detailed Description
CMAC (Cipher-based 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.
- Version
- 2.4.4
Definition in file cmac.h.
Macro Definition Documentation
◆ CMAC_PRIVATE_CONTEXT
Function Documentation
◆ cmacCompute()
error_t cmacCompute | ( | const CipherAlgo * | cipher, |
const void * | key, | ||
size_t | keyLen, | ||
const void * | data, | ||
size_t | dataLen, | ||
uint8_t * | mac, | ||
size_t | macLen | ||
) |
Compute CMAC using the specified cipher algorithm.
- Parameters
-
[in] cipher Cipher algorithm used to compute CMAC [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
◆ cmacDeinit()
void cmacDeinit | ( | CmacContext * | context | ) |
◆ cmacFinal()
error_t cmacFinal | ( | CmacContext * | context, |
uint8_t * | mac, | ||
size_t | macLen | ||
) |
◆ cmacInit()
error_t cmacInit | ( | CmacContext * | context, |
const CipherAlgo * | cipher, | ||
const void * | key, | ||
size_t | keyLen | ||
) |
◆ cmacMul()
void cmacMul | ( | uint8_t * | x, |
const uint8_t * | a, | ||
size_t | n, | ||
uint8_t | rb | ||
) |
◆ cmacReset()
void cmacReset | ( | CmacContext * | context | ) |
◆ cmacUpdate()
void cmacUpdate | ( | CmacContext * | context, |
const void * | data, | ||
size_t | dataLen | ||
) |