Skip to content

Commit

Permalink
core: remove struct crypto_ops
Browse files Browse the repository at this point in the history
Removes struct crypto_ops and adds crypto_init()

Acked-by: Jerome Forissier <[email protected]>
Signed-off-by: Jens Wiklander <[email protected]>
  • Loading branch information
jenswi-linaro committed Nov 10, 2017
1 parent 58a9d20 commit 070c65f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
11 changes: 1 addition & 10 deletions core/include/tee/tee_cryp_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,7 @@
#include <tee_api_types.h>


/* Cryptographic Provider API */
struct crypto_ops {
/* Human-readable provider name */
const char *name;

TEE_Result (*init)(void);
};

extern const struct crypto_ops crypto_ops;

TEE_Result crypto_init(void);

/* Message digest functions */
TEE_Result crypto_hash_get_ctx_size(uint32_t algo, size_t *size);
Expand Down
7 changes: 1 addition & 6 deletions core/lib/libtomcrypt/src/tee_ltc_provider.c
Original file line number Diff line number Diff line change
Expand Up @@ -2963,7 +2963,7 @@ TEE_Result crypto_rng_add_entropy(const uint8_t *inbuf, size_t len)
return TEE_SUCCESS;
}

static TEE_Result tee_ltc_init(void)
TEE_Result crypto_init(void)
{
#if defined(_CFG_CRYPTO_WITH_ACIPHER)
tee_ltc_alloc_mpa();
Expand All @@ -2973,11 +2973,6 @@ static TEE_Result tee_ltc_init(void)
return tee_ltc_prng_init(tee_ltc_get_prng());
}

const struct crypto_ops crypto_ops = {
.name = "LibTomCrypt provider",
.init = tee_ltc_init,
};

#if defined(CFG_WITH_VFP)
void tomcrypt_arm_neon_enable(struct tomcrypt_arm_neon_state *state)
{
Expand Down
5 changes: 1 addition & 4 deletions core/tee/tee_cryp_utl.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,7 @@ __weak void plat_prng_add_jitter_entropy_norpc(void)

static TEE_Result tee_cryp_init(void)
{
if (crypto_ops.init)
return crypto_ops.init();

return TEE_SUCCESS;
return crypto_init();
}

service_init(tee_cryp_init);

0 comments on commit 070c65f

Please sign in to comment.