Lines Matching refs:ctx

14 	struct crypto_hash_ctx ctx;  member
18 static struct shake_ctx *to_shake_ctx(struct crypto_hash_ctx *ctx) in to_shake_ctx() argument
20 return container_of(ctx, struct shake_ctx, ctx); in to_shake_ctx()
23 static TEE_Result do_shake_init(struct crypto_hash_ctx *ctx, unsigned int num) in do_shake_init() argument
25 struct shake_ctx *c = to_shake_ctx(ctx); in do_shake_init()
33 static TEE_Result do_sha3_update(struct crypto_hash_ctx *ctx, in do_sha3_update() argument
36 struct shake_ctx *c = to_shake_ctx(ctx); in do_sha3_update()
44 static TEE_Result do_shake_final(struct crypto_hash_ctx *ctx, in do_shake_final() argument
47 struct shake_ctx *c = to_shake_ctx(ctx); in do_shake_final()
58 struct shake_ctx *ctx = calloc(1, sizeof(*ctx)); in do_shake_alloc_ctx() local
60 if (!ctx) in do_shake_alloc_ctx()
63 ctx->ctx.ops = ops; in do_shake_alloc_ctx()
64 *ctx_ret = &ctx->ctx; in do_shake_alloc_ctx()
69 static void do_sha3_free_ctx(struct crypto_hash_ctx *ctx) in do_sha3_free_ctx() argument
71 struct shake_ctx *c = to_shake_ctx(ctx); in do_sha3_free_ctx()
81 assert(sc->ctx.ops == dc->ctx.ops); in do_sha3_copy_state()
86 static TEE_Result do_shake128_init(struct crypto_hash_ctx *ctx) in do_shake128_init() argument
88 return do_shake_init(ctx, 128); in do_shake128_init()
99 TEE_Result crypto_shake128_alloc_ctx(struct crypto_hash_ctx **ctx) in crypto_shake128_alloc_ctx() argument
101 return do_shake_alloc_ctx(ctx, &shake128_ops); in crypto_shake128_alloc_ctx()
106 static TEE_Result do_shake256_init(struct crypto_hash_ctx *ctx) in do_shake256_init() argument
108 return do_shake_init(ctx, 256); in do_shake256_init()
119 TEE_Result crypto_shake256_alloc_ctx(struct crypto_hash_ctx **ctx) in crypto_shake256_alloc_ctx() argument
121 return do_shake_alloc_ctx(ctx, &shake256_ops); in crypto_shake256_alloc_ctx()