Lines Matching refs:alg
241 struct crypto_alg *alg; in alloc() local
248 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, in alloc()
250 if (IS_ERR(alg)) in alloc()
251 return ERR_CAST(alg); in alloc()
253 inst = crypto_alloc_instance("lrw", alg); in alloc()
257 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in alloc()
258 inst->alg.cra_priority = alg->cra_priority; in alloc()
259 inst->alg.cra_blocksize = alg->cra_blocksize; in alloc()
261 if (alg->cra_alignmask < 7) inst->alg.cra_alignmask = 7; in alloc()
262 else inst->alg.cra_alignmask = alg->cra_alignmask; in alloc()
263 inst->alg.cra_type = &crypto_blkcipher_type; in alloc()
265 if (!(alg->cra_blocksize % 4)) in alloc()
266 inst->alg.cra_alignmask |= 3; in alloc()
267 inst->alg.cra_blkcipher.ivsize = alg->cra_blocksize; in alloc()
268 inst->alg.cra_blkcipher.min_keysize = in alloc()
269 alg->cra_cipher.cia_min_keysize + alg->cra_blocksize; in alloc()
270 inst->alg.cra_blkcipher.max_keysize = in alloc()
271 alg->cra_cipher.cia_max_keysize + alg->cra_blocksize; in alloc()
273 inst->alg.cra_ctxsize = sizeof(struct priv); in alloc()
275 inst->alg.cra_init = init_tfm; in alloc()
276 inst->alg.cra_exit = exit_tfm; in alloc()
278 inst->alg.cra_blkcipher.setkey = setkey; in alloc()
279 inst->alg.cra_blkcipher.encrypt = encrypt; in alloc()
280 inst->alg.cra_blkcipher.decrypt = decrypt; in alloc()
283 crypto_mod_put(alg); in alloc()