1 /* SPDX-License-Identifier: BSD-2-Clause */ 2 /* 3 * Copyright (c) 2020, Linaro Limited 4 */ 5 6 #ifndef __CRYPTO_CRYPTO_ACCEL_H 7 #define __CRYPTO_CRYPTO_ACCEL_H 8 9 #include <tee_api_types.h> 10 11 TEE_Result crypto_accel_aes_expand_keys(const void *key, size_t key_len, 12 void *enc_key, void *dec_key, 13 size_t expanded_key_len, 14 unsigned int *round_count); 15 16 void crypto_accel_aes_ecb_enc(void *out, const void *in, const void *key, 17 unsigned int round_count, 18 unsigned int block_count); 19 void crypto_accel_aes_ecb_dec(void *out, const void *in, const void *key, 20 unsigned int round_count, 21 unsigned int block_count); 22 23 void crypto_accel_aes_cbc_enc(void *out, const void *in, const void *key, 24 unsigned int round_count, 25 unsigned int block_count, void *iv); 26 void crypto_accel_aes_cbc_dec(void *out, const void *in, const void *key, 27 unsigned int round_count, 28 unsigned int block_count, void *iv); 29 30 void crypto_accel_aes_ctr_be_enc(void *out, const void *in, const void *key, 31 unsigned int round_count, 32 unsigned int block_count, void *iv); 33 34 void crypto_accel_aes_xts_enc(void *out, const void *in, const void *key1, 35 unsigned int round_count, 36 unsigned int block_count, const void *key2, 37 void *tweak); 38 void crypto_accel_aes_xts_dec(void *out, const void *in, const void *key1, 39 unsigned int round_count, 40 unsigned int block_count, const void *key2, 41 void *tweak); 42 43 void crypto_accel_sha1_compress(uint32_t state[5], const void *src, 44 unsigned int block_count); 45 void crypto_accel_sha256_compress(uint32_t state[8], const void *src, 46 unsigned int block_count); 47 void crypto_accel_sha512_compress(uint64_t state[8], const void *src, 48 unsigned int block_count); 49 void crypto_accel_sm3_compress(uint32_t state[8], const void *src, 50 unsigned int block_count); 51 #endif /*__CRYPTO_CRYPTO_ACCEL_H*/ 52