Lines Matching defs:output

216 /* Declare a local copy of an output buffer and a variable that will be used
220 * the exit label, so that the local output copy object is safe to be freed.
223 * - output is the name of a pointer to the buffer to be copied
227 #define LOCAL_OUTPUT_DECLARE(output, output_copy_name) \
228 psa_crypto_local_output_t LOCAL_OUTPUT_COPY_OF_##output = PSA_CRYPTO_LOCAL_OUTPUT_INIT; \
231 /* Allocate a copy of the buffer output and set the pointer output_copy to
237 * - output is the name of a pointer to the buffer to be copied
238 * - LOCAL_OUTPUT_DECLARE(output, output_copy) has previously been called
240 #define LOCAL_OUTPUT_ALLOC(output, length, output_copy) \
241 status = psa_crypto_local_output_alloc(output, length, \
242 &LOCAL_OUTPUT_COPY_OF_##output); \
246 output_copy = LOCAL_OUTPUT_COPY_OF_##output.buffer;
248 /* Free the local output copy allocated previously by LOCAL_OUTPUT_ALLOC()
253 * - output_copy is the name of the output copy pointer set by LOCAL_OUTPUT_ALLOC()
254 * - output is the name of the original buffer that was copied
256 #define LOCAL_OUTPUT_FREE(output, output_copy) \
260 local_output_status = psa_crypto_local_output_free(&LOCAL_OUTPUT_COPY_OF_##output); \
275 #define LOCAL_OUTPUT_DECLARE(output, output_copy_name) \
277 #define LOCAL_OUTPUT_ALLOC(output, length, output_copy) \
278 output_copy = output;
279 #define LOCAL_OUTPUT_FREE(output, output_copy) \
571 * \brief For output buffers which contain "tags"
574 * part of the output buffer (the whole buffer on
585 * \param output_buffer_size Size of output buffer. If zero, \p output_buffer
871 /* Get the (exact or at-least) output lengths for both sides of the
873 * have an output length dependent on the actual key size, so setting it
876 * Note that for at-least-this-length wildcard algorithms, the output
950 /* Get both the requested output length for the algorithm which is to be
951 * verified, and the default output length for the base algorithm.
952 * Note that none of the currently supported algorithms have an output
1485 /* Reject a zero-length output buffer now, since this can never be a
1601 /* Reject a zero-length output buffer now, since this can never be a
2552 /* Get the output length for the algorithm and key combination */
2728 /* In case of success, set the potential excess room in the output buffer
2730 * In case of error, set the output length and content to a safe default,
2731 * such that in case the caller misses an error check, the output would be
2825 /* In case of success, set the potential excess room in the output buffer
2827 * In case of error, set the output length and content to a safe default,
2828 * such that in case the caller misses an error check, the output would be
3328 LOCAL_OUTPUT_DECLARE(output_external, output);
3333 (void) output;
3354 LOCAL_OUTPUT_ALLOC(output_external, output_size, output);
3359 output, output_size, output_length);
3365 LOCAL_OUTPUT_FREE(output_external, output);
3385 LOCAL_OUTPUT_DECLARE(output_external, output);
3390 (void) output;
3410 LOCAL_OUTPUT_ALLOC(output_external, output_size, output);
3415 output, output_size, output_length);
3422 LOCAL_OUTPUT_FREE(output_external, output);
4196 static psa_status_t psa_generate_random_internal(uint8_t *output,
4206 output, output_size,
4227 ret = mbedtls_ctr_drbg_random(&global_data.rng.drbg, output, request_size);
4229 ret = mbedtls_hmac_drbg_random(&global_data.rng.drbg, output, request_size);
4235 output += request_size;
4433 LOCAL_OUTPUT_DECLARE(output_external, output);
4446 LOCAL_OUTPUT_ALLOC(output_external, output_size, output);
4451 output,
4461 LOCAL_OUTPUT_FREE(output_external, output);
4473 LOCAL_OUTPUT_DECLARE(output_external, output);
4485 LOCAL_OUTPUT_ALLOC(output_external, output_size, output);
4488 output,
4500 LOCAL_OUTPUT_FREE(output_external, output);
4538 LOCAL_OUTPUT_DECLARE(output_external, output);
4571 LOCAL_OUTPUT_ALLOC(output_external, output_size, output);
4576 psa_crypto_buffer_offset(output, default_iv_length),
4587 memcpy(output, local_iv, default_iv_length);
4595 LOCAL_OUTPUT_FREE(output_external, output);
4613 LOCAL_OUTPUT_DECLARE(output_external, output);
4637 LOCAL_OUTPUT_ALLOC(output_external, output_size, output);
4642 output, output_size, output_length);
4655 LOCAL_OUTPUT_FREE(output_external, output);
5236 LOCAL_OUTPUT_DECLARE(output_external, output);
5239 LOCAL_OUTPUT_ALLOC(output_external, output_size, output);
5277 output, output_size,
5288 LOCAL_OUTPUT_FREE(output_external, output);
5465 #define HKDF_STATE_OUTPUT 3 /* output started */
5576 uint8_t *output,
5605 memcpy(output, hkdf->output_block + hkdf->offset_in_block, n);
5606 output += n;
5612 /* We can't be wanting more output after the last block, otherwise
5677 /* We can't be wanting more output after block 0xff, otherwise
5702 * `HMAC_hash(secret, A(i) + seed)` from which the output
5790 uint8_t *output,
5827 memcpy(output, tls12_prf->output_block + offset, length);
5828 output += length;
5841 uint8_t *output,
5852 PSA_TLS12_ECJPAKE_TO_PMS_DATA_SIZE, output, output_length,
5940 uint8_t *output,
5979 memcpy(output, pbkdf2->output_block + pbkdf2->bytes_used, n);
5980 output += n;
6010 LOCAL_OUTPUT_DECLARE(output_external, output);
6029 LOCAL_OUTPUT_ALLOC(output_external, output_length, output);
6043 output, output_length);
6051 kdf_alg, output,
6059 &operation->ctx.tls12_ecjpake_to_pms, output, output_length);
6065 output, output_length);
6072 LOCAL_OUTPUT_FREE(output_external, output);
6086 if (output != NULL) {
6087 memset(output, '!', output_length);
6091 LOCAL_OUTPUT_FREE(output_external, output);
6804 /* The only block of output is the PRK. */
7145 uint8_t *output,
7150 return psa_hash_compute(hash_alg, input, input_len, output,
7153 memcpy(output, input, input_len);
7163 uint8_t *output,
7179 output,
7185 memcpy(output, input, input_len);
7432 * permission to output to a key object. */
7622 LOCAL_OUTPUT_DECLARE(output_external, output);
7623 LOCAL_OUTPUT_ALLOC(output_external, output_size, output);
7636 * for the output size. The PSA specification only guarantees that this
7638 * but it might be nice to allow smaller buffers if the output fits.
7653 output, output_size,
7657 /* Check for successful allocation of output,
7659 if (output != NULL && status != PSA_SUCCESS) {
7660 /* If an error happens and is not handled properly, the output
7667 psa_generate_random_internal(output, output_size);
7671 if (output == NULL) {
7672 /* output allocation failed. */
7679 LOCAL_OUTPUT_FREE(output_external, output);
7763 LOCAL_OUTPUT_DECLARE(output_external, output);
7764 LOCAL_OUTPUT_ALLOC(output_external, output_size, output);
7766 status = psa_generate_random_internal(output, output_size);
7771 LOCAL_OUTPUT_FREE(output_external, output);
8725 /* End of an input/output */
8763 LOCAL_OUTPUT_DECLARE(output_external, output);
8800 LOCAL_OUTPUT_ALLOC(output_external, output_size, output);
8803 output, output_size, output_length);
8824 LOCAL_OUTPUT_FREE(output_external, output);
8910 psa_key_derivation_operation_t *output)
8946 status = psa_key_derivation_input_bytes(output,
8985 * copy, before output copy and after output copy, respectively.
8991 void (*psa_output_pre_copy_hook)(const uint8_t *output, size_t output_len) = NULL;
8992 void (*psa_output_post_copy_hook)(const uint8_t *output, size_t output_len) = NULL;
9034 /** Copy from a local output buffer into a user-supplied one.
9036 * \param[in] output_copy Pointer to a local buffer containing the output.
9038 * \param[out] output Pointer to user-supplied output buffer.
9039 * \param[out] output_len Length of the user-supplied output buffer.
9043 * user-supplied output buffer is too small to
9048 uint8_t *output, size_t output_len)
9056 psa_output_pre_copy_hook(output, output_len);
9061 memcpy(output, output_copy, output_copy_len);
9066 psa_output_post_copy_hook(output, output_len);
9116 psa_status_t psa_crypto_local_output_alloc(uint8_t *output, size_t output_len,
9131 local_output->original = output;