| 7531fb24 | 29-Mar-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
Use mempool API from libutils for bignum allocations
Uses the Use mempool API from libutils for bignum allocations.
Reviewed-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> Acked-by: Jerome Forissie
Use mempool API from libutils for bignum allocations
Uses the Use mempool API from libutils for bignum allocations.
Reviewed-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| bc879b17 | 16-Apr-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
ltc: detect GCM counter re-use
Upstream commit 7d418b34b3fe ("Fix GCM counter reuse"):
GCM should error out after processing (2^32)-1 blocks / (2^39)-256 bits
[Note: LibTomCrypt GCM is used when C
ltc: detect GCM counter re-use
Upstream commit 7d418b34b3fe ("Fix GCM counter reuse"):
GCM should error out after processing (2^32)-1 blocks / (2^39)-256 bits
[Note: LibTomCrypt GCM is used when CFG_CRYPTO_AES_GCM_FROM_CRYPTOLIB=y which is not the default]
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMU) Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960) Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 03288f92 | 12-Apr-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
ltc: mpa: fix potential memory leak in exptmod()
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reported-by: Oliver Chiang <oliver.chiang@mstarsemi.com> Acked-by: Jens Wiklander <jens
ltc: mpa: fix potential memory leak in exptmod()
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reported-by: Oliver Chiang <oliver.chiang@mstarsemi.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| e39aae81 | 10-Apr-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: crypto: arm32: add counter increment in ce_aes_ctr_encrypt()
Commit 628a9a10ca36 ("ltc: ctr: improve performance") reveals a bug in the Aarch32 accelerated crypto code (AES CTR mode), which ca
core: crypto: arm32: add counter increment in ce_aes_ctr_encrypt()
Commit 628a9a10ca36 ("ltc: ctr: improve performance") reveals a bug in the Aarch32 accelerated crypto code (AES CTR mode), which causes xtest 9159 to fail with some invalid buffer content: encrypting 96 bytes of data in one pass does not yield the same result than encrypting 3 * 32 bytes. The problem is fixed by adding a missing counter increment in ce_aes_ctr_encrypt().
Fixes: 9ff4f2ccc026 ("arm32: AES using ARMv8-A cryptographic extensions") Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960) Acked-by: Joakim Bech <joakim.bech@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 409d2ff0 | 26-Mar-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: crypto: ltc: introduce CFG_CORE_BIGNUM_MAX_BITS
Make the size of big numbers in the TEE core configurable. The default (4096 bits) may be reduced if such a large key size is not needed, to sav
core: crypto: ltc: introduce CFG_CORE_BIGNUM_MAX_BITS
Make the size of big numbers in the TEE core configurable. The default (4096 bits) may be reduced if such a large key size is not needed, to save core memory.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 628a9a10 | 07-Mar-2018 |
Tetsuya Yoshizaki <yoshizaki.tetsuya@socionext.com> |
ltc: ctr: improve performance
When accel_ctr_encrypt() is not used, accel_ecb_encrypt() is used via ecb_encrypt() instead. The accel_ecb_encrypt() is frequently called at every single block process.
ltc: ctr: improve performance
When accel_ctr_encrypt() is not used, accel_ecb_encrypt() is used via ecb_encrypt() instead. The accel_ecb_encrypt() is frequently called at every single block process. VFP assembly code called from the accel_ecb_encrypt() is protected by tomcrypt_arm_neon_enable()/disable(). FIQ enable/disable and VFP register save/restore (64bitx32 registers!) to/from memory are done in the tomcrypt_arm_neon_enable()/disable(). These overhead exist in each single block process cause the degradation of system performance eventually. Cases where h/w accelerated AES-CTR did not show any effects or showed less performance than pure software processing have been observed.
This patch resolves the issue by increasing utilization rate of accel_ctr_encrypt().
Signed-off-by: Tetsuya Yoshizaki <yoshizaki.tetsuya@socionext.com> Signed-off-by: Victor Chong <victor.chong@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 9b94299a | 09-Feb-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: ltc: prevent incorrect asserts in crypto_*_free_ctx()
Avoid asserting in crypto_*_free_ctx() in the following case:
void *ctx = NULL; TEE_Result res;
res = crypto_*_alloc_ctx(&ctx, <u
core: ltc: prevent incorrect asserts in crypto_*_free_ctx()
Avoid asserting in crypto_*_free_ctx() in the following case:
void *ctx = NULL; TEE_Result res;
res = crypto_*_alloc_ctx(&ctx, <unsupported_algo>) if (!res) goto out; /* ... */ out: crypto_*_free_ctx(ctx);
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| baa999cd | 19-Jan-2018 |
Tetsuya Yoshizaki <yoshizaki.tetsuya@socionext.com> |
ltc: ctr: update pt and ct after acceleration
Problem occurs in the condition of the following case:
1st decryption: Decrypt a ciphertext whose length is a multiple of the block size (16B) (len = n
ltc: ctr: update pt and ct after acceleration
Problem occurs in the condition of the following case:
1st decryption: Decrypt a ciphertext whose length is a multiple of the block size (16B) (len = n * block_size) 2nd decryption: Decrypt the continuing ciphertext whose length is not a multiple of the block size (len = m * block_size + l)
In this case accel_ctr_encrypt() is firstly used at the 2nd decryption. If pt and ct are not updated, the top (l = len % block_size) bytes of decryption result are sometimes destroyed.
Signed-off-by: Tetsuya Yoshizaki <yoshizaki.tetsuya@socionext.com> Signed-off-by: Victor Chong <victor.chong@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960) Link: https://github.com/libtom/libtomcrypt/commit/d1d3ae2d1e70
show more ...
|
| d7ac7d0f | 21-Dec-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: crypto.h manages authenc context memory
To ease integration with other crypto libraries change the authenc context interface in crypto.h to manage the memory used for the authenc context.
Rev
core: crypto.h manages authenc context memory
To ease integration with other crypto libraries change the authenc context interface in crypto.h to manage the memory used for the authenc context.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 72a9b1a0 | 21-Dec-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: crypto.h manages cipher context memory
To ease integration with other crypto libraries change the cipher context interface in crypto.h to manage the memory used for the cipher context.
Review
core: crypto.h manages cipher context memory
To ease integration with other crypto libraries change the cipher context interface in crypto.h to manage the memory used for the cipher context.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 82ef73bc | 21-Dec-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: crypto.h manages mac context memory
To ease integration with other crypto libraries change the mac context interface in crypto.h to manage the memory used for the mac context.
Reviewed-by: Je
core: crypto.h manages mac context memory
To ease integration with other crypto libraries change the mac context interface in crypto.h to manage the memory used for the mac context.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| ecf2e014 | 21-Dec-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: crypto.h manages hash context memory
To ease integration with other crypto libraries change the hash context interface in crypto.h to manage the memory used for the hash context.
Reviewed-by:
core: crypto.h manages hash context memory
To ease integration with other crypto libraries change the hash context interface in crypto.h to manage the memory used for the hash context.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b1d7375c | 15-Dec-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Remove 'All rights reserved' from Linaro files
The text 'All rights reserved' is useless [1]. The Free Software Foundation's REUSE Initiative best practices document [2] does not contain these words
Remove 'All rights reserved' from Linaro files
The text 'All rights reserved' is useless [1]. The Free Software Foundation's REUSE Initiative best practices document [2] does not contain these words. Therefore, we can safely remove the text from the files that are owned by Linaro.
Generated by: spdxify.py --linaro-only --strip-arr optee_os/
Link: [1] https://en.wikipedia.org/wiki/All_rights_reserved Link: [2] https://reuse.software/practices/ Link: [3] https://github.com/jforissier/misc/blob/f7b56c8/spdxify.py Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| 78b7c7c7 | 15-Dec-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Remove license notice from Linaro files
Now that we have added SPDX identifiers, we can safely remove the verbose license text from the files that are owned by Linaro.
Generated by [1]: spdxify.p
Remove license notice from Linaro files
Now that we have added SPDX identifiers, we can safely remove the verbose license text from the files that are owned by Linaro.
Generated by [1]: spdxify.py --linaro-only --strip-license-text optee_os/
Link: [1] https://github.com/jforissier/misc/blob/f7b56c8/spdxify.py Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| 1bb92983 | 15-Dec-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Add SPDX license identifiers
Adds one SPDX-License-Identifier line [1] to each source files that contains license text.
Generated by [2]: spdxify.py --add-spdx optee_os/
The scancode tool [3] wa
Add SPDX license identifiers
Adds one SPDX-License-Identifier line [1] to each source files that contains license text.
Generated by [2]: spdxify.py --add-spdx optee_os/
The scancode tool [3] was used to double check the license matching code in the Python script. All the licenses detected by scancode are either detected by spdxify.py, or have no SPDX identifier, or are false matches.
Link: [1] https://spdx.org/licenses/ Link: [2] https://github.com/jforissier/misc/blob/f7b56c8/spdxify.py Link: [3] https://github.com/nexB/scancode-toolkit Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| fb7ef469 | 15-Dec-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Reformat copyright/license header in files with an SPDX ID
Some files were committed with an SPDX license identifier before the rules were defined [1]. Reformat them accordingly.
[1] documentation/
Reformat copyright/license header in files with an SPDX ID
Some files were committed with an SPDX license identifier before the rules were defined [1]. Reformat them accordingly.
[1] documentation/copyright_and_license_headers.rst
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| 0d360202 | 21-Nov-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: LTC provide some AES primitives
Provides crypto_aes_expand_enc_key() and crypto_aes_enc_block(). These functions are needed to avoid exposing the type symmetric_key outside of LTC.
Reviewed-b
core: LTC provide some AES primitives
Provides crypto_aes_expand_enc_key() and crypto_aes_enc_block(). These functions are needed to avoid exposing the type symmetric_key outside of LTC.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b1469ba0 | 22-Nov-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: ltc: fix double free in dsa_import()
Upstream commit 1e260eeaae43 ("fir coverity finding: dsa_import double free").
Fixes: https://github.com/OP-TEE/optee_os/issues/1962 Signed-off-by: Jerome
core: ltc: fix double free in dsa_import()
Upstream commit 1e260eeaae43 ("fir coverity finding: dsa_import double free").
Fixes: https://github.com/OP-TEE/optee_os/issues/1962 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 71cd3ee4 | 17-Nov-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add CFG_CRYPTO_AES_GCM_FROM_CRYPTOLIB
Adds CFG_CRYPTO_AES_GCM_FROM_CRYPTOLIB which if y will enable AES-GCM in the crypto library and use that as the implementation used by crypto_authen_*() f
core: add CFG_CRYPTO_AES_GCM_FROM_CRYPTOLIB
Adds CFG_CRYPTO_AES_GCM_FROM_CRYPTOLIB which if y will enable AES-GCM in the crypto library and use that as the implementation used by crypto_authen_*() functions.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 3d3ad63d | 17-Nov-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add core/crypto.mk with CFG_CRYPTO* flags
Moves CFG_CRYPTO* and _CFG_CRYPTO flags in core/lib/libtomcrypt/sub.mk to core/crypto.mk.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Si
core: add core/crypto.mk with CFG_CRYPTO* flags
Moves CFG_CRYPTO* and _CFG_CRYPTO flags in core/lib/libtomcrypt/sub.mk to core/crypto.mk.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 75200110 | 16-Nov-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
LTC: add GHASH acceleration
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> |
| d0620b01 | 13-Nov-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: move crypto_authenc_*() from LTC
* Moves crypto_authenc_*() from LTC to core/crypto/crypto.c * Defines <crypto/aes-gcm.h> and <crypto/aes-ccm.h> and implements the functions in core/lib/li
core: move crypto_authenc_*() from LTC
* Moves crypto_authenc_*() from LTC to core/crypto/crypto.c * Defines <crypto/aes-gcm.h> and <crypto/aes-ccm.h> and implements the functions in core/lib/libtomcrypt/src/tee_ltc_provider.c based on the old implementations of crypto_authenc_*().
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| e1770e71 | 13-Nov-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: rename to <crypto/crypto.h>
Renames core/include/tee/tee_cryp_provider.h to core/include/crypto/crypto.h
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere
core: rename to <crypto/crypto.h>
Renames core/include/tee/tee_cryp_provider.h to core/include/crypto/crypto.h
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 3bbd3ce9 | 10-Nov-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove struct crypto_ops
Removes struct crypto_ops and adds crypto_init()
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
core: remove struct crypto_ops
Removes struct crypto_ops and adds crypto_init()
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 291e5450 | 10-Nov-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
Replace struct acipher_ops with function interface
Adds crypto_acipher_*() replacing struct acipher_ops in crypto_ops.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne
Replace struct acipher_ops with function interface
Adds crypto_acipher_*() replacing struct acipher_ops in crypto_ops.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|