Page MenuHomePhabricator

Finalise list of multipart capabilities entry points
Closed, ResolvedPublic

Description

Discuss with mbedTLS team about the list of function prototypes to be added in the TODOs placeholders for multipart capabilities (mac, cipher, aead multipart). Come up with a list of prototypes to be implemented there for the PSA Crypto driver work to proceed.

Event Timeline

adeaarm triaged this task as High priority.Jun 25 2021, 11:13 AM
adeaarm created this task.
adeaarm moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jun 25 2021, 11:25 AM
adeaarm added a comment.EditedJul 2 2021, 6:54 PM

These prototypes are available upstream either in https://github.com/ARMmbed/mbedtls/blob/development/library/psa_crypto_driver_wrappers.h or as a Pull Request: https://github.com/ARMmbed/mbedtls/pull/4338/

MAC:

typedef ... acme_mac_operation_t;
psa_status_t acme_mac_sign_setup(
    acme_mac_operation_t *operation,
    const psa_key_attributes_t *attributes,
    const uint8_t *key_buffer,
    size_t key_buffer_size,
    psa_algorithm_t alg);
psa_status_t acme_mac_verify_setup(
    acme_mac_operation_t *operation,
    const psa_key_attributes_t *attributes,
    const uint8_t *key_buffer,
    size_t key_buffer_size,
    psa_algorithm_t alg);
psa_status_t acme_mac_update(
    acme_mac_operation_t *operation,
    const uint8_t *input,
    size_t input_length);
psa_status_t acme_mac_sign_finish(
    acme_mac_operation_t *operation,
    uint8_t *mac,
    size_t mac_size,
    size_t *mac_length);
psa_status_t acme_mac_verify_finish(
    acme_mac_operation_t *operation,
    const uint8_t *mac,
    size_t mac_length);
psa_status_t acme_mac_abort(
    acme_mac_operation_t *operation);

Cipher:

typedef ... acme_cipher_operation_t;
psa_status_t acme_cipher_encrypt_setup(
    acme_cipher_operation_t *operation,
    const psa_key_attributes_t *attributes,
    const uint8_t *key, size_t key_length,
    psa_algorithm_t alg);
psa_status_t acme_cipher_decrypt_setup(
    acme_cipher_operation_t *operation,
    const psa_key_attributes_t *attributes,
    const uint8_t *key, size_t key_length,
    psa_algorithm_t alg);
psa_status_t acme_cipher_set_iv(
    acme_cipher_operation_t *operation,
    const uint8_t *iv, size_t iv_length);
psa_status_t acme_cipher_update(
    acme_cipher_operation_t *operation,
    const uint8_t *input, size_t input_length,
    uint8_t *output, size_t output_size, size_t *output_length);
psa_status_t acme_cipher_finish(
    acme_cipher_operation_t *operation,
    uint8_t *output, size_t output_size, size_t *output_length);
psa_status_t acme_cipher_abort(
    acme_cipher_operation_t *operation);

AEAD:

typedef ... acme_aead_operation_t;
psa_status_t acme_aead_encrypt_setup(
   acme_aead_operation_t *operation,
   const psa_key_attributes_t *attributes,
   const uint8_t *key_buffer, size_t key_buffer_size,
   psa_algorithm_t alg);
psa_status_t acme_aead_decrypt_setup(
   acme_aead_operation_t *operation,
   const psa_key_attributes_t *attributes,
   const uint8_t *key_buffer, size_t key_buffer_size,
   psa_algorithm_t alg);
psa_status_t acme_aead_set_nonce(
   acme_aead_operation_t *operation,
   const uint8_t *nonce,
   size_t nonce_length);
psa_status_t acme_aead_set_lengths(
   acme_aead_operation_t *operation,
   size_t ad_length,
   size_t plaintext_length);
psa_status_t acme_aead_update_ad(
   acme_aead_operation_t *operation,
   const uint8_t *input,
   size_t input_length);
psa_status_t acme_aead_update(
   acme_aead_operation_t *operation,
   const uint8_t *input,
   size_t input_length,
   uint8_t *output,
   size_t output_size,
   size_t *output_length);
psa_status_t acme_aead_finish(
   acme_aead_operation_t *operation,
   uint8_t *ciphertext,
   size_t ciphertext_size,
   size_t *ciphertext_length,
   uint8_t *tag,
   size_t tag_size,
   size_t *tag_length);
psa_status_t acme_aead_verify(
   acme_aead_operation_t *operation,
   uint8_t *plaintext,
   size_t plaintext_size,
   size_t *plaintext_length,
   const uint8_t *tag,
   size_t tag_length);
psa_status_t acme_aead_abort(
   acme_aead_operation_t *operation);
adeaarm moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jul 2 2021, 6:55 PM
adeaarm moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.
adeaarm closed this task as Resolved.Jul 2 2021, 6:58 PM