.. _hkdf_expand:


HKDF_expand
===========


Computes the output keying material from input pseudorandom key (PRK), info,
and hash method per the HKDF standard.


Syntax
------


IppStatus ippsHKDF_expand(const Ipp8u\* prk, int prkLen, Ipp8u\* okm,
int okmLen, const Ipp8u\* info, int infoLen, const IppsHashMethod\*pMethod);


Include Files
-------------


``ippcp.h``


Parameters
----------


.. list-table::
   :header-rows: 0

   * - prk
     - Pointer to the input pseudorandom key that was generated by :ref:`HKDF_extract<hkdf_extract>` function call.
   * - prkLen
     - Length of the input key in bytes.
   * - okm
     - Pointer to the output keying material.
   * - okmLen
     - Length of needed output keying material in bytes.
   * - info
     - Pointer to the info message.
   * - infoLen
     - Length of the info message in bytes.
   * - pMethod
     - Pointer to the hash method context.




Description
-----------


The function computes the output keying material as a part of the Hashed
Message Authentication Code (HMAC)-based key derivation function
(HKDF) for HKDF-expand as specified in :term:`RFC 5869 <[RFC 5869]>`.
The combination of functions ippsHKDF_extract() & ippsHKDF_expand()
perform the equivalent combined function ippsHKDF().


Return Values
-------------


.. list-table::
   :header-rows: 0

   * - ippStsNoErr
     - Indicates no error. Any other value indicates an error or warning.
   * - ippStsNullPtrErr
     - Indicates an error condition if any of the specified pointers is NULL.
   * - ippStsLengthErr
     - Indicates an error condition if okm_len <= 0, okmLen > 255 * hashLen, or infoLen > MAX_HKDF_INFO_SIZE where MAX_HKDF_HASH_SIZE is the maximum hash size in library.
   * - ippsStsNotSupportedModeErr
     - Indicates hash method is not supported
