diff options
author | Jens Wiklander <jens.wiklander@linaro.org> | 2017-11-09 22:28:20 +0100 |
---|---|---|
committer | Jérôme Forissier <jerome.forissier@linaro.org> | 2017-11-14 13:48:32 +0100 |
commit | b887bd8f271b056210e964fe7e86dbafe7f6d752 (patch) | |
tree | a551340e2738d277cbce2a82e297ab2ce9074171 /core/crypto | |
parent | f1c1d5337fa53ca7ff875e84e10b146d55858643 (diff) |
Replace struct hash_ops with function interface
Adds crypto_hash_get_ctx_size(), crypto_hash_init(),
crypto_hash_update() and crypto_hash_final() replacing struct hash_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>
Diffstat (limited to 'core/crypto')
-rw-r--r-- | core/crypto/crypto.c | 32 | ||||
-rw-r--r-- | core/crypto/sub.mk | 1 |
2 files changed, 33 insertions, 0 deletions
diff --git a/core/crypto/crypto.c b/core/crypto/crypto.c new file mode 100644 index 00000000..91b325b3 --- /dev/null +++ b/core/crypto/crypto.c @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include <compiler.h> +#include <tee/tee_cryp_provider.h> + +#if !defined(_CFG_CRYPTO_WITH_HASH) +TEE_Result crypto_hash_get_ctx_size(uint32_t algo __unused, + size_t *size __unused) +{ + return TEE_ERROR_NOT_IMPLEMENTED; +} + +TEE_Result crypto_hash_init(void *ctx __unused, uint32_t algo __unused) +{ + return TEE_ERROR_NOT_IMPLEMENTED; +} +TEE_Result crypto_hash_update(void *ctx __unused, uint32_t algo __unused, + const uint8_t *data __unused, size_t len __unused) +{ + return TEE_ERROR_NOT_IMPLEMENTED; +} +TEE_Result crypto_hash_final(void *ctx __unused, uint32_t algo __unused, + uint8_t *digest __unused, size_t len __unused) +{ + return TEE_ERROR_NOT_IMPLEMENTED; +} +#endif /*_CFG_CRYPTO_WITH_HASH*/ diff --git a/core/crypto/sub.mk b/core/crypto/sub.mk new file mode 100644 index 00000000..7f72ebd0 --- /dev/null +++ b/core/crypto/sub.mk @@ -0,0 +1 @@ +srcs-y += crypto.c |