| 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 ...
|
| 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 ...
|
| 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 ...
|
| 0f151943 | 17-Dec-2019 |
Jerome Forissier <jerome@forissier.org> |
core: crypto add support for SM2 DSA
Adds SM2 Digital Signature Algorithm [1] using LibTomCrypt. The TA interface complies with the GlobalPlatform TEE Internal Core API version 1.2.
SM2 DSA is enab
core: crypto add support for SM2 DSA
Adds SM2 Digital Signature Algorithm [1] using LibTomCrypt. The TA interface complies with the GlobalPlatform TEE Internal Core API version 1.2.
SM2 DSA is enabled with CFG_CRYPTO_SM2_DSA=y (default y) which 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 ...
|
| 91fc6bd8 | 17-Dec-2019 |
Jerome Forissier <jerome@forissier.org> |
core: crypto: add support for SM2 PKE
Adds SM2 Public Key Encryption [1] using LibTomCrypt. The TA interface complies with the GlobalPlatform TEE Internal Core API version 1.2.
SM2 is enabled with
core: crypto: add support for SM2 PKE
Adds SM2 Public Key Encryption [1] using LibTomCrypt. The TA interface complies with the GlobalPlatform TEE Internal Core API version 1.2.
SM2 is enabled with CFG_CRYPTO_SM2_PKE=y (default y) which 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 ...
|
| c891a67c | 18-Dec-2019 |
Victor Chong <victor.chong@linaro.org> |
core: crypto: sm3: remove unused header
Removed unused mbedtls/md.h header file to fix error:
core/crypto/sm3-hmac.c:12:10: fatal error: mbedtls/md.h: No such file or directory
when building with
core: crypto: sm3: remove unused header
Removed unused mbedtls/md.h header file to fix error:
core/crypto/sm3-hmac.c:12:10: fatal error: mbedtls/md.h: No such file or directory
when building with CFG_CORE_MBEDTLS_MPI=n. To prevent future similar regression, also add a test case to Shippable.
Fixes: https://github.com/OP-TEE/optee_os/issues/3487 Fixes: 47645577c806 ("core: crypto: add support for SM3") Signed-off-by: Victor Chong <victor.chong@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| 47645577 | 13-Dec-2019 |
Jerome Forissier <jerome@forissier.org> |
core: crypto: add support for SM3
Adds support for the SM3 cryptographic hash function [1] using the API defined in the GlobalPlatform TEE Internal Core API v1.2, as well as the HMAC based on this h
core: crypto: add support for SM3
Adds support for the SM3 cryptographic hash function [1] using the API defined in the GlobalPlatform TEE Internal Core API v1.2, as well as the HMAC based on this hash.
This implementation is based on code published on Gitlab [2]. See commit ade6f848e084 ("core: crypto: add support for SM4") for details.
[1] https://tools.ietf.org/html/draft-sca-cfrg-sm3-02 [2] https://gitlab.com/otpfree/sm234
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| ade6f848 | 12-Dec-2019 |
Jerome Forissier <jerome@forissier.org> |
core: crypto: add support for SM4
Adds support for the SM4 cipher [1] using the API defined in the GlobalPlatform TEE Internal Core API v1.2.
ECB, CBC and CTR modes are implemented. Other modes are
core: crypto: add support for SM4
Adds support for the SM4 cipher [1] using the API defined in the GlobalPlatform TEE Internal Core API v1.2.
ECB, CBC and CTR modes are implemented. Other modes are valid but are not included in the GP specification, so they are not considered here.
This implementation is based on code published on Gitlab [2]. The project contains no licensing terms, so I contacted the author (goldboar@163.com), asking for permission to re-use the code in OP-TEE under a BSD-2-Clause license. I received the following reply:
"[...] If you like you can use it [...]"
I have reworked the source to better fit the OP-TEE coding style. I have also added the CTR mode of operation.
I do not think we will need to merge any change from upstream in the future.
[1] https://tools.ietf.org/html/draft-ribose-cfrg-sm4-10 [2] https://gitlab.com/otpfree/sm234
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 2139aa8c | 25-Nov-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: shdr_verify_signature() supply hash length for salt length
In order to support the TEE_ALG_RSASSA_PKCS1_PSS_MGF1_* group of algorithms supply the size of the hash as the size of the salt to cr
core: shdr_verify_signature() supply hash length for salt length
In order to support the TEE_ALG_RSASSA_PKCS1_PSS_MGF1_* group of algorithms supply the size of the hash as the size of the salt to crypto_acipher_rsassa_verify().
A salt is something introduced by PCKS1_PSS, PKCS1_V1.5 does not have a salt and the parameter will be ignored by crypto_acipher_rsassa_verify() for the latter.
With the PCKS1_PSS algorithm it is common practice to use a salt with the same size as the hash, but it is not a requirement. The implementation here depends on using a salt with the same size as the hash. This is a compromise to avoid extending the signed header with a salt length field.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| abd18a27 | 07-Nov-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: fix style issues in cbc_cts_update()
Adds default initialization of local variables, one indentation error and removes a pair of redundant parentheses.
Reviewed-by: Jerome Forissier <jerome@f
core: fix style issues in cbc_cts_update()
Adds default initialization of local variables, one indentation error and removes a pair of redundant parentheses.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 52ee414b | 04-Mar-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove algo from crypto_authenc_*()
Removes the algo parameters from all crypto_authenc_*() functions except crypto_authenc_alloc_ctx().
Reviewed-by: Etienne Carriere <etienne.carriere@linaro
core: remove algo from crypto_authenc_*()
Removes the algo parameters from all crypto_authenc_*() functions except crypto_authenc_alloc_ctx().
Reviewed-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 ...
|
| c69bc615 | 02-Mar-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove algo from crypto_mac_*()
Removes the algo parameters from all crypto_mac_*() functions except crypto_mac_alloc_ctx().
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-
core: remove algo from crypto_mac_*()
Removes the algo parameters from all crypto_mac_*() functions except crypto_mac_alloc_ctx().
Reviewed-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 ...
|
| cbda7091 | 02-Mar-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove algo from crypto_cipher_*()
Removes the algo parameters from all crypto_cipher_*() functions except crypto_cipher_alloc_ctx().
tee_aes_cbc_cts_update() is moved into aes-cts.c and rena
core: remove algo from crypto_cipher_*()
Removes the algo parameters from all crypto_cipher_*() functions except crypto_cipher_alloc_ctx().
tee_aes_cbc_cts_update() is moved into aes-cts.c and renamed to cbc_cts_update().
Reviewed-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 ...
|
| 6b3a371c | 01-Mar-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove algo from crypto_hash_*()
Removes the algo parameters from all crypto_hash_*() functions except crypto_hash_alloc_ctx().
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Ack
core: remove algo from crypto_hash_*()
Removes the algo parameters from all crypto_hash_*() functions except crypto_hash_alloc_ctx().
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 7222fc6a | 06-Aug-2019 |
Cedric Neveux <cedric.neveux@nxp.com> |
core: driver: generic resources for crypto device driver
Add a generic cryptographic driver interface connecting TEE Crypto generic APIs to HW driver interface
The Generic Crypto Driver interface i
core: driver: generic resources for crypto device driver
Add a generic cryptographic driver interface connecting TEE Crypto generic APIs to HW driver interface
The Generic Crypto Driver interface in the core/driver/crypto/crypto_api is implemented to be able to use a HW driver.
Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| da1de557 | 27-Mar-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: crypto.c: don't use _CFG_CRYPTO_WITH_ACIPHER
Uses CFG_CRYPTO_RSA, CFG_CRYPTO_DSA, CFG_CRYPTO_DH and CFG_CRYPTO_ECC to tell if bignum functions needs to be stubbed instead of relying on _CFG_CR
core: crypto.c: don't use _CFG_CRYPTO_WITH_ACIPHER
Uses CFG_CRYPTO_RSA, CFG_CRYPTO_DSA, CFG_CRYPTO_DH and CFG_CRYPTO_ECC to tell if bignum functions needs to be stubbed instead of relying on _CFG_CRYPTO_WITH_ACIPHER which is about to be removed.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| e7dbc357 | 02-Jul-2018 |
Summer Qin <summer.qin@arm.com> |
core: add encrypt key length in AES encrypt API
Adds size of expanded AES encryption key to crypto_aes_expand_enc_key() and crypto_aes_enc_block() to make the functions more safe to call.
Reviewed-
core: add encrypt key length in AES encrypt API
Adds size of expanded AES encryption key to crypto_aes_expand_enc_key() and crypto_aes_enc_block() to make the functions more safe to call.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Summer Qin <summer.qin@arm.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 17c68af4 | 22-Mar-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: crypto: move AES-CTS wrappers from libtomcrypt/ to crypto/
Moves the AES-CTS implementation from LTC wrapper to core/crypto.
The AES-CTS implementation can be overridden in a crypto library b
core: crypto: move AES-CTS wrappers from libtomcrypt/ to crypto/
Moves the AES-CTS implementation from LTC wrapper to core/crypto.
The AES-CTS implementation can be overridden in a crypto library by setting CFG_CRYPTO_CTS_FROM_CRYPTOLIB:=y
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| f1e9b21b | 08-Mar-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: crypto: introduce struct crypto_authenc_ops
Uses struct crypto_authenc_ops pointer in crypto context for authenc ciphers (AES-GCM and AES-CCM) as a glue layer instead of a switch(algo) in each
core: crypto: introduce struct crypto_authenc_ops
Uses struct crypto_authenc_ops pointer in crypto context for authenc ciphers (AES-GCM and AES-CCM) as a glue layer instead of a switch(algo) in each cryto_authenc_*() function.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 96098f01 | 08-Mar-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: crypto: introduce struct crypto_cipher_ops
Uses struct crypto_cipher_ops pointer in crypto context for ciphers as a glue layer instead of a switch(algo) in each crypto_cipher_*() function.
Re
core: crypto: introduce struct crypto_cipher_ops
Uses struct crypto_cipher_ops pointer in crypto context for ciphers as a glue layer instead of a switch(algo) in each crypto_cipher_*() function.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 5da36a24 | 08-Mar-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: crypto: introduce struct crypto_mac_ops
Uses struct crypto_mac_ops pointer in crypto context for MACs as a glue layer instead of a switch(algo) in each crypto_mac_*() function.
Moves CBC-MAC
core: crypto: introduce struct crypto_mac_ops
Uses struct crypto_mac_ops pointer in crypto context for MACs as a glue layer instead of a switch(algo) in each crypto_mac_*() function.
Moves CBC-MAC implementation from LTC wrapper to core/crypto.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 6d259e05 | 08-Mar-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: implement crypto_cipher_get_block_size()
Prior to this patch only the prototype and a stub of crypto_cipher_get_block_size() was available. With this patch replace the stub with an implementat
core: implement crypto_cipher_get_block_size()
Prior to this patch only the prototype and a stub of crypto_cipher_get_block_size() was available. With this patch replace the stub with an implementation.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|