Add dhex_dump() and DHEXDUMP() to format and print data in hexadecimal

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>
Tested-by: Pascal Brand <pascal.brand@linaro.org> (STM platform)
Add stable commits to the setup FVP script

Instead of checking out latest on all Gits we have now identified a
couple of commits for all Gits (except optee_os) that could be
considered as stable commits.

Also added a script that cleans all Gits.

Signed-off-by: Joakim Bech <joakim.bech@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
Tested-by: Joakim Bech <joakim.bech@linaro.org> (FVP)
Minimize LTC with some flags

Sets LTC_NO_TEST for globally.

Lets platform decide with libtomcrypt_with_optimize_size if
LTC_SMALL_CODE and LTC_NO_FAST should be set.

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

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
mpa_desc.c: convert from DOS to UNIX format

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

Removes floating point calculations in libmap. The floating point
calculations was unused but caused compile error when compiled
with DEBUG=1.

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

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Pascal Brand <pascal.brand@st.com>
Move tee_misc in generic part

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Pascal Brand <pascal.brand@st.com>
core: generic buffer inside/outside/intersect routine

Remove multiple implementation of "is buffer inside a buffer" and
friends and rely on a generic core_is_buffer_inside/outside/intersect().

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 platform)
Signed-off-by: Pascal Brand <pascal.brand@st.com>
Fix to finalize mac compute when there is not a last message chunk.

Code implemented in TAs may need to call TEE_MACComputeFinal,
without last message chunk.

Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Pascal Brand <pascal.brand@linaro.org> (STM platform)
Tested-by: Thierry BINIGUER <thierry.biniguer@st.com>
Reviewed-by: Pascal BRAND <pascal.brand@st.com>
Tested-by: Etienne CARRIERE <etienne.carriere@st.com>
Reviewed-by: Etienne CARRIERE <etienne.carriere@st.com>
Signed-off-by: Pascal Brand <pascal.brand@st.com>
TA-dev-kit: build TA with -mfloat-abi=soft

Solves the same problem as in commit e46048ea67f7...

Signed-off-by: Joakim Bech <joakim.bech@linaro.org>
Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Add crypto provider internal API

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Import OpenSSL 1.0.1i

$ md5sum openssl-1.0.1i.tar.gz
c8dc151a671b9b92ff3e4c118b174972  openssl-1.0.1i.tar.gz

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
OpenSSL: AES-XTS: allow multiple calls to EVP_EncryptUpdate() and EVP_DecryptUpdate()

This commit modifies CRYPTO_xts128_encrypt() so that tweak information
is saved in the context for the next call.
Implement OpenSSL crypto provider (WITH_CRYPTO=openssl)

Set the WITH_CRYPTO build option to 'openssl' to use the OpenSSL licrypto
library for cryptographic services. When WITH_CRYPTO is not set or set to
'tomcrypt', the default LibTomCrypt library is used.

Usage example:
  $ make CROSS_COMPILE=arm-linux-gnueabihf- \
         PLATFORM=vexpress PLATFORM_FLAVOR=fvp \
         WITH_CRYPTO=openssl

Tested with xtest on Foundation_v8 (PLATFORM_FLAVOR=fvp) and QEMU
(PLATFORM_FLAVOR=qemu_virt).

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>