Lines Matching full:c

3  * Copyright (C) 2018, ARM Limited
4 * Copyright (C) 2019, Linaro Limited
5 * Copyright (C) 2021, SumUp Services GmbH
39 struct mbed_cmac_ctx *c = to_cmac_ctx(ctx); in mbed_cmac_init() local
42 cipher_info = mbedtls_cipher_info_from_values(c->cipher_id, in mbed_cmac_init()
48 if (mbedtls_cipher_setup_info(&c->cipher_ctx, cipher_info)) in mbed_cmac_init()
51 if (mbedtls_cipher_cmac_reset(&c->cipher_ctx)) in mbed_cmac_init()
54 if (mbedtls_cipher_cmac_starts(&c->cipher_ctx, key, len * 8)) in mbed_cmac_init()
63 struct mbed_cmac_ctx *c = to_cmac_ctx(ctx); in mbed_cmac_update() local
65 if (mbedtls_cipher_cmac_update(&c->cipher_ctx, data, len)) in mbed_cmac_update()
74 struct mbed_cmac_ctx *c = to_cmac_ctx(ctx); in mbed_cmac_final() local
84 if (c->cipher_id == MBEDTLS_CIPHER_ID_3DES) in mbed_cmac_final()
92 if (mbedtls_cipher_cmac_finish(&c->cipher_ctx, tmp_digest)) in mbed_cmac_final()
103 struct mbed_cmac_ctx *c = to_cmac_ctx(ctx); in mbed_cmac_free_ctx() local
105 mbedtls_cipher_free(&c->cipher_ctx); in mbed_cmac_free_ctx()
106 free(c); in mbed_cmac_free_ctx()
132 struct mbed_cmac_ctx *c = NULL; in crypto_cmac_alloc_ctx() local
148 c = calloc(1, sizeof(*c)); in crypto_cmac_alloc_ctx()
149 if (!c) in crypto_cmac_alloc_ctx()
152 c->cipher_id = cipher_id; in crypto_cmac_alloc_ctx()
153 c->mac_ctx.ops = &mbed_cmac_ops; in crypto_cmac_alloc_ctx()
155 mbedtls_cipher_init(&c->cipher_ctx); in crypto_cmac_alloc_ctx()
156 mbed_res = mbedtls_cipher_setup(&c->cipher_ctx, cipher_info); in crypto_cmac_alloc_ctx()
158 free(c); in crypto_cmac_alloc_ctx()
163 mbed_res = mbedtls_cipher_cmac_setup(&c->cipher_ctx); in crypto_cmac_alloc_ctx()
165 free(c); in crypto_cmac_alloc_ctx()
169 *ctx_ret = &c->mac_ctx; in crypto_cmac_alloc_ctx()