Lines Matching refs:ctx

21 	struct crypto_hash_ctx ctx;  member
28 static struct ltc_hash_ctx *to_hash_ctx(struct crypto_hash_ctx *ctx) in to_hash_ctx() argument
30 assert(ctx && ctx->ops == &ltc_hash_ops); in to_hash_ctx()
32 return container_of(ctx, struct ltc_hash_ctx, ctx); in to_hash_ctx()
35 static TEE_Result ltc_hash_init(struct crypto_hash_ctx *ctx) in ltc_hash_init() argument
37 struct ltc_hash_ctx *hc = to_hash_ctx(ctx); in ltc_hash_init()
45 static TEE_Result ltc_hash_update(struct crypto_hash_ctx *ctx, in ltc_hash_update() argument
48 struct ltc_hash_ctx *hc = to_hash_ctx(ctx); in ltc_hash_update()
56 static TEE_Result ltc_hash_final(struct crypto_hash_ctx *ctx, uint8_t *digest, in ltc_hash_final() argument
59 struct ltc_hash_ctx *hc = to_hash_ctx(ctx); in ltc_hash_final()
85 static void ltc_hash_free_ctx(struct crypto_hash_ctx *ctx) in ltc_hash_free_ctx() argument
87 free(to_hash_ctx(ctx)); in ltc_hash_free_ctx()
111 struct ltc_hash_ctx *ctx = NULL; in ltc_hash_alloc_ctx() local
116 ctx = calloc(1, sizeof(*ctx)); in ltc_hash_alloc_ctx()
117 if (!ctx) in ltc_hash_alloc_ctx()
120 ctx->ctx.ops = &ltc_hash_ops; in ltc_hash_alloc_ctx()
121 ctx->descr = hash_descriptor[ltc_hash_idx]; in ltc_hash_alloc_ctx()
123 *ctx_ret = &ctx->ctx; in ltc_hash_alloc_ctx()
129 TEE_Result crypto_md5_alloc_ctx(struct crypto_hash_ctx **ctx) in crypto_md5_alloc_ctx() argument
131 return ltc_hash_alloc_ctx(ctx, find_hash("md5")); in crypto_md5_alloc_ctx()
136 TEE_Result crypto_sha1_alloc_ctx(struct crypto_hash_ctx **ctx) in crypto_sha1_alloc_ctx() argument
138 return ltc_hash_alloc_ctx(ctx, find_hash("sha1")); in crypto_sha1_alloc_ctx()
143 TEE_Result crypto_sha224_alloc_ctx(struct crypto_hash_ctx **ctx) in crypto_sha224_alloc_ctx() argument
145 return ltc_hash_alloc_ctx(ctx, find_hash("sha224")); in crypto_sha224_alloc_ctx()
150 TEE_Result crypto_sha256_alloc_ctx(struct crypto_hash_ctx **ctx) in crypto_sha256_alloc_ctx() argument
152 return ltc_hash_alloc_ctx(ctx, find_hash("sha256")); in crypto_sha256_alloc_ctx()
157 TEE_Result crypto_sha384_alloc_ctx(struct crypto_hash_ctx **ctx) in crypto_sha384_alloc_ctx() argument
159 return ltc_hash_alloc_ctx(ctx, find_hash("sha384")); in crypto_sha384_alloc_ctx()
164 TEE_Result crypto_sha512_alloc_ctx(struct crypto_hash_ctx **ctx) in crypto_sha512_alloc_ctx() argument
166 return ltc_hash_alloc_ctx(ctx, find_hash("sha512")); in crypto_sha512_alloc_ctx()