Lines Matching +full:for +full:- +full:context
6 * The Advanced Encryption Standard (AES) specifies a FIPS-approved
11 * encrypt and decrypt information. For more information, see
13 * <em>ISO/IEC 18033-2:2006: Information technology -- Security
14 * techniques -- Encryption algorithms -- Part 2: Asymmetric
17 * The AES-XTS block mode is standardized by NIST SP 800-38E
18 * <https://nvlpubs.nist.gov/nistpubs/legacy/sp/nistspecialpublication800-38e.pdf>
25 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
42 /* Error codes in range 0x0020-0x0022 */
44 #define MBEDTLS_ERR_AES_INVALID_KEY_LENGTH -0x0020
46 #define MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH -0x0022
48 /* Error codes in range 0x0021-0x0025 */
50 #define MBEDTLS_ERR_AES_BAD_INPUT_DATA -0x0021
61 * \brief The AES context-type definition.
69 10 round keys for 128-bit case. */
72 hold 32 extra Bytes, which can be used for
76 <li>Simplifying key expansion in the 256-bit
85 * \brief The AES XTS context-type definition.
88 mbedtls_aes_context MBEDTLS_PRIVATE(crypt); /*!< The AES context to use for AES block
90 mbedtls_aes_context MBEDTLS_PRIVATE(tweak); /*!< The AES context used for tweak
100 * \brief This function initializes the specified AES context.
103 * the context.
105 * \param ctx The AES context to initialize. This must not be \c NULL.
110 * \brief This function releases and clears the specified AES context.
112 * \param ctx The AES context to clear.
114 * Otherwise, the context must have been at least initialized.
120 * \brief This function initializes the specified AES XTS context.
123 * the context.
125 * \param ctx The AES XTS context to initialize. This must not be \c NULL.
130 * \brief This function releases and clears the specified AES XTS context.
132 * \param ctx The AES XTS context to clear.
134 * Otherwise, the context must have been at least initialized.
142 * \param ctx The AES context to which the key should be bound.
162 * \param ctx The AES context to which the key should be bound.
181 * \brief This function prepares an XTS context for encryption and
184 * \param ctx The AES XTS context to which the key should be bound.
190 * <ul><li>256 bits (each of key1 and key2 is a 128-bit key)</li>
191 * <li>512 bits (each of key1 and key2 is a 256-bit key)</li></ul>
202 * \brief This function prepares an XTS context for decryption and
205 * \param ctx The AES XTS context to which the key should be bound.
211 * <ul><li>256 bits (each of key1 and key2 is a 128-bit key)</li>
212 * <li>512 bits (each of key1 and key2 is a 256-bit key)</li></ul>
224 * \brief This function performs an AES single-block encryption or
233 * call to this API with the same context.
235 * \param ctx The AES context to use for encryption or decryption.
254 * \brief This function performs an AES-CBC encryption or decryption operation
264 * before the first call to this API with the same context.
277 * \param ctx The AES context to use for encryption or decryption.
305 * \brief This function performs an AES-XTS encryption or decryption
306 * operation for an entire XTS data unit.
308 * AES-XTS encrypts or decrypts blocks based on their location as
312 * NIST SP 800-38E limits the maximum size of a data unit to 2^20
316 * \param ctx The AES XTS context to use for AES XTS operations.
324 * bytes in little-endian format. For disk encryption, this
350 * \brief This function performs an AES-CFB128 encryption or decryption
357 * For CFB, you must set up the context with mbedtls_aes_setkey_enc(),
360 * because CFB mode uses the same key schedule for encryption and
372 * \param ctx The AES context to use for encryption or decryption.
398 * \brief This function performs an AES-CFB8 encryption or decryption
405 * Due to the nature of CFB, you must use the same key schedule for
407 * use the context initialized with mbedtls_aes_setkey_enc() for
419 * \param ctx The AES context to use for encryption or decryption.
444 * \brief This function performs an AES-OFB (Output Feedback Mode)
447 * For OFB, you must set up the context with
450 * because OFB mode uses the same key schedule for encryption and
453 * The OFB operation is identical for encryption or decryption,
463 * For non-streaming use, the iv should be initialised on each call
470 * \warning For the OFB mode, the initialisation vector must be unique
474 * \param ctx The AES context to use for encryption or decryption.
500 * \brief This function performs an AES-CTR encryption or decryption
504 * for both encryption and decryption operations. Therefore, you
505 * must use the context initialized with mbedtls_aes_setkey_enc()
506 * for both #MBEDTLS_AES_ENCRYPT and #MBEDTLS_AES_DECRYPT.
509 * would void the encryption for the two messages encrypted with
512 * There are two common strategies for managing nonces with CTR:
516 * set \p nonce_counter and \p nc_off to 0 for the first call, and
525 * nonce_counter buffer in two areas: the first one used for a
526 * per-message nonce, handled by yourself, and the second one
529 * For example, you might reserve the first 12 bytes for the
530 * per-message nonce, and the last 4 bytes for internal use. In that
537 * The per-message nonce (or information sufficient to reconstruct
542 * for example, with 96-bit random nonces, you should not encrypt
545 * Note that for both strategies, sizes are measured in blocks and
552 * \param ctx The AES context to use for encryption or decryption.
555 * \param nc_off The offset in the current \p stream_block, for
559 * \param nonce_counter The 128-bit nonce and counter.
560 * It must be a readable-writeable buffer of \c 16 Bytes.
561 * \param stream_block The saved stream block for resuming. This is
563 * It must be a readable-writeable buffer of \c 16 Bytes.
586 * \param ctx The AES context to use for encryption.
603 * \param ctx The AES context to use for decryption.