Lines Matching refs:alg
121 struct crypto_alg *alg; in crypto_ecb_alloc() local
128 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, in crypto_ecb_alloc()
130 if (IS_ERR(alg)) in crypto_ecb_alloc()
131 return ERR_CAST(alg); in crypto_ecb_alloc()
133 inst = crypto_alloc_instance("ecb", alg); in crypto_ecb_alloc()
137 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in crypto_ecb_alloc()
138 inst->alg.cra_priority = alg->cra_priority; in crypto_ecb_alloc()
139 inst->alg.cra_blocksize = alg->cra_blocksize; in crypto_ecb_alloc()
140 inst->alg.cra_alignmask = alg->cra_alignmask; in crypto_ecb_alloc()
141 inst->alg.cra_type = &crypto_blkcipher_type; in crypto_ecb_alloc()
143 inst->alg.cra_blkcipher.min_keysize = alg->cra_cipher.cia_min_keysize; in crypto_ecb_alloc()
144 inst->alg.cra_blkcipher.max_keysize = alg->cra_cipher.cia_max_keysize; in crypto_ecb_alloc()
146 inst->alg.cra_ctxsize = sizeof(struct crypto_ecb_ctx); in crypto_ecb_alloc()
148 inst->alg.cra_init = crypto_ecb_init_tfm; in crypto_ecb_alloc()
149 inst->alg.cra_exit = crypto_ecb_exit_tfm; in crypto_ecb_alloc()
151 inst->alg.cra_blkcipher.setkey = crypto_ecb_setkey; in crypto_ecb_alloc()
152 inst->alg.cra_blkcipher.encrypt = crypto_ecb_encrypt; in crypto_ecb_alloc()
153 inst->alg.cra_blkcipher.decrypt = crypto_ecb_decrypt; in crypto_ecb_alloc()
156 crypto_mod_put(alg); in crypto_ecb_alloc()