Lines Matching refs:alg
84 struct crypto_alg *alg)
86 return container_of(alg, struct skcipher_alg, base);
90 struct skcipher_alg *alg)
93 return &alg->stat;
99 static inline int crypto_skcipher_errstat(struct skcipher_alg *alg, int err)
101 struct crypto_istat_cipher *istat = skcipher_get_stat(alg);
640 struct skcipher_alg *alg = crypto_skcipher_alg(tfm);
644 struct crypto_istat_cipher *istat = skcipher_get_stat(alg);
653 ret = alg->encrypt(req);
655 return crypto_skcipher_errstat(alg, ret);
662 struct skcipher_alg *alg = crypto_skcipher_alg(tfm);
666 struct crypto_istat_cipher *istat = skcipher_get_stat(alg);
675 ret = alg->decrypt(req);
677 return crypto_skcipher_errstat(alg, ret);
684 struct skcipher_alg *alg = crypto_skcipher_alg(skcipher);
686 alg->exit(skcipher);
692 struct skcipher_alg *alg = crypto_skcipher_alg(skcipher);
696 if (alg->exit)
699 if (alg->init)
700 return alg->init(skcipher);
713 static void crypto_skcipher_show(struct seq_file *m, struct crypto_alg *alg)
715 static void crypto_skcipher_show(struct seq_file *m, struct crypto_alg *alg)
717 struct skcipher_alg *skcipher = __crypto_skcipher_alg(alg);
721 alg->cra_flags & CRYPTO_ALG_ASYNC ? "yes" : "no");
722 seq_printf(m, "blocksize : %u\n", alg->cra_blocksize);
731 struct sk_buff *skb, struct crypto_alg *alg)
733 struct skcipher_alg *skcipher = __crypto_skcipher_alg(alg);
741 rblkcipher.blocksize = alg->cra_blocksize;
751 struct sk_buff *skb, struct crypto_alg *alg)
753 struct skcipher_alg *skcipher = __crypto_skcipher_alg(alg);
837 static int skcipher_prepare_alg(struct skcipher_alg *alg)
839 struct crypto_istat_cipher *istat = skcipher_get_stat(alg);
840 struct crypto_alg *base = &alg->base;
842 if (alg->ivsize > PAGE_SIZE / 8 || alg->chunksize > PAGE_SIZE / 8 ||
843 alg->walksize > PAGE_SIZE / 8)
846 if (!alg->chunksize)
847 alg->chunksize = base->cra_blocksize;
848 if (!alg->walksize)
849 alg->walksize = alg->chunksize;
861 int crypto_register_skcipher(struct skcipher_alg *alg)
863 struct crypto_alg *base = &alg->base;
866 err = skcipher_prepare_alg(alg);
874 void crypto_unregister_skcipher(struct skcipher_alg *alg)
876 crypto_unregister_alg(&alg->base);
917 err = skcipher_prepare_alg(&inst->alg);
1012 inst->alg.base.cra_blocksize = cipher_alg->cra_blocksize;
1013 inst->alg.base.cra_alignmask = cipher_alg->cra_alignmask;
1014 inst->alg.base.cra_priority = cipher_alg->cra_priority;
1015 inst->alg.min_keysize = cipher_alg->cra_cipher.cia_min_keysize;
1016 inst->alg.max_keysize = cipher_alg->cra_cipher.cia_max_keysize;
1017 inst->alg.ivsize = cipher_alg->cra_blocksize;
1020 inst->alg.base.cra_ctxsize = sizeof(struct skcipher_ctx_simple);
1021 inst->alg.setkey = skcipher_setkey_simple;
1022 inst->alg.init = skcipher_init_tfm_simple;
1023 inst->alg.exit = skcipher_exit_tfm_simple;