Lines Matching full:c
3 * Copyright (c) 2014-2019, Linaro Limited
42 struct ltc_xts_ctx *c = to_xts_ctx(ctx); in ltc_xts_init() local
47 if (iv_len != sizeof(c->tweak)) in ltc_xts_init()
49 memcpy(c->tweak, iv, sizeof(c->tweak)); in ltc_xts_init()
51 memset(c->tweak, 0, sizeof(c->tweak)); in ltc_xts_init()
54 if ((int)iv_len != cipher_descriptor[c->cipher_idx]->block_length) in ltc_xts_init()
58 c->update = xts_encrypt; in ltc_xts_init()
60 c->update = xts_decrypt; in ltc_xts_init()
63 if (xts_start(c->cipher_idx, key1, key2, key1_len, 0, in ltc_xts_init()
64 &c->state) == CRYPT_OK) in ltc_xts_init()
74 struct ltc_xts_ctx *c = to_xts_ctx(ctx); in ltc_xts_update() local
76 if (c->update && c->update(data, len, dst, c->tweak, in ltc_xts_update()
77 &c->state) == CRYPT_OK) in ltc_xts_update()
115 struct ltc_xts_ctx *c = NULL; in crypto_aes_xts_alloc_ctx() local
121 c = calloc(1, sizeof(*c)); in crypto_aes_xts_alloc_ctx()
122 if (!c) in crypto_aes_xts_alloc_ctx()
125 c->ctx.ops = <c_xts_ops; in crypto_aes_xts_alloc_ctx()
126 c->cipher_idx = cipher_idx; in crypto_aes_xts_alloc_ctx()
127 *ctx_ret = &c->ctx; in crypto_aes_xts_alloc_ctx()