Julian Hall | d407138 | 2021-07-07 16:45:53 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <string.h> |
| 8 | #include <stdlib.h> |
| 9 | #include <psa/crypto.h> |
| 10 | #include "psa_crypto_client.h" |
| 11 | #include <protocols/rpc/common/packed-c/status.h> |
| 12 | #include <protocols/service/crypto/packed-c/opcodes.h> |
| 13 | #include <common/tlv/tlv.h> |
| 14 | |
| 15 | psa_status_t psa_aead_encrypt(psa_key_id_t key, |
| 16 | psa_algorithm_t alg, |
| 17 | const uint8_t *nonce, |
| 18 | size_t nonce_length, |
| 19 | const uint8_t *additional_data, |
| 20 | size_t additional_data_length, |
| 21 | const uint8_t *plaintext, |
| 22 | size_t plaintext_length, |
| 23 | uint8_t *ciphertext, |
| 24 | size_t ciphertext_size, |
| 25 | size_t *ciphertext_length) |
| 26 | { |
| 27 | return PSA_ERROR_NOT_SUPPORTED; |
| 28 | } |
| 29 | |
| 30 | psa_status_t psa_aead_decrypt(psa_key_id_t key, |
| 31 | psa_algorithm_t alg, |
| 32 | const uint8_t *nonce, |
| 33 | size_t nonce_length, |
| 34 | const uint8_t *additional_data, |
| 35 | size_t additional_data_length, |
| 36 | const uint8_t *ciphertext, |
| 37 | size_t ciphertext_length, |
| 38 | uint8_t *plaintext, |
| 39 | size_t plaintext_size, |
| 40 | size_t *plaintext_length) |
| 41 | { |
| 42 | return PSA_ERROR_NOT_SUPPORTED; |
| 43 | } |
Julian Hall | d670b41 | 2021-07-19 15:16:27 +0100 | [diff] [blame^] | 44 | |
| 45 | psa_status_t psa_aead_encrypt_setup(psa_aead_operation_t *operation, |
| 46 | psa_key_id_t key, |
| 47 | psa_algorithm_t alg) |
| 48 | { |
| 49 | return PSA_ERROR_NOT_SUPPORTED; |
| 50 | } |
| 51 | |
| 52 | psa_status_t psa_aead_decrypt_setup(psa_aead_operation_t *operation, |
| 53 | psa_key_id_t key, |
| 54 | psa_algorithm_t alg) |
| 55 | { |
| 56 | return PSA_ERROR_NOT_SUPPORTED; |
| 57 | } |
| 58 | |
| 59 | psa_status_t psa_aead_generate_nonce(psa_aead_operation_t *operation, |
| 60 | uint8_t *nonce, |
| 61 | size_t nonce_size, |
| 62 | size_t *nonce_length) |
| 63 | { |
| 64 | return PSA_ERROR_NOT_SUPPORTED; |
| 65 | } |
| 66 | |
| 67 | psa_status_t psa_aead_set_nonce(psa_aead_operation_t *operation, |
| 68 | const uint8_t *nonce, |
| 69 | size_t nonce_length) |
| 70 | { |
| 71 | return PSA_ERROR_NOT_SUPPORTED; |
| 72 | } |
| 73 | |
| 74 | psa_status_t psa_aead_set_lengths(psa_aead_operation_t *operation, |
| 75 | size_t ad_length, |
| 76 | size_t plaintext_length) |
| 77 | { |
| 78 | return PSA_ERROR_NOT_SUPPORTED; |
| 79 | } |
| 80 | |
| 81 | psa_status_t psa_aead_update_ad(psa_aead_operation_t *operation, |
| 82 | const uint8_t *input, |
| 83 | size_t input_length) |
| 84 | { |
| 85 | return PSA_ERROR_NOT_SUPPORTED; |
| 86 | } |
| 87 | |
| 88 | psa_status_t psa_aead_update(psa_aead_operation_t *operation, |
| 89 | const uint8_t *input, |
| 90 | size_t input_length, |
| 91 | uint8_t *output, |
| 92 | size_t output_size, |
| 93 | size_t *output_length) |
| 94 | { |
| 95 | return PSA_ERROR_NOT_SUPPORTED; |
| 96 | } |
| 97 | |
| 98 | psa_status_t psa_aead_finish(psa_aead_operation_t *operation, |
| 99 | uint8_t *ciphertext, |
| 100 | size_t ciphertext_size, |
| 101 | size_t *ciphertext_length, |
| 102 | uint8_t *tag, |
| 103 | size_t tag_size, |
| 104 | size_t *tag_length) |
| 105 | { |
| 106 | return PSA_ERROR_NOT_SUPPORTED; |
| 107 | } |
| 108 | |
| 109 | psa_status_t psa_aead_verify(psa_aead_operation_t *operation, |
| 110 | uint8_t *plaintext, |
| 111 | size_t plaintext_size, |
| 112 | size_t *plaintext_length, |
| 113 | const uint8_t *tag, |
| 114 | size_t tag_length) |
| 115 | { |
| 116 | return PSA_ERROR_NOT_SUPPORTED; |
| 117 | } |
| 118 | |
| 119 | psa_status_t psa_aead_abort(psa_aead_operation_t *operation) |
| 120 | { |
| 121 | return PSA_ERROR_NOT_SUPPORTED; |
| 122 | } |