| /OK3568_Linux_fs/kernel/drivers/crypto/allwinner/sun8i-ce/ |
| H A D | sun8i-ce-hash.c | 25 struct sun8i_ce_alg_template *algt; in sun8i_ce_hash_crainit() local 30 algt = container_of(alg, struct sun8i_ce_alg_template, alg.hash); in sun8i_ce_hash_crainit() 31 op->ce = algt->ce; in sun8i_ce_hash_crainit() 41 dev_err(algt->ce->dev, "Fallback driver could no be loaded\n"); in sun8i_ce_hash_crainit() 45 if (algt->alg.hash.halg.statesize < crypto_ahash_statesize(op->fallback_tfm)) in sun8i_ce_hash_crainit() 46 algt->alg.hash.halg.statesize = crypto_ahash_statesize(op->fallback_tfm); in sun8i_ce_hash_crainit() 118 struct sun8i_ce_alg_template *algt; in sun8i_ce_hash_final() local 127 algt = container_of(alg, struct sun8i_ce_alg_template, alg.hash); in sun8i_ce_hash_final() 128 algt->stat_fb++; in sun8i_ce_hash_final() 156 struct sun8i_ce_alg_template *algt; in sun8i_ce_hash_finup() local [all …]
|
| H A D | sun8i-ce-prng.c | 62 struct sun8i_ce_alg_template *algt; in sun8i_ce_prng_generate() local 73 algt = container_of(alg, struct sun8i_ce_alg_template, alg.rng); in sun8i_ce_prng_generate() 74 ce = algt->ce; in sun8i_ce_prng_generate() 95 algt->stat_req++; in sun8i_ce_prng_generate() 96 algt->stat_bytes += todo; in sun8i_ce_prng_generate()
|
| H A D | sun8i-ce-cipher.c | 61 struct sun8i_ce_alg_template *algt; in sun8i_ce_cipher_fallback() local 63 algt = container_of(alg, struct sun8i_ce_alg_template, alg.skcipher); in sun8i_ce_cipher_fallback() 64 algt->stat_fb++; in sun8i_ce_cipher_fallback() 87 struct sun8i_ce_alg_template *algt; in sun8i_ce_cipher_prepare() local 98 algt = container_of(alg, struct sun8i_ce_alg_template, alg.skcipher); in sun8i_ce_cipher_prepare() 107 algt->stat_req++; in sun8i_ce_cipher_prepare() 118 common = ce->variant->alg_cipher[algt->ce_algo_id]; in sun8i_ce_cipher_prepare() 127 sym = ce->variant->op_mode[algt->ce_blockmode]; in sun8i_ce_cipher_prepare() 377 struct sun8i_ce_alg_template *algt; in sun8i_ce_cipher_init() local 385 algt = container_of(alg, struct sun8i_ce_alg_template, alg.skcipher); in sun8i_ce_cipher_init() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/crypto/allwinner/sun8i-ss/ |
| H A D | sun8i-ss-hash.c | 25 struct sun8i_ss_alg_template *algt; in sun8i_ss_hash_crainit() local 30 algt = container_of(alg, struct sun8i_ss_alg_template, alg.hash); in sun8i_ss_hash_crainit() 31 op->ss = algt->ss; in sun8i_ss_hash_crainit() 41 dev_err(algt->ss->dev, "Fallback driver could no be loaded\n"); in sun8i_ss_hash_crainit() 45 if (algt->alg.hash.halg.statesize < crypto_ahash_statesize(op->fallback_tfm)) in sun8i_ss_hash_crainit() 46 algt->alg.hash.halg.statesize = crypto_ahash_statesize(op->fallback_tfm); in sun8i_ss_hash_crainit() 118 struct sun8i_ss_alg_template *algt; in sun8i_ss_hash_final() local 127 algt = container_of(alg, struct sun8i_ss_alg_template, alg.hash); in sun8i_ss_hash_final() 128 algt->stat_fb++; in sun8i_ss_hash_final() 156 struct sun8i_ss_alg_template *algt; in sun8i_ss_hash_finup() local [all …]
|
| H A D | sun8i-ss-prng.c | 62 struct sun8i_ss_alg_template *algt; in sun8i_ss_prng_generate() local 71 algt = container_of(alg, struct sun8i_ss_alg_template, alg.rng); in sun8i_ss_prng_generate() 72 ss = algt->ss; in sun8i_ss_prng_generate() 93 algt->stat_req++; in sun8i_ss_prng_generate() 94 algt->stat_bytes += todo; in sun8i_ss_prng_generate()
|
| H A D | sun8i-ss-cipher.c | 79 struct sun8i_ss_alg_template *algt; in sun8i_ss_cipher_fallback() local 81 algt = container_of(alg, struct sun8i_ss_alg_template, alg.skcipher); in sun8i_ss_cipher_fallback() 82 algt->stat_fb++; in sun8i_ss_cipher_fallback() 166 struct sun8i_ss_alg_template *algt; in sun8i_ss_cipher() local 175 algt = container_of(alg, struct sun8i_ss_alg_template, alg.skcipher); in sun8i_ss_cipher() 184 algt->stat_req++; in sun8i_ss_cipher() 187 rctx->op_mode = ss->variant->op_mode[algt->ss_blockmode]; in sun8i_ss_cipher() 188 rctx->method = ss->variant->alg_cipher[algt->ss_algo_id]; in sun8i_ss_cipher() 367 struct sun8i_ss_alg_template *algt; in sun8i_ss_cipher_init() local 375 algt = container_of(alg, struct sun8i_ss_alg_template, alg.skcipher); in sun8i_ss_cipher_init() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/crypto/rockchip/ |
| H A D | rk_crypto_v2_skcipher.c | 154 static bool is_force_fallback(struct rk_crypto_algt *algt, uint32_t key_len) in is_force_fallback() argument 156 if (algt->algo != CIPHER_ALGO_AES) in is_force_fallback() 160 if (algt->mode == CIPHER_MODE_XTS && key_len == AES_KEYSIZE_192 * 2) in is_force_fallback() 163 if (algt->use_soft_aes192 && key_len == AES_KEYSIZE_192) in is_force_fallback() 172 struct rk_crypto_algt *algt = rk_cipher_get_algt(cipher); in is_calc_need_round_up() local 174 return (algt->mode == CIPHER_MODE_CFB || in is_calc_need_round_up() 175 algt->mode == CIPHER_MODE_OFB || in is_calc_need_round_up() 176 algt->mode == CIPHER_MODE_CTR) ? true : false; in is_calc_need_round_up() 233 struct rk_crypto_algt *algt = rk_cipher_get_algt(tfm); in rk_cipher_crypt() local 239 if (algt->mode == CIPHER_MODE_ECB || in rk_cipher_crypt() [all …]
|
| H A D | rk_crypto_v3_skcipher.c | 153 static bool is_force_fallback(struct rk_crypto_algt *algt, uint32_t key_len) in is_force_fallback() argument 155 if (algt->algo != CIPHER_ALGO_AES) in is_force_fallback() 159 if (algt->mode == CIPHER_MODE_XTS && key_len == AES_KEYSIZE_192 * 2) in is_force_fallback() 162 if (algt->use_soft_aes192 && key_len == AES_KEYSIZE_192) in is_force_fallback() 171 struct rk_crypto_algt *algt = rk_cipher_get_algt(cipher); in is_calc_need_round_up() local 173 return (algt->mode == CIPHER_MODE_CFB || in is_calc_need_round_up() 174 algt->mode == CIPHER_MODE_OFB || in is_calc_need_round_up() 175 algt->mode == CIPHER_MODE_CTR) ? true : false; in is_calc_need_round_up() 232 struct rk_crypto_algt *algt = rk_cipher_get_algt(tfm); in rk_cipher_crypt() local 238 if (algt->mode == CIPHER_MODE_ECB || in rk_cipher_crypt() [all …]
|
| H A D | rk_crypto_skcipher_utils.c | 157 struct rk_crypto_algt *algt = rk_cipher_get_algt(cipher); in rk_iv_copyback() local 159 iv_size = rk_get_new_iv(ctx, algt->mode, ctx->is_enc, ctx->iv); in rk_iv_copyback() 172 struct rk_crypto_algt *algt = rk_cipher_get_algt(cipher); in rk_update_iv() local 174 iv_size = rk_get_new_iv(ctx, algt->mode, ctx->is_enc, ctx->iv); in rk_update_iv() 208 struct rk_crypto_algt *algt = rk_cipher_get_algt(cipher); in rk_cipher_setkey() local 214 algt->algo, algt->mode, keylen); in rk_cipher_setkey() 217 key_factor = algt->mode == CIPHER_MODE_XTS ? 2 : 1; in rk_cipher_setkey() 219 switch (algt->algo) { in rk_cipher_setkey() 332 struct rk_crypto_algt *algt = rk_cipher_get_algt(tfm); in rk_ablk_start() local 347 alg_ctx->ops.hw_init(rk_dev, algt->algo, algt->mode); in rk_ablk_start() [all …]
|
| H A D | rk_crypto_v1_skcipher.c | 100 struct rk_crypto_algt *algt; in rk_cipher_setkey() local 103 algt = container_of(alg, struct rk_crypto_algt, alg.crypto); in rk_cipher_setkey() 106 algt->algo, algt->mode, keylen); in rk_cipher_setkey() 108 switch (algt->algo) { in rk_cipher_setkey() 149 struct rk_crypto_algt *algt; in rk_cipher_encrypt() local 152 algt = container_of(alg, struct rk_crypto_algt, alg.crypto); in rk_cipher_encrypt() 154 ret = rk_get_bc(algt->algo, algt->mode, &ctx->mode); in rk_cipher_encrypt() 169 struct rk_crypto_algt *algt; in rk_cipher_decrypt() local 172 algt = container_of(alg, struct rk_crypto_algt, alg.crypto); in rk_cipher_decrypt() 174 ret = rk_get_bc(algt->algo, algt->mode, &ctx->mode); in rk_cipher_decrypt() [all …]
|
| H A D | rk_crypto_ahash_utils.c | 146 struct rk_crypto_algt *algt = rk_ahash_get_algt(tfm); in rk_ahash_get_zero_result() local 150 algt->type == ALG_TYPE_HMAC, in rk_ahash_get_zero_result() 158 struct rk_crypto_algt *algt = rk_ahash_get_algt(tfm); in rk_ahash_hmac_setkey() local 165 if (algt->algo >= ARRAY_SIZE(hash_algo2name)) { in rk_ahash_hmac_setkey() 166 CRYPTO_MSG("hash algo %d invalid\n", algt->algo); in rk_ahash_hmac_setkey() 178 alg_name = hash_algo2name[algt->algo]; in rk_ahash_hmac_setkey() 287 struct rk_crypto_algt *algt = rk_ahash_get_algt(tfm); in rk_ahash_start() local 381 alg_ctx->ops.hw_init(rk_dev, algt->algo, algt->type); in rk_ahash_start()
|
| H A D | rk_crypto_v1_ahash.c | 328 struct rk_crypto_algt *algt; in rk_cra_hash_init() local 334 algt = container_of(alg, struct rk_crypto_algt, alg.hash); in rk_cra_hash_init() 335 rk_dev = algt->rk_dev; in rk_cra_hash_init() 364 algt->alg.hash.halg.statesize = crypto_ahash_statesize(ctx->fallback_tfm); in rk_cra_hash_init()
|
| H A D | rk_crypto_v2_akcipher.c | 260 struct rk_crypto_algt *algt; in rk_rsa_init_tfm() local 268 algt = container_of(alg, struct rk_crypto_algt, alg.asym); in rk_rsa_init_tfm() 269 rk_dev = algt->rk_dev; in rk_rsa_init_tfm()
|
| H A D | rk_crypto_v2_ahash.c | 308 struct rk_crypto_algt *algt = in rk_cra_hash_init() local 312 struct rk_crypto_dev *rk_dev = algt->rk_dev; in rk_cra_hash_init() 345 algt->alg.hash.halg.statesize = sizeof(struct rk_ahash_expt_ctx); in rk_cra_hash_init()
|
| H A D | rk3288_crypto_ahash.c | 276 struct rk_crypto_tmp *algt; in rk_cra_hash_init() local 281 algt = container_of(alg, struct rk_crypto_tmp, alg.hash); in rk_cra_hash_init() 283 tctx->dev = algt->dev; in rk_cra_hash_init()
|
| /OK3568_Linux_fs/kernel/drivers/crypto/allwinner/sun4i-ss/ |
| H A D | sun4i-ss-prng.c | 6 struct sun4i_ss_alg_template *algt; in sun4i_ss_prng_seed() local 9 algt = container_of(alg, struct sun4i_ss_alg_template, alg.rng); in sun4i_ss_prng_seed() 10 memcpy(algt->ss->seed, seed, slen); in sun4i_ss_prng_seed() 18 struct sun4i_ss_alg_template *algt; in sun4i_ss_prng_generate() local 28 algt = container_of(alg, struct sun4i_ss_alg_template, alg.rng); in sun4i_ss_prng_generate() 29 ss = algt->ss; in sun4i_ss_prng_generate()
|
| H A D | sun4i-ss-hash.c | 22 struct sun4i_ss_alg_template *algt; in sun4i_hash_crainit() local 27 algt = container_of(alg, struct sun4i_ss_alg_template, alg.hash); in sun4i_hash_crainit() 28 op->ss = algt->ss; in sun4i_hash_crainit() 52 struct sun4i_ss_alg_template *algt; in sun4i_hash_init() local 56 algt = container_of(alg, struct sun4i_ss_alg_template, alg.hash); in sun4i_hash_init() 57 op->mode = algt->mode; in sun4i_hash_init()
|
| H A D | sun4i-ss-cipher.c | 176 struct sun4i_ss_alg_template *algt; in sun4i_ss_cipher_poll() local 207 algt = container_of(alg, struct sun4i_ss_alg_template, alg.crypto); in sun4i_ss_cipher_poll() 208 if (areq->cryptlen % algt->alg.crypto.base.cra_blocksize) in sun4i_ss_cipher_poll() 524 struct sun4i_ss_alg_template *algt; in sun4i_ss_cipher_init() local 530 algt = container_of(tfm->__crt_alg, struct sun4i_ss_alg_template, in sun4i_ss_cipher_init() 532 op->ss = algt->ss; in sun4i_ss_cipher_init()
|
| /OK3568_Linux_fs/kernel/crypto/ |
| H A D | pcrypt.c | 233 struct crypto_attr_type *algt) in pcrypt_create_aead() argument 238 u32 mask = crypto_algt_inherited_mask(algt); in pcrypt_create_aead() 293 struct crypto_attr_type *algt; in pcrypt_create() local 295 algt = crypto_get_attr_type(tb); in pcrypt_create() 296 if (IS_ERR(algt)) in pcrypt_create() 297 return PTR_ERR(algt); in pcrypt_create() 299 switch (algt->type & algt->mask & CRYPTO_ALG_TYPE_MASK) { in pcrypt_create() 301 return pcrypt_create_aead(tmpl, tb, algt); in pcrypt_create()
|
| H A D | cryptd.c | 193 static void cryptd_type_and_mask(struct crypto_attr_type *algt, in cryptd_type_and_mask() argument 200 *type = algt->type & CRYPTO_ALG_INTERNAL; in cryptd_type_and_mask() 201 *mask = algt->mask & CRYPTO_ALG_INTERNAL; in cryptd_type_and_mask() 206 *mask |= crypto_algt_inherited_mask(algt); in cryptd_type_and_mask() 369 struct crypto_attr_type *algt, in cryptd_create_skcipher() argument 379 cryptd_type_and_mask(algt, &type, &mask); in cryptd_create_skcipher() 635 struct crypto_attr_type *algt, in cryptd_create_hash() argument 645 cryptd_type_and_mask(algt, &type, &mask); in cryptd_create_hash() 822 struct crypto_attr_type *algt, in cryptd_create_aead() argument 832 cryptd_type_and_mask(algt, &type, &mask); in cryptd_create_aead() [all …]
|
| H A D | essiv.c | 440 struct crypto_attr_type *algt; in essiv_create() local 457 algt = crypto_get_attr_type(tb); in essiv_create() 458 if (IS_ERR(algt)) in essiv_create() 459 return PTR_ERR(algt); in essiv_create() 469 type = algt->type & algt->mask; in essiv_create() 470 mask = crypto_algt_inherited_mask(algt); in essiv_create()
|
| H A D | algapi.c | 806 struct crypto_attr_type *algt; in crypto_get_attr_type() local 810 if (RTA_PAYLOAD(rta) < sizeof(*algt)) in crypto_get_attr_type() 815 algt = RTA_DATA(rta); in crypto_get_attr_type() 817 return algt; in crypto_get_attr_type() 839 struct crypto_attr_type *algt; in crypto_check_attr_type() local 841 algt = crypto_get_attr_type(tb); in crypto_check_attr_type() 842 if (IS_ERR(algt)) in crypto_check_attr_type() 843 return PTR_ERR(algt); in crypto_check_attr_type() 845 if ((algt->type ^ type) & algt->mask) in crypto_check_attr_type() 848 *mask_ret = crypto_algt_inherited_mask(algt); in crypto_check_attr_type()
|
| /OK3568_Linux_fs/kernel/drivers/crypto/amlogic/ |
| H A D | amlogic-gxl-cipher.c | 66 struct meson_alg_template *algt; in meson_cipher_do_fallback() local 68 algt = container_of(alg, struct meson_alg_template, alg.skcipher); in meson_cipher_do_fallback() 69 algt->stat_fb++; in meson_cipher_do_fallback() 91 struct meson_alg_template *algt; in meson_cipher() local 104 algt = container_of(alg, struct meson_alg_template, alg.skcipher); in meson_cipher() 113 algt->stat_req++; in meson_cipher() 213 v = (op->keymode << 20) | DESC_OWN | todo | (algt->blockmode << 26); in meson_cipher() 314 struct meson_alg_template *algt; in meson_cipher_init() local 321 algt = container_of(alg, struct meson_alg_template, alg.skcipher); in meson_cipher_init() 322 op->mc = algt->mc; in meson_cipher_init()
|
| /OK3568_Linux_fs/kernel/include/crypto/ |
| H A D | algapi.h | 199 static inline u32 crypto_requires_off(struct crypto_attr_type *algt, u32 off) in crypto_requires_off() argument 201 return (algt->type ^ off) & algt->mask & off; in crypto_requires_off() 219 static inline u32 crypto_algt_inherited_mask(struct crypto_attr_type *algt) in crypto_algt_inherited_mask() argument 221 return crypto_requires_off(algt, CRYPTO_ALG_INHERITED_FLAGS); in crypto_algt_inherited_mask()
|
| /OK3568_Linux_fs/kernel/drivers/crypto/ |
| H A D | talitos.c | 3043 struct talitos_alg_template algt; member 3060 ctx->desc_hdr_template = talitos_alg->algt.desc_hdr_template; in talitos_init_common() 3075 algt.alg.aead); in talitos_cra_init_aead() 3087 algt.alg.skcipher); in talitos_cra_init_skcipher() 3100 algt.alg.hash); in talitos_cra_init_ahash() 3146 switch (t_alg->algt.type) { in talitos_remove() 3148 crypto_unregister_skcipher(&t_alg->algt.alg.skcipher); in talitos_remove() 3151 crypto_unregister_aead(&t_alg->algt.alg.aead); in talitos_remove() 3154 crypto_unregister_ahash(&t_alg->algt.alg.hash); in talitos_remove() 3189 t_alg->algt = *template; in talitos_alg_alloc() [all …]
|