6#ifndef CRYPTO_SERVICE_H__
7#define CRYPTO_SERVICE_H__
40 const psa_key_attributes_t *attributes,
41 mbedtls_svc_key_id_t *target_key);
54 size_t data_length, mbedtls_svc_key_id_t *key);
75 uint8_t *hash,
size_t hash_size,
size_t *hash_length);
82 const uint8_t *hash,
size_t hash_length);
102 size_t hash_size,
size_t *hash_length);
122 mbedtls_psa_client_handle_t *p_handle);
129 const uint8_t *input,
size_t input_length, uint8_t *mac,
130 size_t mac_size,
size_t *mac_length);
137 size_t input_length,
const uint8_t *mac,
size_t mac_length);
144 psa_algorithm_t alg);
151 mbedtls_svc_key_id_t key, psa_algorithm_t alg);
158 size_t input_length);
165 size_t mac_size,
size_t *mac_length);
185 const uint8_t *input,
size_t input_length, uint8_t *output,
186 size_t output_size,
size_t *output_length);
193 const uint8_t *input,
size_t input_length, uint8_t *output,
194 size_t output_size,
size_t *output_length);
201 mbedtls_svc_key_id_t key, psa_algorithm_t alg);
208 mbedtls_svc_key_id_t key, psa_algorithm_t alg);
215 size_t iv_size,
size_t *iv_length);
229 size_t input_length, uint8_t *output,
size_t output_size,
230 size_t *output_length);
237 size_t output_size,
size_t *output_length);
250 const uint8_t *nonce,
size_t nonce_length,
251 const uint8_t *additional_data,
size_t additional_data_length,
252 const uint8_t *plaintext,
size_t plaintext_length,
253 uint8_t *ciphertext,
size_t ciphertext_size,
254 size_t *ciphertext_length);
261 const uint8_t *nonce,
size_t nonce_length,
262 const uint8_t *additional_data,
size_t additional_data_length,
263 const uint8_t *ciphertext,
size_t ciphertext_length,
264 uint8_t *plaintext,
size_t plaintext_size,
265 size_t *plaintext_length);
272 mbedtls_svc_key_id_t key, psa_algorithm_t alg);
279 mbedtls_svc_key_id_t key, psa_algorithm_t alg);
286 size_t nonce_size,
size_t *nonce_length);
293 size_t nonce_length);
300 size_t plaintext_length);
307 size_t input_length);
314 size_t input_length, uint8_t *output,
size_t output_size,
315 size_t *output_length);
322 size_t ciphertext_size,
size_t *ciphertext_length, uint8_t *tag,
323 size_t tag_size,
size_t *tag_length);
330 size_t plaintext_size,
size_t *plaintext_length,
331 const uint8_t *tag,
size_t tag_length);
344 const uint8_t *input,
size_t input_length, uint8_t *signature,
345 size_t signature_size,
size_t *signature_length);
352 const uint8_t *input,
size_t input_length,
353 const uint8_t *signature,
size_t signature_length);
359psa_status_t
ssf_psa_sign_hash(mbedtls_svc_key_id_t key, psa_algorithm_t alg,
const uint8_t *hash,
360 size_t hash_length, uint8_t *signature,
size_t signature_size,
361 size_t *signature_length);
368 size_t hash_length,
const uint8_t *signature,
369 size_t signature_length);
376 const uint8_t *input,
size_t input_length,
377 const uint8_t *salt,
size_t salt_length, uint8_t *output,
378 size_t output_size,
size_t *output_length);
385 const uint8_t *input,
size_t input_length,
386 const uint8_t *salt,
size_t salt_length, uint8_t *output,
387 size_t output_size,
size_t *output_length);
394 psa_algorithm_t alg);
415 psa_key_derivation_step_t step,
const uint8_t *data,
423 psa_key_derivation_step_t step, uint64_t value);
430 psa_key_derivation_step_t step,
431 mbedtls_svc_key_id_t key);
438 psa_key_derivation_step_t step,
439 mbedtls_svc_key_id_t private_key,
440 const uint8_t *peer_key,
size_t peer_key_length);
447 uint8_t *output,
size_t output_length);
454 mbedtls_psa_client_handle_t *p_handle,
455 mbedtls_svc_key_id_t *key);
468 const uint8_t *peer_key,
size_t peer_key_length,
469 uint8_t *output,
size_t output_size,
size_t *output_length);
482 mbedtls_svc_key_id_t *key);
489 mbedtls_svc_key_id_t password_key,
490 const psa_pake_cipher_suite_t *cipher_suite);
524 uint8_t *output,
size_t output_size,
size_t *output_length);
531 const uint8_t *input,
size_t input_length);
538 const psa_key_attributes_t *attributes,
539 mbedtls_svc_key_id_t *key);
psa_status_t ssf_psa_destroy_key(mbedtls_svc_key_id_t key)
Execute psa_destroy_key over SSF.
psa_status_t ssf_psa_mac_sign_finish(mbedtls_psa_client_handle_t *p_handle, uint8_t *mac, size_t mac_size, size_t *mac_length)
Execute psa_mac_sign_finish over SSF.
psa_status_t ssf_psa_pake_set_user(mbedtls_psa_client_handle_t *p_handle, const uint8_t *user_id, size_t user_id_len)
Execute psa_pake_set_user over SSF.
psa_status_t ssf_psa_aead_finish(mbedtls_psa_client_handle_t *p_handle, uint8_t *ciphertext, size_t ciphertext_size, size_t *ciphertext_length, uint8_t *tag, size_t tag_size, size_t *tag_length)
Execute psa_aead_finish over SSF.
psa_status_t ssf_psa_cipher_encrypt_setup(mbedtls_psa_client_handle_t *p_handle, mbedtls_svc_key_id_t key, psa_algorithm_t alg)
Execute psa_cipher_encrypt_setup over SSF.
psa_status_t ssf_psa_pake_setup(mbedtls_psa_client_handle_t *p_handle, mbedtls_svc_key_id_t password_key, const psa_pake_cipher_suite_t *cipher_suite)
Execute psa_pake_setup over SSF.
psa_status_t ssf_psa_aead_decrypt(mbedtls_svc_key_id_t key, psa_algorithm_t alg, const uint8_t *nonce, size_t nonce_length, const uint8_t *additional_data, size_t additional_data_length, const uint8_t *ciphertext, size_t ciphertext_length, uint8_t *plaintext, size_t plaintext_size, size_t *plaintext_length)
Execute psa_aead_decrypt over SSF.
psa_status_t ssf_psa_cipher_decrypt_setup(mbedtls_psa_client_handle_t *p_handle, mbedtls_svc_key_id_t key, psa_algorithm_t alg)
Execute psa_cipher_decrypt_setup over SSF.
psa_status_t ssf_psa_asymmetric_decrypt(mbedtls_svc_key_id_t key, psa_algorithm_t alg, const uint8_t *input, size_t input_length, const uint8_t *salt, size_t salt_length, uint8_t *output, size_t output_size, size_t *output_length)
Execute psa_asymmetric_decrypt over SSF.
psa_status_t ssf_psa_asymmetric_encrypt(mbedtls_svc_key_id_t key, psa_algorithm_t alg, const uint8_t *input, size_t input_length, const uint8_t *salt, size_t salt_length, uint8_t *output, size_t output_size, size_t *output_length)
Execute psa_asymmetric_encrypt over SSF.
psa_status_t ssf_psa_aead_verify(mbedtls_psa_client_handle_t *p_handle, uint8_t *plaintext, size_t plaintext_size, size_t *plaintext_length, const uint8_t *tag, size_t tag_length)
Execute psa_aead_verify over SSF.
psa_status_t ssf_psa_key_derivation_set_capacity(mbedtls_psa_client_handle_t *p_handle, size_t capacity)
Execute psa_key_derivation_set_capacity over SSF.
psa_status_t ssf_psa_hash_update(mbedtls_psa_client_handle_t *p_handle, const uint8_t *input, size_t input_length)
Execute psa_hash_update over SSF.
psa_status_t ssf_psa_verify_message(mbedtls_svc_key_id_t key, psa_algorithm_t alg, const uint8_t *input, size_t input_length, const uint8_t *signature, size_t signature_length)
Execute psa_verify_message over SSF.
psa_status_t ssf_psa_hash_verify(mbedtls_psa_client_handle_t *p_handle, const uint8_t *hash, size_t hash_length)
Execute psa_hash_verify over SSF.
psa_status_t ssf_psa_key_derivation_output_bytes(mbedtls_psa_client_handle_t *p_handle, uint8_t *output, size_t output_length)
Execute psa_key_derivation_output_bytes over SSF.
psa_status_t ssf_psa_mac_verify_setup(mbedtls_psa_client_handle_t *p_handle, mbedtls_svc_key_id_t key, psa_algorithm_t alg)
Execute psa_mac_verify_setup over SSF.
psa_status_t ssf_psa_aead_encrypt_setup(mbedtls_psa_client_handle_t *p_handle, mbedtls_svc_key_id_t key, psa_algorithm_t alg)
Execute psa_aead_encrypt_setup over SSF.
psa_status_t ssf_psa_mac_update(mbedtls_psa_client_handle_t *p_handle, const uint8_t *input, size_t input_length)
Execute psa_mac_update over SSF.
psa_status_t ssf_psa_key_derivation_get_capacity(mbedtls_psa_client_handle_t handle, size_t *capacity)
Execute psa_key_derivation_get_capacity over SSF.
psa_status_t ssf_psa_sign_message(mbedtls_svc_key_id_t key, psa_algorithm_t alg, const uint8_t *input, size_t input_length, uint8_t *signature, size_t signature_size, size_t *signature_length)
Execute psa_sign_message over SSF.
psa_status_t ssf_psa_aead_encrypt(mbedtls_svc_key_id_t key, psa_algorithm_t alg, const uint8_t *nonce, size_t nonce_length, const uint8_t *additional_data, size_t additional_data_length, const uint8_t *plaintext, size_t plaintext_length, uint8_t *ciphertext, size_t ciphertext_size, size_t *ciphertext_length)
Execute psa_aead_encrypt over SSF.
psa_status_t ssf_psa_key_derivation_key_agreement(mbedtls_psa_client_handle_t *p_handle, psa_key_derivation_step_t step, mbedtls_svc_key_id_t private_key, const uint8_t *peer_key, size_t peer_key_length)
Execute psa_key_derivation_key_agreement over SSF.
psa_status_t ssf_psa_mac_compute(mbedtls_svc_key_id_t key, psa_algorithm_t alg, const uint8_t *input, size_t input_length, uint8_t *mac, size_t mac_size, size_t *mac_length)
Execute psa_mac_compute over SSF.
psa_status_t ssf_psa_aead_set_nonce(mbedtls_psa_client_handle_t *p_handle, const uint8_t *nonce, size_t nonce_length)
Execute psa_aead_set_nonce over SSF.
psa_status_t ssf_psa_key_derivation_input_integer(mbedtls_psa_client_handle_t *p_handle, psa_key_derivation_step_t step, uint64_t value)
Execute psa_key_derivation_input_integer over SSF.
psa_status_t ssf_psa_key_derivation_output_key(const psa_key_attributes_t *attributes, mbedtls_psa_client_handle_t *p_handle, mbedtls_svc_key_id_t *key)
Execute psa_key_derivation_output_key over SSF.
psa_status_t ssf_psa_reset_key_attributes(psa_key_attributes_t *attributes)
Execute psa_reset_key_attributes over SSF.
psa_status_t ssf_psa_hash_abort(mbedtls_psa_client_handle_t *p_handle)
Execute psa_hash_abort over SSF.
psa_status_t ssf_psa_mac_abort(mbedtls_psa_client_handle_t *p_handle)
Execute psa_mac_abort over SSF.
psa_status_t ssf_psa_pake_set_role(mbedtls_psa_client_handle_t *p_handle, psa_pake_role_t role)
Execute psa_pake_set_role over SSF.
psa_status_t ssf_psa_cipher_abort(mbedtls_psa_client_handle_t *p_handle)
Execute psa_cipher_abort over SSF.
psa_status_t ssf_psa_hash_compare(psa_algorithm_t alg, const uint8_t *input, size_t input_length, const uint8_t *hash, size_t hash_length)
Execute psa_hash_compare over SSF.
psa_status_t ssf_psa_aead_abort(mbedtls_psa_client_handle_t *p_handle)
Execute psa_aead_abort over SSF.
psa_status_t ssf_psa_cipher_set_iv(mbedtls_psa_client_handle_t *p_handle, const uint8_t *iv, size_t iv_length)
Execute psa_cipher_set_iv over SSF.
psa_status_t ssf_psa_generate_key(const psa_key_attributes_t *attributes, mbedtls_svc_key_id_t *key)
Execute psa_generate_key over SSF.
psa_status_t ssf_psa_purge_key(mbedtls_svc_key_id_t key)
Execute psa_purge_key over SSF.
psa_status_t ssf_psa_export_public_key(mbedtls_svc_key_id_t key, uint8_t *data, size_t data_size, size_t *data_length)
Execute psa_export_public_key over SSF.
psa_status_t ssf_psa_pake_set_context(mbedtls_psa_client_handle_t *p_handle, const uint8_t *context, size_t context_len)
Execute psa_pake_set_context over SSF.
psa_status_t ssf_psa_raw_key_agreement(psa_algorithm_t alg, mbedtls_svc_key_id_t private_key, const uint8_t *peer_key, size_t peer_key_length, uint8_t *output, size_t output_size, size_t *output_length)
Execute psa_raw_key_agreement over SSF.
psa_status_t ssf_psa_mac_verify_finish(mbedtls_psa_client_handle_t *p_handle, const uint8_t *mac, size_t mac_length)
Execute psa_mac_verify_finish over SSF.
psa_status_t ssf_psa_hash_clone(mbedtls_psa_client_handle_t handle, mbedtls_psa_client_handle_t *p_handle)
Execute psa_hash_clone over SSF.
psa_status_t ssf_psa_aead_update_ad(mbedtls_psa_client_handle_t *p_handle, const uint8_t *input, size_t input_length)
Execute psa_aead_update_ad over SSF.
psa_status_t ssf_psa_export_key(mbedtls_svc_key_id_t key, uint8_t *data, size_t data_size, size_t *data_length)
Execute psa_export_key over SSF.
psa_status_t ssf_psa_mac_verify(mbedtls_svc_key_id_t key, psa_algorithm_t alg, const uint8_t *input, size_t input_length, const uint8_t *mac, size_t mac_length)
Execute psa_mac_verify over SSF.
psa_status_t ssf_psa_verify_hash(mbedtls_svc_key_id_t key, psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, const uint8_t *signature, size_t signature_length)
Execute psa_verify_hash over SSF.
psa_status_t ssf_psa_key_derivation_abort(mbedtls_psa_client_handle_t *p_handle)
Execute psa_key_derivation_abort over SSF.
psa_status_t ssf_psa_key_derivation_input_key(mbedtls_psa_client_handle_t *p_handle, psa_key_derivation_step_t step, mbedtls_svc_key_id_t key)
Execute psa_key_derivation_input_key over SSF.
psa_status_t ssf_psa_generate_random(uint8_t *output, size_t output_size)
Execute psa_generate_random over SSF.
psa_status_t ssf_psa_mac_sign_setup(mbedtls_psa_client_handle_t *p_handle, mbedtls_svc_key_id_t key, psa_algorithm_t alg)
Execute psa_mac_sign_setup over SSF.
psa_status_t ssf_psa_pake_output(mbedtls_psa_client_handle_t *p_handle, psa_pake_step_t step, uint8_t *output, size_t output_size, size_t *output_length)
Execute psa_pake_output over SSF.
psa_status_t ssf_psa_sign_hash(mbedtls_svc_key_id_t key, psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, uint8_t *signature, size_t signature_size, size_t *signature_length)
Execute psa_sign_hash over SSF.
psa_status_t ssf_psa_aead_set_lengths(mbedtls_psa_client_handle_t *p_handle, size_t ad_length, size_t plaintext_length)
Execute psa_aead_set_lengths over SSF.
psa_status_t ssf_psa_copy_key(mbedtls_svc_key_id_t source_key, const psa_key_attributes_t *attributes, mbedtls_svc_key_id_t *target_key)
Execute psa_copy_key over SSF.
psa_status_t ssf_psa_get_key_attributes(mbedtls_svc_key_id_t key, psa_key_attributes_t *attributes)
Execute psa_get_key_attributes over SSF.
psa_status_t ssf_psa_aead_update(mbedtls_psa_client_handle_t *p_handle, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length)
Execute psa_aead_update over SSF.
psa_status_t ssf_psa_cipher_decrypt(mbedtls_svc_key_id_t key, psa_algorithm_t alg, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length)
Execute psa_cipher_decrypt over SSF.
psa_status_t ssf_psa_cipher_encrypt(mbedtls_svc_key_id_t key, psa_algorithm_t alg, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length)
Execute psa_cipher_encrypt over SSF.
psa_status_t ssf_psa_pake_abort(mbedtls_psa_client_handle_t *p_handle)
Execute psa_pake_abort over SSF.
psa_status_t ssf_psa_pake_input(mbedtls_psa_client_handle_t *p_handle, psa_pake_step_t step, const uint8_t *input, size_t input_length)
Execute psa_pake_input over SSF.
psa_status_t ssf_psa_cipher_update(mbedtls_psa_client_handle_t *p_handle, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length)
Execute psa_cipher_update over SSF.
psa_status_t ssf_psa_aead_decrypt_setup(mbedtls_psa_client_handle_t *p_handle, mbedtls_svc_key_id_t key, psa_algorithm_t alg)
Execute psa_aead_decrypt_setup over SSF.
psa_status_t ssf_psa_hash_finish(mbedtls_psa_client_handle_t *p_handle, uint8_t *hash, size_t hash_size, size_t *hash_length)
Execute psa_hash_finish over SSF.
psa_status_t ssf_psa_key_derivation_setup(mbedtls_psa_client_handle_t *p_handle, psa_algorithm_t alg)
Execute psa_key_derivation_setup over SSF.
psa_status_t ssf_psa_hash_setup(mbedtls_psa_client_handle_t *p_handle, psa_algorithm_t alg)
Execute psa_hash_setup over SSF.
psa_status_t ssf_psa_pake_get_shared_key(mbedtls_psa_client_handle_t *p_handle, const psa_key_attributes_t *attributes, mbedtls_svc_key_id_t *key)
Execute psa_pake_get_shared_key over SSF.
psa_status_t ssf_psa_cipher_generate_iv(mbedtls_psa_client_handle_t *p_handle, uint8_t *iv, size_t iv_size, size_t *iv_length)
Execute psa_cipher_generate_iv over SSF.
psa_status_t ssf_psa_cipher_finish(mbedtls_psa_client_handle_t *p_handle, uint8_t *output, size_t output_size, size_t *output_length)
Execute psa_cipher_finish over SSF.
psa_status_t ssf_psa_crypto_init(void)
Execute psa_crypto_init over SSF.
psa_status_t ssf_psa_hash_compute(psa_algorithm_t alg, const uint8_t *input, size_t input_length, uint8_t *hash, size_t hash_size, size_t *hash_length)
Execute psa_hash_compute over SSF.
psa_status_t ssf_psa_import_key(const psa_key_attributes_t *attributes, const uint8_t *data, size_t data_length, mbedtls_svc_key_id_t *key)
Execute psa_import_key over SSF.
psa_status_t ssf_psa_aead_generate_nonce(mbedtls_psa_client_handle_t *p_handle, uint8_t *nonce, size_t nonce_size, size_t *nonce_length)
Execute psa_aead_generate_nonce over SSF.
psa_status_t ssf_psa_key_derivation_input_bytes(mbedtls_psa_client_handle_t *p_handle, psa_key_derivation_step_t step, const uint8_t *data, size_t data_length)
Execute psa_key_derivation_input_bytes over SSF.
psa_status_t ssf_psa_pake_set_peer(mbedtls_psa_client_handle_t *p_handle, const uint8_t *peer_id, size_t peer_id_len)
Execute psa_pake_set_peer over SSF.
peer_id
Definition peer_conn_event.h:32