Lines Matching refs:storage_format
241 psa_persistent_key_storage_format *storage_format = in psa_format_key_data_for_storage() local
244 memcpy(storage_format->magic, PSA_KEY_STORAGE_MAGIC_HEADER, in psa_format_key_data_for_storage()
246 MBEDTLS_PUT_UINT32_LE(0, storage_format->version, 0); in psa_format_key_data_for_storage()
247 MBEDTLS_PUT_UINT32_LE(attr->lifetime, storage_format->lifetime, 0); in psa_format_key_data_for_storage()
248 MBEDTLS_PUT_UINT16_LE((uint16_t) attr->type, storage_format->type, 0); in psa_format_key_data_for_storage()
249 MBEDTLS_PUT_UINT16_LE((uint16_t) attr->bits, storage_format->bits, 0); in psa_format_key_data_for_storage()
250 MBEDTLS_PUT_UINT32_LE(attr->policy.usage, storage_format->policy, 0); in psa_format_key_data_for_storage()
251 MBEDTLS_PUT_UINT32_LE(attr->policy.alg, storage_format->policy, sizeof(uint32_t)); in psa_format_key_data_for_storage()
252 MBEDTLS_PUT_UINT32_LE(attr->policy.alg2, storage_format->policy, 2 * sizeof(uint32_t)); in psa_format_key_data_for_storage()
253 MBEDTLS_PUT_UINT32_LE(data_length, storage_format->data_len, 0); in psa_format_key_data_for_storage()
254 memcpy(storage_format->key_data, data, data_length); in psa_format_key_data_for_storage()
273 const psa_persistent_key_storage_format *storage_format = in psa_parse_key_data_from_storage() local
277 if (storage_data_length < sizeof(*storage_format)) { in psa_parse_key_data_from_storage()
286 version = MBEDTLS_GET_UINT32_LE(storage_format->version, 0); in psa_parse_key_data_from_storage()
291 *key_data_length = MBEDTLS_GET_UINT32_LE(storage_format->data_len, 0); in psa_parse_key_data_from_storage()
292 if (*key_data_length > (storage_data_length - sizeof(*storage_format)) || in psa_parse_key_data_from_storage()
304 memcpy(*key_data, storage_format->key_data, *key_data_length); in psa_parse_key_data_from_storage()
307 attr->lifetime = MBEDTLS_GET_UINT32_LE(storage_format->lifetime, 0); in psa_parse_key_data_from_storage()
308 attr->type = MBEDTLS_GET_UINT16_LE(storage_format->type, 0); in psa_parse_key_data_from_storage()
309 attr->bits = MBEDTLS_GET_UINT16_LE(storage_format->bits, 0); in psa_parse_key_data_from_storage()
310 attr->policy.usage = MBEDTLS_GET_UINT32_LE(storage_format->policy, 0); in psa_parse_key_data_from_storage()
311 attr->policy.alg = MBEDTLS_GET_UINT32_LE(storage_format->policy, sizeof(uint32_t)); in psa_parse_key_data_from_storage()
312 attr->policy.alg2 = MBEDTLS_GET_UINT32_LE(storage_format->policy, 2 * sizeof(uint32_t)); in psa_parse_key_data_from_storage()