History log of /optee_os/core/lib/libtomcrypt/ (Results 226 – 250 of 287)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
53fe16f323-Nov-2015 Jerome Forissier <jerome.forissier@linaro.org>

Avoid duplication of $(call force,CFG_WITH_VFP,y)

When cryptographic extensions are used, and whatever the platform,
we have to ensure that VFP preservation is enabled too. Therefore it
makes sense

Avoid duplication of $(call force,CFG_WITH_VFP,y)

When cryptographic extensions are used, and whatever the platform,
we have to ensure that VFP preservation is enabled too. Therefore it
makes sense to centralize the tests in core/lib/libtomcrypt/sub.mk
instead of having them in the platform-specific configuration files.

Incidentally, this adds a few missing statements to HiKey and Mediatek.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>

show more ...

0d1e115c28-Oct-2015 Jens Wiklander <jens.wiklander@linaro.org>

core: ltc: enable thread-safety

Enables thread-safety by replacing empty macros for mutex handling with
a real implementation.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by:

core: ltc: enable thread-safety

Enables thread-safety by replacing empty macros for mutex handling with
a real implementation.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>

show more ...

1051957d27-Oct-2015 Jens Wiklander <jens.wiklander@linaro.org>

core: ltc: add lock for memory pool

Adds a recursive lock for the memory pool, allowing only one thread at a
time to use the memory pool. This makes a predictable or consistent
worst case for memory

core: ltc: add lock for memory pool

Adds a recursive lock for the memory pool, allowing only one thread at a
time to use the memory pool. This makes a predictable or consistent
worst case for memory pool utilization. It also allows for a controlled
way of releasing memory from the pool to the pager when the pool is
unused.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>

show more ...


/optee_os/.travis.yml
/optee_os/MAINTAINERS.md
/optee_os/README.md
/optee_os/core/arch/arm/arm.mk
/optee_os/core/arch/arm/include/arm32.h
/optee_os/core/arch/arm/include/arm64.h
/optee_os/core/arch/arm/include/kernel/thread.h
/optee_os/core/arch/arm/include/kernel/time_source.h
/optee_os/core/arch/arm/include/kernel/wait_queue.h
/optee_os/core/arch/arm/include/mm/core_mmu.h
/optee_os/core/arch/arm/include/mm/tee_pager.h
/optee_os/core/arch/arm/include/tee/entry_fast.h
/optee_os/core/arch/arm/include/tee/entry_std.h
/optee_os/core/arch/arm/kernel/generic_boot.c
/optee_os/core/arch/arm/kernel/generic_entry_a32.S
/optee_os/core/arch/arm/kernel/generic_entry_a64.S
/optee_os/core/arch/arm/kernel/kern.ld.S
/optee_os/core/arch/arm/kernel/link.mk
/optee_os/core/arch/arm/kernel/mutex.c
/optee_os/core/arch/arm/kernel/tee_time.c
/optee_os/core/arch/arm/kernel/tee_time_arm_cntpct.c
/optee_os/core/arch/arm/kernel/tee_time_ree.c
/optee_os/core/arch/arm/kernel/thread.c
/optee_os/core/arch/arm/kernel/thread_private.h
/optee_os/core/arch/arm/kernel/wait_queue.c
/optee_os/core/arch/arm/mm/core_mmu_lpae.c
/optee_os/core/arch/arm/mm/core_mmu_v7.c
/optee_os/core/arch/arm/mm/tee_pager.c
/optee_os/core/arch/arm/plat-hikey/main.c
/optee_os/core/arch/arm/plat-imx/main.c
/optee_os/core/arch/arm/plat-ls/main.c
/optee_os/core/arch/arm/plat-mediatek/main.c
/optee_os/core/arch/arm/plat-stm/main.c
/optee_os/core/arch/arm/plat-sunxi/main.c
/optee_os/core/arch/arm/plat-sunxi/platform.c
/optee_os/core/arch/arm/plat-ti/main.c
/optee_os/core/arch/arm/plat-vexpress/main.c
/optee_os/core/arch/arm/tee/entry_fast.c
/optee_os/core/arch/arm/tee/entry_std.c
/optee_os/core/arch/arm/tee/sub.mk
/optee_os/core/drivers/gic.c
/optee_os/core/include/kernel/tee_time.h
src/tee_ltc_provider.c
/optee_os/core/tee/tee_svc.c
/optee_os/documentation/images/interrupt_handling/Makefile
/optee_os/documentation/images/interrupt_handling/fiq.msc
/optee_os/documentation/images/interrupt_handling/fiq.png
/optee_os/documentation/images/interrupt_handling/irq.msc
/optee_os/documentation/images/interrupt_handling/irq.png
/optee_os/documentation/images/interrupt_handling/irq_fiq.msc
/optee_os/documentation/images/interrupt_handling/irq_fiq.png
/optee_os/documentation/images/interrupt_handling/tee_invoke.msc
/optee_os/documentation/images/interrupt_handling/tee_invoke.png
/optee_os/documentation/interrupt_handling.md
/optee_os/lib/libmpa/include/mpalib.h
/optee_os/lib/libmpa/mpa_mem_static.c
/optee_os/lib/libutils/ext/trace.c
9bdc34f228-Oct-2015 Jens Wiklander <jens.wiklander@linaro.org>

Convert remaining CRLF files

Converts the remaining CRLF files to LF, unix style.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
Revie

Convert remaining CRLF files

Converts the remaining CRLF files to LF, unix style.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>

show more ...


/optee_os/README.md
/optee_os/core/arch/arm/arm.mk
/optee_os/core/arch/arm/include/arm32.h
/optee_os/core/arch/arm/include/kernel/thread.h
/optee_os/core/arch/arm/include/kernel/tz_proc_def.h
/optee_os/core/arch/arm/include/mm/core_mmu.h
/optee_os/core/arch/arm/include/mm/tee_pager.h
/optee_os/core/arch/arm/include/sm/teesmc.h
/optee_os/core/arch/arm/include/tee/arch_svc.h
/optee_os/core/arch/arm/kernel/tee_ta_manager.c
/optee_os/core/arch/arm/kernel/thread.c
/optee_os/core/arch/arm/kernel/thread_a32.S
/optee_os/core/arch/arm/mm/core_mmu_v7.c
/optee_os/core/arch/arm/mm/tee_pager.c
/optee_os/core/arch/arm/plat-hikey/conf.mk
/optee_os/core/arch/arm/plat-imx/conf.mk
/optee_os/core/arch/arm/plat-ls/conf.mk
/optee_os/core/arch/arm/plat-ls/platform_flags.mk
/optee_os/core/arch/arm/plat-mediatek/conf.mk
/optee_os/core/arch/arm/plat-stm/conf.mk
/optee_os/core/arch/arm/plat-sunxi/conf.mk
/optee_os/core/arch/arm/plat-ti/conf.mk
/optee_os/core/arch/arm/plat-vexpress/conf.mk
/optee_os/core/arch/arm/plat-vexpress/main.c
/optee_os/core/arch/arm/plat-vexpress/platform_config.h
/optee_os/core/arch/arm/sta/stats.c
/optee_os/core/arch/arm/sta/sub.mk
/optee_os/core/arch/arm/tee/arch_svc.c
/optee_os/core/arch/arm/tee/arch_svc_a32.S
/optee_os/core/arch/arm/tee/arch_svc_a64.S
/optee_os/core/arch/arm/tee/arch_svc_private.h
/optee_os/core/core.mk
/optee_os/core/include/kernel/tee_ta_manager.h
/optee_os/core/include/mm/tee_mm.h
/optee_os/core/include/mm/tee_mmu_types.h
/optee_os/core/include/signed_hdr.h
/optee_os/core/include/tee/se/svc.h
/optee_os/core/include/tee/tee_svc.h
/optee_os/core/include/tee/tee_svc_cryp.h
/optee_os/core/include/tee/tee_svc_storage.h
include/tomcrypt_mpa.h
test/unit_test.c
/optee_os/core/tee/se/svc.c
/optee_os/core/tee/tee_svc.c
/optee_os/core/tee/tee_svc_cryp.c
/optee_os/core/tee/tee_svc_storage.c
/optee_os/documentation/images/secure_storage/block_data_encryption.odg
/optee_os/documentation/images/secure_storage/block_data_encryption.png
/optee_os/documentation/images/secure_storage/meta_data_encryption.odg
/optee_os/documentation/images/secure_storage/meta_data_encryption.png
/optee_os/documentation/images/secure_storage/secure_storage_system_architecture.odg
/optee_os/documentation/images/secure_storage/secure_storage_system_architecture.png
/optee_os/documentation/images/secure_storage/tee_file_structure.odg
/optee_os/documentation/images/secure_storage/tee_file_structure.png
/optee_os/documentation/secure_storage.md
/optee_os/lib/libutee/include/tee_api.h
/optee_os/lib/libutee/sub.mk
/optee_os/lib/libutee/tee_api.c
/optee_os/lib/libutee/tee_api_operations.c
/optee_os/lib/libutee/tee_api_panic.c
/optee_os/lib/libutils/sub.mk
/optee_os/mk/checkconf.mk
/optee_os/mk/config.mk
/optee_os/ta/mk/ta_dev_kit.mk
/optee_os/ta/ta.mk
12ddd2b119-Oct-2015 Pascal Brand <pascal.brand@st.com>

Introduce free_rsa_public_key() and free_ecc_public_key()

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Pascal Brand

Introduce free_rsa_public_key() and free_ecc_public_key()

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Pascal Brand <pascal.brand@linaro.org> (STM)
Signed-off-by: Pascal Brand <pascal.brand@st.com>

show more ...

39d1f75c13-Oct-2015 Pascal Brand <pascal.brand@st.com>

pager: remove pages used by scratch memory

Libtomcrypt is using, because of mpa, some scratch memory
used in intermediate computation. These data are useless
once the acipher computation is complete

pager: remove pages used by scratch memory

Libtomcrypt is using, because of mpa, some scratch memory
used in intermediate computation. These data are useless
once the acipher computation is completed. That means
that these data pages can be unmapped.

On QEMU, compiled with CFG_WITH_PAGER=y, "time xtest 4006" returns:
- Before the patch
real 3m 46.24s
user 0m 0.19s
sys 3m 45.51s
- After the patch
real 1m 29.00s
user 0m 0.17s
sys 1m 28.51s

Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Pascal Brand <pascal.brand@linaro.org> (QEMU with CFG_WITH_PAGER=y)
Signed-off-by: Pascal Brand <pascal.brand@st.com>

show more ...


/optee_os/.travis.yml
/optee_os/CHANGELOG.md
/optee_os/LICENSE
/optee_os/Notice.md
/optee_os/README.md
/optee_os/core/arch/arm/include/kernel/generic_boot.h
/optee_os/core/arch/arm/include/kernel/thread.h
/optee_os/core/arch/arm/include/mm/tee_pager.h
/optee_os/core/arch/arm/kernel/generic_boot.c
/optee_os/core/arch/arm/kernel/generic_entry_a32.S
/optee_os/core/arch/arm/kernel/kern.ld.S
/optee_os/core/arch/arm/kernel/link.mk
/optee_os/core/arch/arm/kernel/tee_ta_manager.c
/optee_os/core/arch/arm/kernel/thread.c
/optee_os/core/arch/arm/mm/tee_pager.c
/optee_os/core/arch/arm/plat-imx/conf.mk
/optee_os/core/arch/arm/plat-imx/kern.ld.S
/optee_os/core/arch/arm/plat-imx/link.mk
/optee_os/core/arch/arm/plat-imx/main.c
/optee_os/core/arch/arm/plat-imx/platform_config.h
/optee_os/core/arch/arm/plat-imx/platform_flags.mk
/optee_os/core/arch/arm/plat-imx/sub.mk
/optee_os/core/arch/arm/plat-ls/conf.mk
/optee_os/core/arch/arm/plat-ls/kern.ld.S
/optee_os/core/arch/arm/plat-ls/link.mk
/optee_os/core/arch/arm/plat-ls/ls_core_pos.S
/optee_os/core/arch/arm/plat-ls/main.c
/optee_os/core/arch/arm/plat-ls/platform_config.h
/optee_os/core/arch/arm/plat-ls/platform_flags.mk
/optee_os/core/arch/arm/plat-ls/sub.mk
/optee_os/core/arch/arm/plat-stm/platform_config.h
/optee_os/core/arch/arm/plat-stm/system_config.mk
/optee_os/core/drivers/imx_uart.c
/optee_os/core/drivers/ns16550.c
/optee_os/core/drivers/sub.mk
/optee_os/core/include/drivers/imx_uart.h
/optee_os/core/include/drivers/ns16550.h
/optee_os/core/include/tee/tee_fs.h
/optee_os/core/include/tee/tee_fs_defs.h
/optee_os/core/include/tee/tee_obj.h
/optee_os/core/include/tee/tee_svc_storage.h
src/tee_ltc_provider.c
/optee_os/core/sub.mk
/optee_os/core/tee/tee_fs.c
/optee_os/core/tee/tee_fs_common.c
/optee_os/core/tee/tee_fs_private.h
/optee_os/core/tee/tee_obj.c
/optee_os/core/tee/tee_svc_cryp.c
/optee_os/core/tee/tee_svc_storage.c
/optee_os/lib/libutee/tee_api_objects.c
/optee_os/ta/ta.mk
c0b62a6823-Sep-2015 Jerome Forissier <jerome.forissier@linaro.org>

libtomcrypt: ECC code depends on ASN1 routines

Fixes:
$ make -j8 -s CFG_CRYPTO_{DSA,RSA}=n
[...]libtomcrypt.a(ecc_sign_hash.o): In function `ecc_sign_hash':
[...]ecc_sign_hash.c:166: undefined re

libtomcrypt: ECC code depends on ASN1 routines

Fixes:
$ make -j8 -s CFG_CRYPTO_{DSA,RSA}=n
[...]libtomcrypt.a(ecc_sign_hash.o): In function `ecc_sign_hash':
[...]ecc_sign_hash.c:166: undefined reference to
`der_encode_sequence_multi'

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>

show more ...

a10e3a9123-Sep-2015 Jerome Forissier <jerome.forissier@linaro.org>

libtomcrypt: build prngs folder when CFG_WITH_SOFTWARE_PRNG is set

sub.mk is now consistent with the definition of struct tee_ltc_prng in
tee_ltc_provider.c.

Signed-off-by: Jerome Forissier <jerome

libtomcrypt: build prngs folder when CFG_WITH_SOFTWARE_PRNG is set

sub.mk is now consistent with the definition of struct tee_ltc_prng in
tee_ltc_provider.c.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>

show more ...

07a169c503-Sep-2015 Cedric Chaumont <cedric.chaumont@st.com>

GP11 : DSA-SHA224 and DSA-SHA256 algo

Signed-off-by: Cedric Chaumont <cedric.chaumont@st.com>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.o

GP11 : DSA-SHA224 and DSA-SHA256 algo

Signed-off-by: Cedric Chaumont <cedric.chaumont@st.com>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Cedric Chaumont <cedric.chaumont@linaro.org> (STM boards)
Tested-by: Cedric Chaumont <cedric.chaumont@linaro.org> (ARM Juno board)

show more ...

3f4b525026-Aug-2015 Pascal Brand <pascal.brand@st.com>

libtomcrypt: sync ccm code

https://github.com/libtom/libtomcrypt/issues/73 highlighted NIST specifications
are not met in previous implementation. Here is the description of this issue:
Accordin

libtomcrypt: sync ccm code

https://github.com/libtom/libtomcrypt/issues/73 highlighted NIST specifications
are not met in previous implementation. Here is the description of this issue:
According to the NIST specification of CCM, the authentication tag is
part of the ciphertext. In order to decrypt, this full ciphertext must
be decrypted, resulting in a "plaintext" tag. The tag must then be
recomputed upon the plaintext and compared with the decrypted value.
However, upon decryption in the libtom implementation, the ciphertext
is decrypted, and a tag is computed upon the header and (decrypted)
plaintext. This is then re-encrypted, so that the caller of the function
must compare the resulting (encryped) tag with the received (encrypted) tag.

The NIST specification specifies that "only the error message INVALID is
returned" when the decryption-verification fails. In that case "the payload
P and the MAC T shall not be revealed" and that "the implementation shall
ensure that an unauthorized party cannot distinguish whether the error
message results from [invalid message format] or from [authentication
failure], for example, from the timing of the error message."

Current patch:
- sync CCM libtomcrypt code with the ones in optee_os
- NIST specifications are now met.
Note that ccm_memory() API has been modified.
- check of non-null pointers
- remove spurious space
- remove compilation of ccm_memory which is not used in optee_os

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Pascal Brand <pascal.brand@linaro.org> (QEMU platform)
Signed-off-by: Pascal Brand <pascal.brand@st.com>

show more ...


/optee_os/.travis.yml
/optee_os/README.md
/optee_os/core/arch/arm/include/arm.h
/optee_os/core/arch/arm/include/kernel/generic_boot.h
/optee_os/core/arch/arm/include/kernel/tee_l2cc_mutex.h
/optee_os/core/arch/arm/kernel/generic_boot.c
/optee_os/core/arch/arm/kernel/tee_l2cc_mutex.c
/optee_os/core/arch/arm/kernel/tee_ta_manager.c
/optee_os/core/arch/arm/kernel/thread.c
/optee_os/core/arch/arm/mm/tee_mmu.c
/optee_os/core/arch/arm/plat-ti/conf.mk
/optee_os/core/arch/arm/plat-ti/kern.ld.S
/optee_os/core/arch/arm/plat-ti/link.mk
/optee_os/core/arch/arm/plat-ti/main.c
/optee_os/core/arch/arm/plat-ti/platform_config.h
/optee_os/core/arch/arm/plat-ti/platform_flags.mk
/optee_os/core/arch/arm/plat-ti/sub.mk
/optee_os/core/arch/arm/plat-vexpress/conf.mk
/optee_os/core/arch/arm/sta/sub.mk
/optee_os/core/arch/arm/sta/tee_fs_key_manager_tests.c
/optee_os/core/arch/arm/tee/entry.c
/optee_os/core/include/kernel/tee_dispatch.h
/optee_os/core/include/mm/tee_mmu.h
/optee_os/core/include/tee/tee_fs.h
/optee_os/core/include/tee/tee_fs_key_manager.h
/optee_os/core/kernel/tee_dispatch.c
src/encauth/ccm/ccm_add_aad.c
src/encauth/ccm/ccm_add_nonce.c
src/encauth/ccm/ccm_done.c
src/encauth/ccm/ccm_init.c
src/encauth/ccm/ccm_memory.c
src/encauth/ccm/ccm_process.c
src/encauth/ccm/ccm_test.c
src/encauth/ccm/sub.mk
/optee_os/core/tee/sub.mk
/optee_os/core/tee/tee_fs_common.c
/optee_os/core/tee/tee_fs_key_manager.c
/optee_os/core/tee/tee_fs_private.h
/optee_os/documentation/debug.md
/optee_os/lib/libutils/isoc/include/string.h
/optee_os/lib/libutils/isoc/newlib/strncmp.c
/optee_os/lib/libutils/isoc/newlib/sub.mk
7823960925-Aug-2015 Pascal Brand <pascal.brand@st.com>

Fix leaking information from mem_neq

This fix comes from https://github.com/libtom/libtomcrypt/issues/74
mem_neq is a constant time comparison function, but it leaks information
on the secre

Fix leaking information from mem_neq

This fix comes from https://github.com/libtom/libtomcrypt/issues/74
mem_neq is a constant time comparison function, but it leaks information
on the secret data that is being compared in the value that is returned.

Signed-off-by: Pascal Brand <pascal.brand@st.com>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Pascal Brand <pascal.brand@linaro.org> (QEMU)

show more ...

39b7ffb607-Aug-2015 Jerome Forissier <jerome.forissier@linaro.org>

arm: Fix SHA-1 with cryptographic extensions

Commit 23900b599a98 ("arm: update SHA-1 32-bit CE implementation to
process multiple blocks") has introduced a regression on 32-bit
platforms when CFG_CR

arm: Fix SHA-1 with cryptographic extensions

Commit 23900b599a98 ("arm: update SHA-1 32-bit CE implementation to
process multiple blocks") has introduced a regression on 32-bit
platforms when CFG_CRYPTO_SHA1_ARM32_CE=y. Test case: xtest 4006.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>

show more ...

947ebd6927-Jul-2015 Pascal Brand <pascal.brand@st.com>

Hmac key is made static, as in other macs

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Pascal Brand <pascal.brand@linaro.org> (QEMU platform)
Signed-off-by: Pascal Brand <p

Hmac key is made static, as in other macs

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Pascal Brand <pascal.brand@linaro.org> (QEMU platform)
Signed-off-by: Pascal Brand <pascal.brand@st.com>

show more ...

5ddb74dd27-Jul-2015 Pascal Brand <pascal.brand@st.com>

libtomcrypt: fix memory leak in test

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Pascal Brand <pascal.brand@st.com>

de57ee0904-Aug-2015 Pascal Brand <pascal.brand@st.com>

libmpa: remove DEBUG flag

Traces in libmpa comes from legacy code. They are not used in
current code, nor can they be activated. Moreover, they look
obsolete and look hard to be useful in current st

libmpa: remove DEBUG flag

Traces in libmpa comes from legacy code. They are not used in
current code, nor can they be activated. Moreover, they look
obsolete and look hard to be useful in current state.

This patch removes traces in libmpa. This includes
- DEBUG and DEBUG_ME flags
- macros MEMPOOL_MARKER and MEMPOOL_SANITY_CHECK
- __mpa_dbg_xxx functions
- macro ASSERT
- files mpa_debug.h and mpa_assert.h

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Pascal Brand <pascal.brand@linaro.org> (QEMU platform)
Signed-off-by: Pascal Brand <pascal.brand@st.com>

show more ...

3d1b37c704-Aug-2015 Jerome Forissier <jerome.forissier@linaro.org>

arm64: SHA-224/SHA-256 using ARMv8-A cryptographic extensions

Import SHA-2 assembly code from the Linux kernel (linaro contribution).
Enabled with CFG_CRYPTO_SHA256_ARM64_CE=y, set by default on HiK

arm64: SHA-224/SHA-256 using ARMv8-A cryptographic extensions

Import SHA-2 assembly code from the Linux kernel (linaro contribution).
Enabled with CFG_CRYPTO_SHA256_ARM64_CE=y, set by default on HiKey.
Performance gains compared to the C implementation are as follows
(sha-perf results for SHA-256 on HiKey in MiB/s):

Size | Accelerated?
(KiB) | No Yes
------+-------------
1 | 11.4 18.3
2 | 16.8 35.6
4 | 21.8 66.8
8 | 25.7 118.9
16 | 28.3 195.5
32 | 29.7 289.7
64 | 30.5 383.3
128 | 30.9 456.9
256 | 31.2 505.3
384 | 31.2 520.7

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>

show more ...

06c5ab4d03-Aug-2015 Jerome Forissier <jerome.forissier@linaro.org>

arm: update SHA-256 32-bit CE implementation to process multiple blocks

Adjust the 32-bit ARMv8 Crypto Extensions version of the SHA-256
"compress" function to accept multiple blocks of input data.

arm: update SHA-256 32-bit CE implementation to process multiple blocks

Adjust the 32-bit ARMv8 Crypto Extensions version of the SHA-256
"compress" function to accept multiple blocks of input data.
Rename a couple of files in preparation for the 64-bit implementation
which will follow, and for consistency with SHA-1.

Performances with various buffer sizes were measured on HiKey with
sha-perf. Values are in MiB/s, column 'n' means no acceleration,
'y (before)' is the parent commit's accelerated code, and 'y (after)'
is this commit.

Size | CFG_CRYPTO_SHA256_ARM32_CE=?
(KiB) | n | y (before) | y (after)
------+-------+------------+-----------
1 | 17.8 | 31.9 | 36.3
2 | 22.9 | 52.1 | 67.4
4 | 26.9 | 78.9 | 117.5
8 | 29.4 | 105.2 | 188.4
16 | 30.9 | 125.3 | 268.5
32 | 31.7 | 139.4 | 341.7
64 | 32.1 | 147.8 | 401.4
128 | 32.4 | 152.4 | 438.7
256 | 32.5 | 154.8 | 460.6
384 | 32.5 | 155.4 | 467.0

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>

show more ...

23900b5903-Aug-2015 Jerome Forissier <jerome.forissier@linaro.org>

arm: update SHA-1 32-bit CE implementation to process multiple blocks

The assembly code in sha1_armv8a_ce_a32.S is updated so that
sha1_ce_transform() can process multiple blocks of data in a single

arm: update SHA-1 32-bit CE implementation to process multiple blocks

The assembly code in sha1_armv8a_ce_a32.S is updated so that
sha1_ce_transform() can process multiple blocks of data in a single
call. Performances are significantly improved, and the code is
unified with the 64-bit implementation.

Hashing throughput (MiB/s) reported by sha-perf on HiKey:

Size | CFG_CRYPTO_SHA1_ARM32_CE=?
(KiB) | n | y (parent) | y (this commit)
------+-------+------------+----------------
1 | 18.8 | 32.6 | 37.2
2 | 24.9 | 53.8 | 68.7
4 | 30.1 | 80.1 | 121.7
8 | 33.6 | 106.0 | 198.1
16 | 35.6 | 126.3 | 284.4
32 | 36.7 | 140.3 | 365.1
64 | 37.3 | 149.0 | 430.0
128 | 37.6 | 153.6 | 471.9
256 | 37.8 | 156.0 | 496.1
384 | 37.8 | 156.6 | 505.1

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>

show more ...

de51851c10-Jul-2015 Jerome Forissier <jerome.forissier@linaro.org>

arm64: SHA-1 using ARMv8-A cryptographic extensions

- LibTomCrypt: add a new macro, HASH_PROCESS_NBLOCKS, similar to
HASH_PROCESS but accepts a function that digests n blocks of data, not
just 1.
-

arm64: SHA-1 using ARMv8-A cryptographic extensions

- LibTomCrypt: add a new macro, HASH_PROCESS_NBLOCKS, similar to
HASH_PROCESS but accepts a function that digests n blocks of data, not
just 1.
- Import sha1_ce_transform() from the Linux kernel (Linaro contribution)
which implements the main SHA-1 transform in assembler using the ARMv-8
cryptographic extensions.
- Acceleration is enabled by setting CFG_CRYPTO_SHA1_ARM64_CE=y (this
is the default when PLATFORM=hikey).

Performance was compared to the plain C version using sha-perf
(https://github.com/linaro-swg/sha-perf.git). Average hashing speed on
HiKey is (MiB/s):

Size | Accelerated?
(KiB) | No Yes
------+-------------
1 | 12.3 18.4
2 | 18.6 35.6
4 | 24.9 66.9
8 | 29.9 118.0
16 | 33.3 192.9
32 | 35.3 282.6
64 | 36.4 369.6
128 | 37.0 436.4
256 | 37.3 479.9
384 | 37.4 494.4

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>

show more ...

a50aa51823-Jul-2015 Pascal Brand <pascal.brand@st.com>

Fix des3_cbc_mac in case of 112bits key

In DES3, a key of 112 bits is made of 2 56 bits keys.
DES3 can be run using only 2 56 bit keys, with the 3rd
key being equal to the first.

Fix #408

Reviewed

Fix des3_cbc_mac in case of 112bits key

In DES3, a key of 112 bits is made of 2 56 bits keys.
DES3 can be run using only 2 56 bit keys, with the 3rd
key being equal to the first.

Fix #408

Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Pascal Brand <pascal.brand@linaro.org> (QEMU)
Signed-off-by: Pascal Brand <pascal.brand@st.com>

show more ...

1962351e22-Jul-2015 Jens Wiklander <jens.wiklander@linaro.org>

libmpa: optimize size in mpa_get_str()

Save 4098 bytes of unpageable memory by removing option to group hex
numbers in mpa_get_str().

Note API change in libmpa, dropping groupsize parameter for
mpa

libmpa: optimize size in mpa_get_str()

Save 4098 bytes of unpageable memory by removing option to group hex
numbers in mpa_get_str().

Note API change in libmpa, dropping groupsize parameter for
mpa_get_str()

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU)
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>

show more ...

60fc60b322-Jul-2015 Jens Wiklander <jens.wiklander@linaro.org>

core: optimize size with const crypto_ops

Optimize size of unpaged data by making crypto_ops const.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand

core: optimize size with const crypto_ops

Optimize size of unpaged data by making crypto_ops const.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>

show more ...

5df9748221-Jul-2015 Pascal Brand <pascal.brand@st.com>

Add Post-Actions on acipher crypto algorithms

In order to check that all temporary variables, used in
acipher computation, are correctly released,
tee_ltc_acipher_postactions() has been added. It ra

Add Post-Actions on acipher crypto algorithms

In order to check that all temporary variables, used in
acipher computation, are correctly released,
tee_ltc_acipher_postactions() has been added. It raises
an assert in case some temporary variables have not
been released.

Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Pascal Brand <pascal.brand@linaro.org> (QEMU)
Signed-off-by: Pascal Brand <pascal.brand@st.com>

show more ...

6d914f6117-Jul-2015 Pascal Brand <pascal.brand@st.com>

ECC: optimize the pool of temporary variables

ECC is using a lot (80) temporary variables. These variables
are taken from a static pool, each being of the maximum key size
supported in OP-TEE: 4096b

ECC: optimize the pool of temporary variables

ECC is using a lot (80) temporary variables. These variables
are taken from a static pool, each being of the maximum key size
supported in OP-TEE: 4096bits, times 2 to include
wrapping multiplication in temporary computation.

With the introduction of being able to get temporary variables
of a given size, the current patch optimize the use of the variables
in case of ECC.

Thanks to this patch, the number of temporary variables is back to 50,
and the emulated esram size (QEMU / FVP / HiKey) is back to 200KB.

Note that further optimization can be performed, for ECC and also
for other algorithms (RSA,...).

Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Tested-by: Pascal Brand <pascal.brand@linaro.org> (QEMU platform)
Signed-off-by: Pascal Brand <pascal.brand@st.com>

show more ...

df6be4e117-Jul-2015 Pascal Brand <pascal.brand@st.com>

mpa: allocator for temporary variables

Tempory variables, in math, are taken in a pool.
Each variable has its size maximized, that is 4096 * 2
in order to make overflowed operations.

However, in mo

mpa: allocator for temporary variables

Tempory variables, in math, are taken in a pool.
Each variable has its size maximized, that is 4096 * 2
in order to make overflowed operations.

However, in most of the cases, like ECC, such big variable
is not necessary.

This patch introduce an allocator to get temporary variables
of given size, which is an enabler to reduce the number of
required memory for temporary variables

Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Pascal Brand <pascal.brand@st.com>

show more ...

12345678910>>...12