Fix bugs in reworked crypto code

This commit + 7598956 (Updates for ARM Trusted Firmware tag v1.0) +
b8976a6 (plat-vexpress: fix non-debug build) was tested on Foundation_v8 with
xtest. Failure of test 1001 is due to a missing static TA in the vexpress
build.

+-----------------------------------------------------
Result of testsuite XTEST_TEE_TEST:
XTEST_TEE_1001 FAILED first error at xtest_1000.c:174
XTEST_TEE_1004 OK
XTEST_TEE_1005 OK
XTEST_TEE_1006 OK
XTEST_TEE_1007 OK
XTEST_TEE_1008 OK
XTEST_TEE_1009 OK
XTEST_TEE_1010 OK
XTEST_TEE_1011 OK
XTEST_TEE_1012 OK
XTEST_TEE_2001 OK
XTEST_TEE_2002 OK
XTEST_TEE_2003 OK
XTEST_TEE_4001 OK
XTEST_TEE_4002 OK
XTEST_TEE_4003_NO_XTS OK
XTEST_TEE_4003_XTS SKIPPED: "XTS not supported"
XTEST_TEE_4004 OK
XTEST_TEE_4005 OK
XTEST_TEE_4006 OK
XTEST_TEE_4007 OK
XTEST_TEE_4008 OK
+-----------------------------------------------------