Lines Matching defs:input
174 /* Declare a local copy of an input buffer and a variable that will be used
178 * the exit label, so that the local input copy object is safe to be freed.
181 * - input is the name of a pointer to the buffer to be copied
185 #define LOCAL_INPUT_DECLARE(input, input_copy_name) \
186 psa_crypto_local_input_t LOCAL_INPUT_COPY_OF_##input = PSA_CRYPTO_LOCAL_INPUT_INIT; \
189 /* Allocate a copy of the buffer input and set the pointer input_copy to
195 * - input is the name of a pointer to the buffer to be copied
196 * - LOCAL_INPUT_DECLARE(input, input_copy) has previously been called
198 #define LOCAL_INPUT_ALLOC(input, length, input_copy) \
199 status = psa_crypto_local_input_alloc(input, length, \
200 &LOCAL_INPUT_COPY_OF_##input); \
204 input_copy = LOCAL_INPUT_COPY_OF_##input.buffer;
206 /* Free the local input copy allocated previously by LOCAL_INPUT_ALLOC()
209 * - input_copy is the name of the input copy pointer set by LOCAL_INPUT_ALLOC()
210 * - input is the name of the original buffer that was copied
212 #define LOCAL_INPUT_FREE(input, input_copy) \
214 psa_crypto_local_input_free(&LOCAL_INPUT_COPY_OF_##input);
269 #define LOCAL_INPUT_DECLARE(input, input_copy_name) \
271 #define LOCAL_INPUT_ALLOC(input, length, input_copy) \
272 input_copy = input;
273 #define LOCAL_INPUT_FREE(input, input_copy) \
578 * input), in case the caller doesn't check the
1784 * an input (generate, device) but not for those where the bit-size
2327 LOCAL_INPUT_DECLARE(input_external, input);
2335 * zero-length input, which may have an invalid pointer. */
2340 LOCAL_INPUT_ALLOC(input_external, input_length, input);
2341 status = psa_driver_wrapper_hash_update(operation, input, input_length);
2348 LOCAL_INPUT_FREE(input_external, input);
2432 LOCAL_INPUT_DECLARE(input_external, input);
2440 LOCAL_INPUT_ALLOC(input_external, input_length, input);
2442 status = psa_driver_wrapper_hash_compute(alg, input, input_length,
2448 LOCAL_INPUT_FREE(input_external, input);
2461 LOCAL_INPUT_DECLARE(input_external, input);
2469 LOCAL_INPUT_ALLOC(input_external, input_length, input);
2471 alg, input, input_length,
2490 LOCAL_INPUT_FREE(input_external, input);
2617 /* Dispatch the MAC setup call with validated input */
2661 LOCAL_INPUT_DECLARE(input_external, input);
2669 * zero-length input, which may have an invalid pointer. */
2675 LOCAL_INPUT_ALLOC(input_external, input_length, input);
2676 status = psa_driver_wrapper_mac_update(operation, input, input_length);
2685 LOCAL_INPUT_FREE(input_external, input);
2785 const uint8_t *input,
2821 input, input_length,
2852 LOCAL_INPUT_DECLARE(input_external, input);
2855 LOCAL_INPUT_ALLOC(input_external, input_length, input);
2858 input, input_length,
2864 LOCAL_INPUT_FREE(input_external, input);
2880 LOCAL_INPUT_DECLARE(input_external, input);
2883 LOCAL_INPUT_ALLOC(input_external, input_length, input);
2885 input, input_length,
2905 LOCAL_INPUT_FREE(input_external, input);
2940 const uint8_t *input,
2958 * that signature must be a valid pointer. (On the other hand, the input
2983 alg, input, input_length,
2989 alg, input, input_length,
3006 const uint8_t *input,
3033 alg, input, input_length,
3038 alg, input, input_length,
3053 const uint8_t *input,
3067 input, input_length,
3092 LOCAL_INPUT_DECLARE(input_external, input);
3095 LOCAL_INPUT_ALLOC(input_external, input_length, input);
3097 status = psa_sign_internal(key, 1, alg, input, input_length, signature,
3103 LOCAL_INPUT_FREE(input_external, input);
3113 const uint8_t *input,
3126 input, input_length,
3150 LOCAL_INPUT_DECLARE(input_external, input);
3153 LOCAL_INPUT_ALLOC(input_external, input_length, input);
3155 status = psa_verify_internal(key, 1, alg, input, input_length, signature,
3161 LOCAL_INPUT_FREE(input_external, input);
3326 LOCAL_INPUT_DECLARE(input_external, input);
3330 (void) input;
3352 LOCAL_INPUT_ALLOC(input_external, input_length, input);
3358 alg, input, input_length, salt, salt_length,
3363 LOCAL_INPUT_FREE(input_external, input);
3383 LOCAL_INPUT_DECLARE(input_external, input);
3387 (void) input;
3408 LOCAL_INPUT_ALLOC(input_external, input_length, input);
3414 alg, input, input_length, salt, salt_length,
3420 LOCAL_INPUT_FREE(input_external, input);
4432 LOCAL_INPUT_DECLARE(input_external, input);
4445 LOCAL_INPUT_ALLOC(input_external, input_length, input);
4449 input,
4460 LOCAL_INPUT_FREE(input_external, input);
4537 LOCAL_INPUT_DECLARE(input_external, input);
4570 LOCAL_INPUT_ALLOC(input_external, input_length, input);
4575 alg, local_iv, default_iv_length, input, input_length,
4594 LOCAL_INPUT_FREE(input_external, input);
4612 LOCAL_INPUT_DECLARE(input_external, input);
4636 LOCAL_INPUT_ALLOC(input_external, input_length, input);
4641 alg, input, input_length,
4654 LOCAL_INPUT_FREE(input_external, input);
5180 LOCAL_INPUT_DECLARE(input_external, input);
5181 LOCAL_INPUT_ALLOC(input_external, input_length, input);
5208 status = psa_driver_wrapper_aead_update_ad(operation, input,
5218 LOCAL_INPUT_FREE(input_external, input);
5235 LOCAL_INPUT_DECLARE(input_external, input);
5238 LOCAL_INPUT_ALLOC(input_external, input_length, input);
5276 status = psa_driver_wrapper_aead_update(operation, input, input_length,
5287 LOCAL_INPUT_FREE(input_external, input);
5462 #define HKDF_STATE_INIT 0 /* no input yet */
6758 /* Allow only input that fits expected prk size */
7143 const uint8_t *input,
7150 return psa_hash_compute(hash_alg, input, input_len, output,
7153 memcpy(output, input, input_len);
7161 static psa_status_t psa_pbkdf2_cmac_set_password(const uint8_t *input,
7178 PSA_ALG_CMAC, input, input_len,
7185 memcpy(output, input, input_len);
7244 * input step of a key derivation.
7250 * that the input was passed as a buffer rather than via a key object.
7431 /* Passing a key object as a SECRET or PASSWORD input unlocks the
8725 /* End of an input/output */
8842 LOCAL_INPUT_DECLARE(input_external, input);
8878 LOCAL_INPUT_ALLOC(input_external, input_length, input);
8880 input, input_length);
8901 LOCAL_INPUT_FREE(input_external, input);
8984 /* Memory copying test hooks. These are called before input copy, after input
8989 void (*psa_input_pre_copy_hook)(const uint8_t *input, size_t input_len) = NULL;
8990 void (*psa_input_post_copy_hook)(const uint8_t *input, size_t input_len) = NULL;
8995 /** Copy from an input buffer to a local copy.
8997 * \param[in] input Pointer to input buffer.
8998 * \param[in] input_len Length of the input buffer.
8999 * \param[out] input_copy Pointer to a local copy in which to store the input data.
9005 * input buffer.
9008 psa_status_t psa_crypto_copy_input(const uint8_t *input, size_t input_len,
9017 psa_input_pre_copy_hook(input, input_len);
9022 memcpy(input_copy, input, input_len);
9027 psa_input_post_copy_hook(input, input_len);
9073 psa_status_t psa_crypto_local_input_alloc(const uint8_t *input, size_t input_len,
9094 status = psa_crypto_copy_input(input, input_len,