mbedtls_nist_kw_setkey() function
This function initializes the key wrapping context set in the \p ctx parameter and sets the encryption key.
Arguments
ctx
The key wrapping context.
cipher
The 128-bit block cipher to use. Only AES is supported.
key
The Key Encryption Key (KEK).
keybits
The KEK size in bits. This must be acceptable by the cipher.
is_wrap
Specify whether the operation within the context is wrapping or unwrapping
Return value
\c 0 on success. \c MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA for any invalid input. \c MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE for 128-bit block ciphers which are not supported. cipher-specific error code on failure of the underlying cipher.