-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xtest: combine AES and hash into crypto_perf
There is quite a bit of copy in these files.So, I cosonlidate the code to make it easier to maintain. Signed-off-by: Zexi Yu <[email protected]> Acked-by: Jerome Forissier <[email protected]> Acked-by: Etienne Carriere <[email protected]>
- Loading branch information
Showing
26 changed files
with
305 additions
and
454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
LOCAL_PATH := $(call my-dir) | ||
|
||
local_module := e626662e-c0e2-485c-b8c8-09fbce6edf3d.ta | ||
local_module := 02a42f43-d8b7-4a57-aa4d-87bd9b5587cb.ta | ||
include $(BUILD_OPTEE_MK) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
BINARY = 02a42f43-d8b7-4a57-aa4d-87bd9b5587cb | ||
|
||
include ../ta_common.mk | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* SPDX-License-Identifier: BSD-2-Clause */ | ||
/* | ||
* Copyright (c) 2015, Linaro Limited | ||
*/ | ||
|
||
#ifndef TA_CRYPTO_PERF_H | ||
#define TA_CRYPTO_PERF_H | ||
|
||
#define TA_CRYPTO_PERF_UUID { 0x02a42f43, 0xd8b7, 0x4a57, \ | ||
{ 0xaa, 0x4d, 0x87, 0xbd, 0x9b, 0x55, 0x87, 0xcb } } | ||
|
||
/* | ||
* Commands implemented by the TA | ||
*/ | ||
|
||
#define TA_CRYPTO_PERF_CMD_CIPHER_PREPARE_KEY 0 | ||
#define TA_CRYPTO_PERF_CMD_CIPHER_PROCESS 1 | ||
#define TA_CRYPTO_PERF_CMD_CIPHER_PROCESS_SDP 2 | ||
#define TA_CRYPTO_PERF_CMD_HASH_PREPARE_OP 3 | ||
#define TA_CRYPTO_PERF_CMD_HASH_PROCESS 4 | ||
|
||
/* | ||
* Supported AES modes of operation | ||
*/ | ||
|
||
#define TA_AES_ECB 0 | ||
#define TA_AES_CBC 1 | ||
#define TA_AES_CTR 2 | ||
#define TA_AES_XTS 3 | ||
#define TA_AES_GCM 4 | ||
|
||
/* | ||
* AES key sizes | ||
*/ | ||
#define AES_128 128 | ||
#define AES_192 192 | ||
#define AES_256 256 | ||
|
||
/* | ||
* Supported hash algorithms | ||
*/ | ||
|
||
#define TA_SHA_SHA1 0 | ||
#define TA_SHA_SHA224 1 | ||
#define TA_SHA_SHA256 2 | ||
#define TA_SHA_SHA384 3 | ||
#define TA_SHA_SHA512 4 | ||
#define TA_SM3 5 | ||
#define TA_HMAC_SHA1 6 | ||
#define TA_HMAC_SHA224 7 | ||
#define TA_HMAC_SHA256 8 | ||
#define TA_HMAC_SHA384 9 | ||
#define TA_HMAC_SHA512 10 | ||
#define TA_HMAC_SM3 11 | ||
|
||
#endif /* TA_CRYPTO_PERF_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* SPDX-License-Identifier: BSD-2-Clause */ | ||
/* | ||
* Copyright (c) 2015, Linaro Limited | ||
*/ | ||
|
||
#ifndef TA_CRYPTO_PERF_PRIV_H | ||
#define TA_CRYPTO_PERF_PRIV_H | ||
|
||
#include <tee_api.h> | ||
|
||
TEE_Result cmd_cipher_prepare_key(uint32_t param_types, TEE_Param params[4]); | ||
TEE_Result cmd_cipher_process(uint32_t param_types, TEE_Param params[4], | ||
bool sdp); | ||
TEE_Result cmd_hash_prepare_op(uint32_t param_types, TEE_Param params[4]); | ||
TEE_Result cmd_hash_process(uint32_t param_types, TEE_Param params[4]); | ||
void cmd_clean_res(void); | ||
|
||
#endif /* TA_CRYPTO_PERF_PRIV_H */ |
8 changes: 4 additions & 4 deletions
8
...ash_perf/include/user_ta_header_defines.h → ...pto_perf/include/user_ta_header_defines.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
global-incdirs-y += include | ||
srcs-y += ta_entry.c | ||
srcs-y += ta_aes_perf.c | ||
srcs-y += ta_crypto_perf.c |
Oops, something went wrong.