IKEv2 key derivation functions. More...
Go to the source code of this file.
Macros | |
| #define | TRACE_LEVEL CRYPTO_TRACE_LEVEL |
Functions | |
| error_t | ikePrf (MacAlgo macAlgo, const HashAlgo *hashAlgo, const CipherAlgo *cipherAlgo, const uint8_t *key, size_t keyLen, const uint8_t *data, size_t dataLen, uint8_t *output) |
| Pseudorandom function (prf function) More... | |
| error_t | ikePrfEx (MacAlgo macAlgo, const HashAlgo *hashAlgo, const CipherAlgo *cipherAlgo, const uint8_t *key, size_t keyLen, const DataFrag *dataFrags, uint_t dataNumFrags, uint8_t *output) |
| Pseudorandom function (prf function) More... | |
| error_t | ikePrfPlus (MacAlgo macAlgo, const HashAlgo *hashAlgo, const CipherAlgo *cipherAlgo, const uint8_t *key, size_t keyLen, const uint8_t *data, size_t dataLen, uint8_t *output, size_t outputLen) |
| Function that outputs a pseudorandom stream (prf+ function) More... | |
| error_t | ikePrfPlusEx (MacAlgo macAlgo, const HashAlgo *hashAlgo, const CipherAlgo *cipherAlgo, const uint8_t *key, size_t keyLen, const DataFrag *dataFrags, uint_t dataNumFrags, uint8_t *output, size_t outputLen) |
| Function that outputs a pseudorandom stream (prf+ function) More... | |
| error_t | ikePrfInit (IkePrfContext *context, MacAlgo macAlgo, const HashAlgo *hashAlgo, const CipherAlgo *cipherAlgo, const uint8_t *key, size_t keyLen) |
| Initialize PRF calculation. More... | |
| void | ikePrfUpdate (IkePrfContext *context, const uint8_t *data, size_t dataLen) |
| Update PRF calculation. More... | |
| error_t | ikePrfFinal (IkePrfContext *context, uint8_t *output, size_t outputLen) |
| Finalize PRF calculation. More... | |
Detailed Description
IKEv2 key derivation functions.
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 ike_kdf.c.
Macro Definition Documentation
◆ TRACE_LEVEL
Function Documentation
◆ ikePrf()
| error_t ikePrf | ( | MacAlgo | macAlgo, |
| const HashAlgo * | hashAlgo, | ||
| const CipherAlgo * | cipherAlgo, | ||
| const uint8_t * | key, | ||
| size_t | keyLen, | ||
| const uint8_t * | data, | ||
| size_t | dataLen, | ||
| uint8_t * | output | ||
| ) |
Pseudorandom function (prf function)
- Parameters
-
[in] macAlgo PRF algorithm (CMAC, HMAC, KMAC or XCBC-MAC) [in] hashAlgo Underlying hash function (for HMAC) [in] cipherAlgo Underlying cipher algorithm (for CMAC and XCBC-MAC) [in] key Pointer to the key [in] keyLen Length of the key, in bytes [in] data Pointer to the data [in] dataLen Length of the data, in bytes [in] output Pseudorandom output
- Returns
- Error code
◆ ikePrfEx()
| error_t ikePrfEx | ( | MacAlgo | macAlgo, |
| const HashAlgo * | hashAlgo, | ||
| const CipherAlgo * | cipherAlgo, | ||
| const uint8_t * | key, | ||
| size_t | keyLen, | ||
| const DataFrag * | dataFrags, | ||
| uint_t | dataNumFrags, | ||
| uint8_t * | output | ||
| ) |
Pseudorandom function (prf function)
- Parameters
-
[in] macAlgo PRF algorithm (CMAC, HMAC, KMAC or XCBC-MAC) [in] hashAlgo Underlying hash function (for HMAC) [in] cipherAlgo Underlying cipher algorithm (for CMAC and XCBC-MAC) [in] key Pointer to the key [in] keyLen Length of the key, in bytes [in] dataFrags Array of fragments representing the data [in] dataNumFrags Number of fragments representing the data [in] output Pseudorandom output
- Returns
- Error code
◆ ikePrfFinal()
| error_t ikePrfFinal | ( | IkePrfContext * | context, |
| uint8_t * | output, | ||
| size_t | outputLen | ||
| ) |
◆ ikePrfInit()
| error_t ikePrfInit | ( | IkePrfContext * | context, |
| MacAlgo | macAlgo, | ||
| const HashAlgo * | hashAlgo, | ||
| const CipherAlgo * | cipherAlgo, | ||
| const uint8_t * | key, | ||
| size_t | keyLen | ||
| ) |
Initialize PRF calculation.
- Parameters
-
[in] context Pointer to the IKE PRF context [in] macAlgo PRF algorithm (CMAC, HMAC, KMAC or XCBC-MAC) [in] hashAlgo Underlying hash function (for HMAC) [in] cipherAlgo Underlying cipher algorithm (for CMAC and XCBC-MAC) [in] key Pointer to the key [in] keyLen Length of the key, in bytes
- Returns
- Error code
◆ ikePrfPlus()
| error_t ikePrfPlus | ( | MacAlgo | macAlgo, |
| const HashAlgo * | hashAlgo, | ||
| const CipherAlgo * | cipherAlgo, | ||
| const uint8_t * | key, | ||
| size_t | keyLen, | ||
| const uint8_t * | data, | ||
| size_t | dataLen, | ||
| uint8_t * | output, | ||
| size_t | outputLen | ||
| ) |
Function that outputs a pseudorandom stream (prf+ function)
- Parameters
-
[in] macAlgo PRF algorithm (CMAC, HMAC, KMAC or XCBC-MAC) [in] hashAlgo Underlying hash function (for HMAC) [in] cipherAlgo Underlying cipher algorithm (for CMAC and XCBC-MAC) [in] key Pointer to the key [in] keyLen Length of the key, in bytes [in] data Pointer to the data [in] dataLen Length of the data, in bytes [out] output Pseudorandom output stream [in] outputLen Desired length of the pseudorandom output stream
- Returns
- Error code
◆ ikePrfPlusEx()
| error_t ikePrfPlusEx | ( | MacAlgo | macAlgo, |
| const HashAlgo * | hashAlgo, | ||
| const CipherAlgo * | cipherAlgo, | ||
| const uint8_t * | key, | ||
| size_t | keyLen, | ||
| const DataFrag * | dataFrags, | ||
| uint_t | dataNumFrags, | ||
| uint8_t * | output, | ||
| size_t | outputLen | ||
| ) |
Function that outputs a pseudorandom stream (prf+ function)
- Parameters
-
[in] macAlgo PRF algorithm (CMAC, HMAC, KMAC or XCBC-MAC) [in] hashAlgo Underlying hash function (for HMAC) [in] cipherAlgo Underlying cipher algorithm (for CMAC and XCBC-MAC) [in] key Pointer to the key [in] keyLen Length of the key, in bytes [in] dataFrags Array of fragments representing the data [in] dataNumFrags Number of fragments representing the data [out] output Pseudorandom output stream [in] outputLen Desired length of the pseudorandom output stream
- Returns
- Error code
◆ ikePrfUpdate()
| void ikePrfUpdate | ( | IkePrfContext * | context, |
| const uint8_t * | data, | ||
| size_t | dataLen | ||
| ) |
