Lines Matching +full:for +full:- +full:context
4 * \brief This file provides an API for key wrapping (KW) and key wrapping with
5 * padding (KWP) as defined in NIST SP 800-38F.
6 * https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38F.pdf
8 * Key wrapping specifies a deterministic authenticated-encryption mode
9 * of operation, according to <em>NIST SP 800-38F: Recommendation for
10 * Block Cipher Modes of Operation: Methods for Key Wrapping</em>. Its
13 * Its equivalent is RFC 3394 for KW, and RFC 5649 for KWP.
20 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
45 * \brief The key wrapping context-type definition. The key wrapping context is passed
49 * Don't make any assumptions on this context!
52 mbedtls_cipher_context_t MBEDTLS_PRIVATE(cipher_ctx); /*!< The cipher context used. */
60 * \brief This function initializes the specified key wrapping context
61 * to make references valid and prepare the context
62 * for mbedtls_nist_kw_setkey() or mbedtls_nist_kw_free().
64 * \param ctx The key wrapping context to initialize.
70 * \brief This function initializes the key wrapping context set in the
73 * \param ctx The key wrapping context.
74 * \param cipher The 128-bit block cipher to use. Only AES is supported.
77 * \param is_wrap Specify whether the operation within the context is wrapping or unwrapping
80 * \return \c MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA for any invalid input.
81 * \return \c MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE for 128-bit block ciphers
83 * \return cipher-specific error code on failure of the underlying cipher.
92 * \brief This function releases and clears the specified key wrapping context
93 * and underlying cipher sub-context.
95 * \param ctx The key wrapping context to clear.
102 * \param ctx The key wrapping context to use for encryption.
107 …* <ul><li>For KW mode: a multiple of 8 bytes between 16 and 2^57-8 inclusive. </l…
108 * <li>For KWP mode: any length between 1 and 2^32-1 inclusive.</li></ul>
110 * <ul><li>For KW mode: Must be at least 8 bytes larger than \p in_len.</li>
111 * <li>For KWP mode: Must be at least 8 bytes larger rounded up to a multiple of
112 * 8 bytes for KWP (15 bytes at most).</li></ul>
117 * \return \c MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA for invalid input length.
118 * \return cipher-specific error code on failure of the underlying cipher.
127 * \param ctx The key wrapping context to use for decryption.
133 * <ul><li>For KW mode: a multiple of 8 bytes between 24 and 2^57 inclusive. </li>
134 * <li>For KWP mode: a multiple of 8 bytes between 16 and 2^32 inclusive.</li></ul>
138 * For KWP mode, the length could be up to 15 bytes shorter than \p in_len,
143 * \return \c MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA for invalid input length.
144 * \return \c MBEDTLS_ERR_CIPHER_AUTH_FAILED for verification failure of the ciphertext.
145 * \return cipher-specific error code on failure of the underlying cipher.