| 1df59751 | 30-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: crypto: remove internal_aes_gcm_expand_enc_key()
Removes internal_aes_gcm_expand_enc_key() which is replaced by crypto_aes_expand_enc_key().
Reviewed-by: Etienne Carriere <etienne.carriere@li
core: crypto: remove internal_aes_gcm_expand_enc_key()
Removes internal_aes_gcm_expand_enc_key() which is replaced by crypto_aes_expand_enc_key().
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 8a15c688 | 30-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: update AArch64 GHASH acceleration routines
Update AArch64 GHASH acceleration routines for improved performance.
The core parts of assembly and wrapper updates are written by Ard Biesheuvel <a
core: update AArch64 GHASH acceleration routines
Update AArch64 GHASH acceleration routines for improved performance.
The core parts of assembly and wrapper updates are written by Ard Biesheuvel <ard.biesheuvel@linaro.org>, see [1].
Link: [1] https://github.com/torvalds/linux/commit/22240df7ac6d76a271197571a7be45addef2ba15 Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 8f848cdb | 30-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: crypto: add internal_aes_gcm_{en,de}crypt_block()
Adds internal_aes_gcm_encrypt_block() and internal_aes_gcm_decrypt_block() to encrypt or decrypt a well aligned AES-GCM payload block.
Review
core: crypto: add internal_aes_gcm_{en,de}crypt_block()
Adds internal_aes_gcm_encrypt_block() and internal_aes_gcm_decrypt_block() to encrypt or decrypt a well aligned AES-GCM payload block.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 4f6d7160 | 30-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: crypto: remove internal_aes_gcm_encrypt_block()
Replaces calls to internal_aes_gcm_encrypt_block() with calls to crypto_aes_enc_block(). Removes internal_aes_gcm_encrypt_block().
Reviewed-by:
core: crypto: remove internal_aes_gcm_encrypt_block()
Replaces calls to internal_aes_gcm_encrypt_block() with calls to crypto_aes_enc_block(). Removes internal_aes_gcm_encrypt_block().
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| d7fd8f87 | 30-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: crypto: unaligned aes-gcm acceleration
The Arm CE code supports working with unaligned data. In order to make full use of that is the generic __weak function internal_aes_gcm_update_payload_bl
core: crypto: unaligned aes-gcm acceleration
The Arm CE code supports working with unaligned data. In order to make full use of that is the generic __weak function internal_aes_gcm_update_payload_block_aligned() replaced with internal_aes_gcm_update_payload_blocks(). The latter now supports working with unaligned buffers.
Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b314df1f | 30-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: crypto: refactor aes-gcm implementation
Adds struct internal_ghash_key to represent the ghash key instead of some lose fields inside struct internal_aes_gcm_state.
Software of CE configuratio
core: crypto: refactor aes-gcm implementation
Adds struct internal_ghash_key to represent the ghash key instead of some lose fields inside struct internal_aes_gcm_state.
Software of CE configuration is done explicitly in core/crypto/aes-gcm-sw.c, dropping the __weak attribute for all functions but internal_aes_gcm_update_payload_block_aligned() which is only overridden with CFG_CRYPTO_WITH_CE=y in AArch64.
Content of aes-gcm-private.h is moved into internal_aes-gcm.h.
internal_aes_gcm_gfmul() is made available for generic GF multiplication.
The CE versions of internal_aes_gcm_expand_enc_key() and internal_aes_gcm_encrypt_block() are now only wrappers around crypto_accel_aes_expand_keys() and crypto_accel_aes_ecb_enc().
Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 75fea8a9 | 30-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add accelerated SHA-256 routines
Adds an Arm CE accelerated SHA-256 function to core/arch/arm/crypto. The code originates from the previous implementation inside LTC library. With this multipl
core: add accelerated SHA-256 routines
Adds an Arm CE accelerated SHA-256 function to core/arch/arm/crypto. The code originates from the previous implementation inside LTC library. With this multiple crypto libraries can share the function.
The old CFG_CRYPTO_SHA256_ARM64_CE and CFG_CRYPTO_SHA256_ARM32_CE are replaced by CFG_CRYPTO_SHA256_ARM_CE.
CFG_CORE_CRYPTO_SHA256_ACCEL is introduced as to indicate that some kind of SHA-256 acceleration is available, not necessarily based on Arm CE.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 858d5279 | 30-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add accelerated SHA1 routines
Adds an Arm CE accelerated SHA1 function to core/arch/arm/crypto. The code originates from the previous implementation inside LTC library. With this multiple cryp
core: add accelerated SHA1 routines
Adds an Arm CE accelerated SHA1 function to core/arch/arm/crypto. The code originates from the previous implementation inside LTC library. With this multiple crypto libraries can share the function.
The old CFG_CRYPTO_SHA1_ARM64_CE and CFG_CRYPTO_SHA1_ARM32_CE are replaced by CFG_CRYPTO_SHA1_ARM_CE.
CFG_CORE_CRYPTO_SHA1_ACCEL is introduced as to indicate that some kind of SHA-1 acceleration is available, not necessarily based on Arm CE.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 06d2e416 | 30-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add accelerated AES routines
Adds Arm CE accelerated AES routines to core/arch/arm/crypto. The code originates from the previous implementation inside LTC library. With this multiple crypto li
core: add accelerated AES routines
Adds Arm CE accelerated AES routines to core/arch/arm/crypto. The code originates from the previous implementation inside LTC library. With this multiple crypto library can share these routines.
A new header file, <crypto/crypto_accel.h>, is added with primitive functions implementing crypto accelerated ciphers.
The old CFG_CRYPTO_AES_ARM64_CE and CFG_CRYPTO_AES_ARM32_CE are replaced by CFG_CRYPTO_AES_ARM_CE.
CFG_CORE_CRYPTO_AES_ACCEL is introduced as to indicate that some kind of AES acceleration is available, not necessarily based on Arm CE.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| a58c4d70 | 16-Dec-2019 |
Etienne Carriere <etienne.carriere@linaro.org> |
drivers/scmi-msg: smt entry points for incoming messages
This change implements SCMI channels for reading a SCMI message from a shared memory and call the SCMI message drivers to route the message t
drivers/scmi-msg: smt entry points for incoming messages
This change implements SCMI channels for reading a SCMI message from a shared memory and call the SCMI message drivers to route the message to the target platform services.
SMT refers to the shared memory management protocol which is used to get/put message/response in shared memory. SMT is a 28byte header stating shared memory state and exchanged protocol data.
The processing entry for a SCMI message can be a secure interrupt (CFG_SCMI_MSG_SMT_INTERRUPT_ENTRY=y), and fastcall SMC (CFG_SCMI_MSG_SMT_FASTCALL_ENTRY=y) or a threaded execution context entry (CFG_SCMI_MSG_SMT_THREAD_ENTRY=y).
SMT description in this implementation is based on the SCP-firmware implementation [1].
Link: [1] https://github.com/ARM-software/SCP-firmware.git
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 56a1f10e | 02-Dec-2019 |
Etienne Carriere <etienne.carriere@linaro.org> |
drivers/scmi-msg: support for reset domain protocol
Adds SCMI reset domain protocol support in the SCMI message drivers as defined in SCMI specification v2.0 [1]. Not all the messages defined in the
drivers/scmi-msg: support for reset domain protocol
Adds SCMI reset domain protocol support in the SCMI message drivers as defined in SCMI specification v2.0 [1]. Not all the messages defined in the specification are supported.
Embedded upon CFG_SCMI_MSG_RESET_DOMAIN=y.
scmi_msg_get_rd_handler() sanitizes the message_id value against any speculative use of reset domain ID as a index since by SCMI specification, IDs are indices.
SCMI resource in this implementation are dumped or inspired by the SCP-firmware implementation [2] of the SCMI protocol, server side.
Link: [1] http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/DEN0056A_System_Control_and_Management_Interface.pdf Link: [2] https://github.com/ARM-software/SCP-firmware.git
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| a7a9e3ba | 02-Dec-2019 |
Etienne Carriere <etienne.carriere@linaro.org> |
drivers/scmi-msg: support for clock protocol
Adds SCMI clock protocol support in the SCMI message drivers as defined in SCMI specification v2.0 [1]. Not all the messages defined in the specification
drivers/scmi-msg: support for clock protocol
Adds SCMI clock protocol support in the SCMI message drivers as defined in SCMI specification v2.0 [1]. Not all the messages defined in the specification are supported.
Embedded upon CFG_SCMI_MSG_CLOCK=y.
Platform can provide one of the plat_scmi_clock_*() handler for the supported operations set/get state/rate and others.
scmi_msg_get_clock_handler() sanitizes the message_id value against any speculative use of clock ID as a index since by SCMI specification, IDs are indices.
SCMI resource in this implementation are dumped or inspired by the SCP-firmware implementation [2] of the SCMI protocol, server side.
Link: [1] http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/DEN0056A_System_Control_and_Management_Interface.pdf Link: [2] https://github.com/ARM-software/SCP-firmware.git
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| ae8c8068 | 01-Dec-2019 |
Etienne Carriere <etienne.carriere@linaro.org> |
drivers/scmi-msg: driver for processing scmi messages
This change introduces drivers to allow a platform to create a SCMI service and register handlers for client request (SCMI agent) on system reso
drivers/scmi-msg: driver for processing scmi messages
This change introduces drivers to allow a platform to create a SCMI service and register handlers for client request (SCMI agent) on system resources. This is the first piece of the drivers: an entry function, the SCMI base protocol support and helpers for create the response message.
With this change, scmi_process_message() is the entry function to process an incoming SCMI message. The function expect the message is already copied from shared memory into secure memory. The message structure stores message reference and output buffer reference where response message shall be stored.
scmi_process_message() calls the SCMI protocol driver according to the protocol ID in the message. The SCMI protocol driver will call defined platform handlers according to the message content.
This change introduces only the SCMI base protocol as defined in SCMI specification v2.0 [1]. Not all the messages defined in the specification are supported.
SCMI resource in this implementation are dumped or inspired by the SCP-firmware implementation [2] of the SCMI protocol, server side.
Link: [1] http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/DEN0056A_System_Control_and_Management_Interface.pdf Link: [2] https://github.com/ARM-software/SCP-firmware.git
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 7c767434 | 02-Apr-2020 |
Albert Schwarzkopf <a.schwarzkopf@phytec.de> |
core: merge tee_*_get_digest_size() into a single function
Rename tee_hash_get_digest_size() to tee_alg_get_digest_size().
Change tee_alg_get_digest_size() to use new libutee macro TEE_ALG_GET_DIGE
core: merge tee_*_get_digest_size() into a single function
Rename tee_hash_get_digest_size() to tee_alg_get_digest_size().
Change tee_alg_get_digest_size() to use new libutee macro TEE_ALG_GET_DIGEST_SIZE.
Remove tee_mac_get_digest_size() as its functionality is handled by tee_alg_get_digest_size() now.
Signed-off-by: Albert Schwarzkopf <a.schwarzkopf@phytec.de> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| e43ab7a8 | 07-Aug-2019 |
Cedric Neveux <cedric.neveux@nxp.com> |
core: driver: generic resources for crypto cipher driver
Add a generic cryptographic Cipher driver interface connecting TEE Crypto generic APIs to HW driver interface
To make Cipher HW driver gener
core: driver: generic resources for crypto cipher driver
Add a generic cryptographic Cipher driver interface connecting TEE Crypto generic APIs to HW driver interface
To make Cipher HW driver generic and to reduce the amount of function parameters, add structure data for the initialization and update function driver call. Checks the Cipher operation's parameter in the generic part before calling the HW driver.
Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com> Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 40bb4a98 | 19-Mar-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add overflow check in SHDR_GET_SIZE()
Adds overflow check in SHDR_GET_SIZE(), 0 which never can be a correct size is returned in case of overflow.
Reviewed-by: Joakim Bech <joakim.bech@linaro
core: add overflow check in SHDR_GET_SIZE()
Adds overflow check in SHDR_GET_SIZE(), 0 which never can be a correct size is returned in case of overflow.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reported-by: Bastien Simondi <bsimondi@netflix.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b1042535 | 29-Nov-2019 |
Rouven Czerwinski <r.czerwinski@pengutronix.de> |
rpmb: function to block rpmb write per platform
Often the RPMB should only be written if the platform is in the correct state where the Hardware Unique Key (HUK) for the platform works correctly. As
rpmb: function to block rpmb write per platform
Often the RPMB should only be written if the platform is in the correct state where the Hardware Unique Key (HUK) for the platform works correctly. As an example on imx platforms with HUK derivation from the OTPMK, the OTPMK is only accessible from the secure or trusted state. Add a function and weak implementation for platforms to indicate that the device is in the correct state to allow RPMB key writes.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Cedric Neveux <cedric.neveux@nxp.com>
show more ...
|
| 599784c7 | 29-Nov-2019 |
Rouven Czerwinski <r.czerwinski@pengutronix.de> |
imx: snvs: rework snvs driver
Remove the unused SRTC functionality which is not wired up anywhere. Instead add a function to read the device configuration and system security monitor instead.
Signe
imx: snvs: rework snvs driver
Remove the unused SRTC functionality which is not wired up anywhere. Instead add a function to read the device configuration and system security monitor instead.
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Cedric Neveux <cedric.neveux@nxp.com>
show more ...
|
| dd333f03 | 20-Jan-2020 |
Javier Almansa Sobrino <javier.almansasobrino@arm.com> |
core: Add support to access a TPM event log in secure memory.
Support for OPTEE to be able to receive a TPM event log through a DTB so it can forward it to a TA (such as a TPM service) in order to e
core: Add support to access a TPM event log in secure memory.
Support for OPTEE to be able to receive a TPM event log through a DTB so it can forward it to a TA (such as a TPM service) in order to extend the measurements.
CFG_CORE_TPM_EVENT_LOG enables this feature. CFG_TPM_LOG_BASE_ADDR hardcodes the phys address of the event log in case CFG_DT is not set. CFG_TPM_MAX_LOG_SIZE harcodes the size of the event log in case CFG_DT is not set.
When this feature is enabled, the PTA_SYSTEM_GET_TPM_EVENT_LOG command is available to any TA.
Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 5544b89d | 06-Feb-2020 |
Rouven Czerwinski <r.czerwinski@pengutronix.de> |
tzc380: add function to lockdown regions
The TZC380 allows a lockdown of the region configuration to prevent unintended or malicious configuration changes. Add a function which locks down all region
tzc380: add function to lockdown regions
The TZC380 allows a lockdown of the region configuration to prevent unintended or malicious configuration changes. Add a function which locks down all regions of the current configuration
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Reviewed-by: Clement Faure <clement.faure@nxp.com>
show more ...
|
| e55ef7c3 | 17-Feb-2020 |
Jerome Forissier <jerome@forissier.org> |
core: panic(): don't lose the message in non-debug mode
When CFG_TEE_CORE_DEBUG != y, panic("Some text") prints no file/line/ function information (which is expected in non-debug mode) but it also i
core: panic(): don't lose the message in non-debug mode
When CFG_TEE_CORE_DEBUG != y, panic("Some text") prints no file/line/ function information (which is expected in non-debug mode) but it also ignores its parameter. As a result, the console simply shows "Panic" which is not very helpful.
There is no reason not to print the panic message, so add it. Note that it is still possible to build a fully silent OP-TEE by setting the log level to zero.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
show more ...
|
| dd13645c | 30-Jan-2020 |
Clement Faure <clement.faure@nxp.com> |
drivers: tzc: set maximum region size for tzc_auto_configure()
According to the TZC380 documentation, the AXI address width controls the upper limit value of the region size. This fix makes sure tha
drivers: tzc: set maximum region size for tzc_auto_configure()
According to the TZC380 documentation, the AXI address width controls the upper limit value of the region size. This fix makes sure that tzc_auto_configure() function will not allocated a region bigger that the AXI address width.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
show more ...
|
| b6afa13a | 27-Jan-2020 |
Carlo Caione <ccaione@baylibre.com> |
plat-amlogic: Add initial support for Amlogic platforms
This is the initial support for the Amlogic platforms.
Tested 64-bin mode on A113D (AXG) board using upstream TF-A BL31.
* xtest results (-l
plat-amlogic: Add initial support for Amlogic platforms
This is the initial support for the Amlogic platforms.
Tested 64-bin mode on A113D (AXG) board using upstream TF-A BL31.
* xtest results (-l 15): | 44074 subtests of which 0 failed | 96 test cases of which 0 failed | 0 test cases were skipped | TEE test application done!
* Compiled with: | make PLATFORM=amlogic
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Carlo Caione <ccaione@baylibre.com>
show more ...
|
| a66805b1 | 29-Jan-2020 |
Jerome Forissier <jerome@forissier.org> |
Move core/include/config.h to lib/libutils/ext/include
In order to be able to use the IS_ENABLED() macro in user space libraries, move config.h from core to libutils.
Signed-off-by: Jerome Forissie
Move core/include/config.h to lib/libutils/ext/include
In order to be able to use the IS_ENABLED() macro in user space libraries, move config.h from core to libutils.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 5b385b3f | 06-Jan-2020 |
Jerome Forissier <jerome@forissier.org> |
core: crypto: add support for SM2 KEP
Adds SM2 Key Exchange Protocol [1] using LibTomCrypt. The TA interface complies with the GlobalPlatform TEE Internal Core API version 1.2.
SM2 KEP is enabled w
core: crypto: add support for SM2 KEP
Adds SM2 Key Exchange Protocol [1] using LibTomCrypt. The TA interface complies with the GlobalPlatform TEE Internal Core API version 1.2.
SM2 KEP is enabled with CFG_CRYPTO_SM2_KEP=y (default y) wich currently requires that CFG_CRYPTOLIB_NAME=tomcrypt. An Mbed TLS implementation could be added later if needed.
[1] http://www.gmbz.org.cn/main/postDetail.html?id=20180724110812
Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|