Lines Matching refs:data

83 /* Global data, support functions and library management */
587 * \param output_buffer_length Length of data written to output_buffer, must be
708 if (slot->key.data != NULL) {
712 slot->key.data = mbedtls_calloc(1, buffer_length);
713 if (slot->key.data == NULL) {
722 const uint8_t *data,
731 memcpy(slot->key.data, data, data_length);
737 const uint8_t *data, size_t data_length,
759 memcpy(key_buffer, data, data_length);
772 data, data_length,
783 data, data_length,
795 data, data_length,
1180 if (slot->key.data != NULL) {
1181 mbedtls_zeroize_and_free(slot->key.data, slot->key.bytes);
1184 slot->key.data = NULL;
1323 * persistent data. Start a transaction that will encompass these
1439 uint8_t *data,
1446 memcpy(data, key_buffer, key_buffer_size);
1447 memset(data + key_buffer_size, 0,
1456 uint8_t *data, size_t data_size, size_t *data_length)
1466 data, data_size, data_length);
1483 LOCAL_OUTPUT_DECLARE(data_external, data);
1486 * valid key representation. This way we know that data must be a valid
1487 * pointer and we can do things like memset(data, ..., data_size). */
1508 LOCAL_OUTPUT_ALLOC(data_external, data_size, data);
1511 slot->key.data, slot->key.bytes,
1512 data, data_size, data_length);
1519 LOCAL_OUTPUT_FREE(data_external, data);
1527 uint8_t *data,
1539 data, data_size, data_length);
1546 data,
1560 data,
1574 data, data_size,
1583 (void) data;
1599 LOCAL_OUTPUT_DECLARE(data_external, data);
1602 * valid key representation. This way we know that data must be a valid
1603 * pointer and we can do things like memset(data, ..., data_size). */
1620 LOCAL_OUTPUT_ALLOC(data_external, data_size, data);
1628 &slot->attr, slot->key.data, slot->key.bytes,
1629 data, data_size, data_length);
1634 LOCAL_OUTPUT_FREE(data_external, data);
1665 * validate the consistency of the attributes with any key data that may
1803 * persistent data. This is done by starting a transaction that will
1810 * transaction data. It will be needed to recover if the power
1897 psa_se_key_data_storage_t data;
1902 sizeof(data.slot_number),
1905 memcpy(&data.slot_number, &slot_number, sizeof(slot_number));
1907 (uint8_t *) &data,
1908 sizeof(data));
1915 slot->key.data,
1983 * but we still need to wipe the slot of confidential data. */
1999 * partial creation. All that's left is to update the transaction data
2015 * with the data in the slot.
2018 * the slot in memory is fully populated but before saving persistent data.
2045 LOCAL_INPUT_DECLARE(data_external, data);
2053 /* Reject zero-length symmetric keys (including raw data key objects).
2065 LOCAL_INPUT_ALLOC(data_external, data_length, data);
2077 if (slot->key.data == NULL) {
2080 attributes, data, data_length, &storage_size);
2093 data, data_length,
2094 slot->key.data,
2121 LOCAL_INPUT_FREE(data_external, data);
2246 source_slot->key.data,
2248 target_slot->key.data,
2256 source_slot->key.data,
2621 slot->key.data,
2627 slot->key.data,
2819 slot->key.data, slot->key.bytes,
2982 &slot->attr, slot->key.data, slot->key.bytes,
2988 &slot->attr, slot->key.data, slot->key.bytes,
3032 &slot->attr, slot->key.data, slot->key.bytes,
3037 &slot->attr, slot->key.data, slot->key.bytes,
3357 &slot->attr, slot->key.data, slot->key.bytes,
3413 &slot->attr, slot->key.data, slot->key.bytes,
3520 slot->key.data,
3677 slot->key.data,
4290 slot->key.data,
4296 slot->key.data,
4574 &slot->attr, slot->key.data, slot->key.bytes,
4640 &slot->attr, slot->key.data, slot->key.bytes,
4768 &slot->attr, slot->key.data, slot->key.bytes,
4835 &slot->attr, slot->key.data, slot->key.bytes,
4942 slot->key.data,
4948 slot->key.data,
5108 /* Declare the lengths of the message and additional data for multipart AEAD. */
5173 /* Pass additional data to an active multipart AEAD operation. */
5254 /* Additional data length was supplied, but not all the additional
5255 data was supplied.*/
5261 /* Too much data provided. */
5526 mbedtls_platform_zeroize(operation->ctx.tls12_ecjpake_to_pms.data,
5527 sizeof(operation->ctx.tls12_ecjpake_to_pms.data));
5851 status = psa_hash_compute(PSA_ALG_SHA_256, ecjpake->data,
5932 /* Zeroise buffers to clear sensitive data from memory. */
6032 /* Go through the error path to wipe all confidential data now
6096 static void psa_des_set_key_parity(uint8_t *data, size_t data_size)
6099 mbedtls_des_key_set_parity(data);
6102 mbedtls_des_key_set_parity(data + 8);
6105 mbedtls_des_key_set_parity(data + 16);
6136 * Note: Function allocates memory for *data buffer, so given *data should be
6145 uint8_t **data
6183 /* Note: This function is always called with *data == NULL and it
6184 * allocates memory for the data buffer. */
6185 *data = mbedtls_calloc(1, m_bytes);
6186 if (*data == NULL) {
6193 if ((status = psa_key_derivation_output_bytes(operation, *data, m_bytes)) != 0) {
6204 (*data)[0] &= clear_bit_mask;
6210 MBEDTLS_MPI_CHK(mbedtls_mpi_read_binary(&k, *data, m_bytes));
6221 MBEDTLS_MPI_CHK(mbedtls_mpi_write_binary(&k, *data, m_bytes));
6227 mbedtls_free(*data);
6228 *data = NULL;
6245 * Note: Function allocates memory for *data buffer, so given *data should be
6252 uint8_t **data
6270 *data = mbedtls_calloc(1, output_length);
6272 if (*data == NULL) {
6276 status = psa_key_derivation_output_bytes(operation, *data, output_length);
6284 (*data)[0] &= 248;
6285 (*data)[31] &= 127;
6286 (*data)[31] |= 64;
6289 (*data)[0] &= 252;
6290 (*data)[55] |= 128;
6302 psa_key_derivation_operation_t *operation, uint8_t **data)
6307 (void) data;
6312 size_t bits, psa_key_derivation_operation_t *operation, uint8_t **data)
6316 (void) data;
6327 uint8_t *data = NULL;
6342 status = psa_generate_derived_ecc_key_weierstrass_helper(slot, bits, operation, &data);
6348 status = psa_generate_derived_ecc_key_montgomery_helper(bits, operation, &data);
6360 data = mbedtls_calloc(1, bytes);
6361 if (data == NULL) {
6365 status = psa_key_derivation_output_bytes(operation, data, bytes);
6371 psa_des_set_key_parity(data, bytes);
6393 data, bytes,
6394 slot->key.data,
6402 mbedtls_free(data);
6723 const uint8_t *data,
6740 data, data_length);
6763 memcpy(hkdf->prk, data, data_length);
6787 data, data_length);
6840 memcpy(hkdf->info, data, data_length);
6853 const uint8_t *data,
6866 memcpy(prf->seed, data, data_length);
6876 const uint8_t *data,
6890 memcpy(prf->secret, data, data_length);
6900 const uint8_t *data,
6913 memcpy(prf->label, data, data_length);
6924 const uint8_t *data,
6929 return psa_tls12_prf_set_seed(prf, data, data_length);
6931 return psa_tls12_prf_set_key(prf, data, data_length);
6933 return psa_tls12_prf_set_label(prf, data, data_length);
6944 const uint8_t *data,
6997 memcpy(cur, data, data_length);
7008 const uint8_t *data,
7021 memcpy(prf->other_secret, data, data_length);
7035 const uint8_t *data,
7041 data, data_length);
7045 data,
7049 return psa_tls12_prf_input(prf, step, data, data_length);
7060 const uint8_t *data,
7069 if (data[0] != 0x04) {
7074 memcpy(ecjpake->data, data + 1, PSA_TLS12_ECJPAKE_TO_PMS_DATA_SIZE);
7084 uint64_t data)
7094 if (data > PSA_VENDOR_PBKDF2_MAX_ITERATIONS) {
7098 if (data == 0) {
7102 pbkdf2->input_cost = data;
7109 const uint8_t *data,
7133 memcpy(next_salt + pbkdf2->salt_length, data, data_length);
7194 const uint8_t *data,
7205 status = psa_pbkdf2_hmac_set_password(hash_alg, data, data_length,
7212 status = psa_pbkdf2_cmac_set_password(data, data_length,
7229 const uint8_t *data,
7234 return psa_pbkdf2_set_salt(pbkdf2, data, data_length);
7236 return psa_pbkdf2_set_password(pbkdf2, kdf_alg, data, data_length);
7303 const uint8_t *data,
7317 step, data, data_length);
7323 step, data, data_length);
7329 step, data, data_length);
7335 &operation->ctx.tls12_ecjpake_to_pms, step, data, data_length);
7341 step, data, data_length);
7346 (void) data;
7393 LOCAL_INPUT_DECLARE(data_external, data);
7395 LOCAL_INPUT_ALLOC(data_external, data_length, data);
7399 data, data_length);
7403 LOCAL_INPUT_FREE(data_external, data);
7440 slot->key.data,
7519 private_key->key.data,
7528 * to potentially free embedded data structures and wipe confidential data.
7661 * may be used as a key to protect sensitive data. Arrange for such
7664 * some constant data such as zeros, which would result in the data
7959 if (slot->key.data == NULL) {
7987 slot->key.data, slot->key.bytes,
8182 * testing of init flags, which requires locking the global data
8411 memset(&operation->data.inputs, 0, sizeof(operation->data.inputs));
8416 operation->data.inputs.cipher_suite = *cipher_suite;
8469 operation->data.inputs.password = mbedtls_calloc(1, slot->key.bytes);
8470 if (operation->data.inputs.password == NULL) {
8475 memcpy(operation->data.inputs.password, slot->key.data, slot->key.bytes);
8476 operation->data.inputs.password_len = slot->key.bytes;
8477 operation->data.inputs.attributes = slot->attr;
8505 if (operation->data.inputs.user_len != 0) {
8510 operation->data.inputs.user = mbedtls_calloc(1, user_id_len);
8511 if (operation->data.inputs.user == NULL) {
8518 memcpy(operation->data.inputs.user, user_id, user_id_len);
8519 operation->data.inputs.user_len = user_id_len;
8549 if (operation->data.inputs.peer_len != 0) {
8554 operation->data.inputs.peer = mbedtls_calloc(1, peer_id_len);
8555 if (operation->data.inputs.peer == NULL) {
8562 memcpy(operation->data.inputs.peer, peer_id, peer_id_len);
8563 operation->data.inputs.peer_len = peer_id_len;
8640 psa_crypto_driver_pake_inputs_t inputs = operation->data.inputs;
8653 mbedtls_platform_zeroize(&operation->data, sizeof(operation->data));
8967 if (operation->data.inputs.password != NULL) {
8968 mbedtls_zeroize_and_free(operation->data.inputs.password,
8969 operation->data.inputs.password_len);
8971 if (operation->data.inputs.user != NULL) {
8972 mbedtls_free(operation->data.inputs.user);
8974 if (operation->data.inputs.peer != NULL) {
8975 mbedtls_free(operation->data.inputs.peer);
8999 * \param[out] input_copy Pointer to a local copy in which to store the input data.