Lines Matching refs:alg
191 struct crypto_alg *alg; in xcbc_create() local
199 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, in xcbc_create()
201 if (IS_ERR(alg)) in xcbc_create()
202 return PTR_ERR(alg); in xcbc_create()
204 switch(alg->cra_blocksize) { in xcbc_create()
211 inst = shash_alloc_instance("xcbc", alg); in xcbc_create()
216 err = crypto_init_spawn(shash_instance_ctx(inst), alg, in xcbc_create()
222 alignmask = alg->cra_alignmask | 3; in xcbc_create()
223 inst->alg.base.cra_alignmask = alignmask; in xcbc_create()
224 inst->alg.base.cra_priority = alg->cra_priority; in xcbc_create()
225 inst->alg.base.cra_blocksize = alg->cra_blocksize; in xcbc_create()
227 inst->alg.digestsize = alg->cra_blocksize; in xcbc_create()
228 inst->alg.descsize = ALIGN(sizeof(struct xcbc_desc_ctx), in xcbc_create()
232 alg->cra_blocksize * 2; in xcbc_create()
234 inst->alg.base.cra_ctxsize = ALIGN(sizeof(struct xcbc_tfm_ctx), in xcbc_create()
236 alg->cra_blocksize * 2; in xcbc_create()
237 inst->alg.base.cra_init = xcbc_init_tfm; in xcbc_create()
238 inst->alg.base.cra_exit = xcbc_exit_tfm; in xcbc_create()
240 inst->alg.init = crypto_xcbc_digest_init; in xcbc_create()
241 inst->alg.update = crypto_xcbc_digest_update; in xcbc_create()
242 inst->alg.final = crypto_xcbc_digest_final; in xcbc_create()
243 inst->alg.setkey = crypto_xcbc_digest_setkey; in xcbc_create()
252 crypto_mod_put(alg); in xcbc_create()