kbkdf.h File Reference

SP 800-108 key derivation function. More...

#include "core/crypto.h"

Go to the source code of this file.

Functions

error_t kbkdfCounterHmac (const HashAlgo *hashAlgo, uint_t r, const uint8_t *ki, size_t kiLen, const uint8_t *fixedData, size_t fixedDataLen, uint8_t *ko, size_t koLen)
 KBKDF key derivation function (counter mode with HMAC) More...
 
error_t kbkdfCounterCmac (const CipherAlgo *cipherAlgo, uint_t r, const uint8_t *ki, size_t kiLen, const uint8_t *fixedData, size_t fixedDataLen, uint8_t *ko, size_t koLen)
 KBKDF key derivation function (counter mode with CMAC) More...
 
error_t kbkdfFeedbackHmac (const HashAlgo *hashAlgo, uint_t r, const uint8_t *ki, size_t kiLen, const uint8_t *iv, size_t ivLen, const uint8_t *fixedData, size_t fixedDataLen, uint8_t *ko, size_t koLen)
 KBKDF key derivation function (feedback mode with HMAC) More...
 
error_t kbkdfFeedbackCmac (const CipherAlgo *cipherAlgo, uint_t r, const uint8_t *ki, size_t kiLen, const uint8_t *iv, size_t ivLen, const uint8_t *fixedData, size_t fixedDataLen, uint8_t *ko, size_t koLen)
 KBKDF key derivation function (feedback mode with CMAC) More...
 
error_t kbkdfDoublePipelineHmac (const HashAlgo *hashAlgo, uint_t r, const uint8_t *ki, size_t kiLen, const uint8_t *fixedData, size_t fixedDataLen, uint8_t *ko, size_t koLen)
 KBKDF key derivation function (double-pipeline mode with HMAC) More...
 
error_t kbkdfDoublePipelineCmac (const CipherAlgo *cipherAlgo, uint_t r, const uint8_t *ki, size_t kiLen, const uint8_t *fixedData, size_t fixedDataLen, uint8_t *ko, size_t koLen)
 KBKDF key derivation function (double-pipeline mode with CMAC) More...
 
error_t kbkdfKmac (uint_t strength, const uint8_t *ki, size_t kiLen, const uint8_t *context, size_t contextLen, const char_t *label, size_t labelLen, uint8_t *ko, size_t koLen)
 KBKDF key derivation function (using KMAC) More...
 

Detailed Description

SP 800-108 key derivation 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.

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

Definition in file kbkdf.h.

Function Documentation

◆ kbkdfCounterCmac()

error_t kbkdfCounterCmac ( const CipherAlgo *  cipherAlgo,
uint_t  r,
const uint8_t *  ki,
size_t  kiLen,
const uint8_t *  fixedData,
size_t  fixedDataLen,
uint8_t *  ko,
size_t  koLen 
)

KBKDF key derivation function (counter mode with CMAC)

Parameters
[in]cipherAlgoUnderlying cipher algorithm
[in]rLength of the binary encoding of the counter, in bits
[in]kiKey-derivation key KI
[in]kiLenLength of the key-derivation key, in bytes
[in]fixedDataFixed input data
[in]fixedDataLenLength of the fixed input data, in bytes
[out]koDerived keying material
[in]koLenLength of the keying material to be generated, in bytes
Returns
Error code

Definition at line 157 of file kbkdf.c.

◆ kbkdfCounterHmac()

error_t kbkdfCounterHmac ( const HashAlgo *  hashAlgo,
uint_t  r,
const uint8_t *  ki,
size_t  kiLen,
const uint8_t *  fixedData,
size_t  fixedDataLen,
uint8_t *  ko,
size_t  koLen 
)

KBKDF key derivation function (counter mode with HMAC)

Parameters
[in]hashAlgoUnderlying hash function
[in]rLength of the binary encoding of the counter, in bits
[in]kiKey-derivation key KI
[in]kiLenLength of the key-derivation key, in bytes
[in]fixedDataFixed input data
[in]fixedDataLenLength of the fixed input data, in bytes
[out]koDerived keying material
[in]koLenLength of the keying material to be generated, in bytes
Returns
Error code

Definition at line 61 of file kbkdf.c.

◆ kbkdfDoublePipelineCmac()

error_t kbkdfDoublePipelineCmac ( const CipherAlgo *  cipherAlgo,
uint_t  r,
const uint8_t *  ki,
size_t  kiLen,
const uint8_t *  fixedData,
size_t  fixedDataLen,
uint8_t *  ko,
size_t  koLen 
)

KBKDF key derivation function (double-pipeline mode with CMAC)

Parameters
[in]cipherAlgoUnderlying cipher algorithm
[in]rLength of the binary encoding of the counter, in bits
[in]kiKey-derivation key KI
[in]kiLenLength of the key-derivation key, in bytes
[in]fixedDataFixed input data
[in]fixedDataLenLength of the fixed input data, in bytes
[out]koDerived keying material
[in]koLenLength of the keying material to be generated, in bytes
Returns
Error code

Definition at line 584 of file kbkdf.c.

◆ kbkdfDoublePipelineHmac()

error_t kbkdfDoublePipelineHmac ( const HashAlgo *  hashAlgo,
uint_t  r,
const uint8_t *  ki,
size_t  kiLen,
const uint8_t *  fixedData,
size_t  fixedDataLen,
uint8_t *  ko,
size_t  koLen 
)

KBKDF key derivation function (double-pipeline mode with HMAC)

Parameters
[in]hashAlgoUnderlying hash function
[in]rLength of the binary encoding of the counter, in bits
[in]kiKey-derivation key KI
[in]kiLenLength of the key-derivation key, in bytes
[in]fixedDataFixed input data
[in]fixedDataLenLength of the fixed input data, in bytes
[out]koDerived keying material
[in]koLenLength of the keying material to be generated, in bytes
Returns
Error code

Definition at line 478 of file kbkdf.c.

◆ kbkdfFeedbackCmac()

error_t kbkdfFeedbackCmac ( const CipherAlgo *  cipherAlgo,
uint_t  r,
const uint8_t *  ki,
size_t  kiLen,
const uint8_t *  iv,
size_t  ivLen,
const uint8_t *  fixedData,
size_t  fixedDataLen,
uint8_t *  ko,
size_t  koLen 
)

KBKDF key derivation function (feedback mode with CMAC)

Parameters
[in]cipherAlgoUnderlying cipher algorithm
[in]rLength of the binary encoding of the counter, in bits
[in]kiKey-derivation key KI
[in]kiLenLength of the key-derivation key, in bytes
[in]ivInitialization vector
[in]ivLenLength of the initialization vector, in bytes
[in]fixedDataFixed input data
[in]fixedDataLenLength of the fixed input data, in bytes
[out]koDerived keying material
[in]koLenLength of the keying material to be generated, in bytes
Returns
Error code

Definition at line 367 of file kbkdf.c.

◆ kbkdfFeedbackHmac()

error_t kbkdfFeedbackHmac ( const HashAlgo *  hashAlgo,
uint_t  r,
const uint8_t *  ki,
size_t  kiLen,
const uint8_t *  iv,
size_t  ivLen,
const uint8_t *  fixedData,
size_t  fixedDataLen,
uint8_t *  ko,
size_t  koLen 
)

KBKDF key derivation function (feedback mode with HMAC)

Parameters
[in]hashAlgoUnderlying hash function
[in]rLength of the binary encoding of the counter, in bits
[in]kiKey-derivation key KI
[in]kiLenLength of the key-derivation key, in bytes
[in]ivInitialization vector
[in]ivLenLength of the initialization vector, in bytes
[in]fixedDataFixed input data
[in]fixedDataLenLength of the fixed input data, in bytes
[out]koDerived keying material
[in]koLenLength of the keying material to be generated, in bytes
Returns
Error code

Definition at line 262 of file kbkdf.c.

◆ kbkdfKmac()

error_t kbkdfKmac ( uint_t  strength,
const uint8_t *  ki,
size_t  kiLen,
const uint8_t *  context,
size_t  contextLen,
const char_t *  label,
size_t  labelLen,
uint8_t *  ko,
size_t  koLen 
)

KBKDF key derivation function (using KMAC)

Parameters
[in]strengthNumber of bits of security (128 for KMAC128 and 256 for KMAC256)
[in]kiKey-derivation key KI
[in]kiLenLength of the key-derivation key, in bytes
[in]contextContext-specific information
[in]contextLenLength of the context, in bytes
[in]labelCustomization string (optional parameter)
[in]labelLenLength of the customization string, in bytes
[out]koDerived keying material
[in]koLenLength of the keying material to be generated, in bytes
Returns
Error code

Definition at line 711 of file kbkdf.c.