Home
last modified time | relevance | path

Searched refs:alg (Results 1 – 25 of 145) sorted by relevance

123456

/linux-2.6.39/crypto/
Dapi.c37 static inline struct crypto_alg *crypto_alg_get(struct crypto_alg *alg) in crypto_alg_get() argument
39 atomic_inc(&alg->cra_refcnt); in crypto_alg_get()
40 return alg; in crypto_alg_get()
43 struct crypto_alg *crypto_mod_get(struct crypto_alg *alg) in crypto_mod_get() argument
45 return try_module_get(alg->cra_module) ? crypto_alg_get(alg) : NULL; in crypto_mod_get()
49 void crypto_mod_put(struct crypto_alg *alg) in crypto_mod_put() argument
51 struct module *module = alg->cra_module; in crypto_mod_put()
53 crypto_alg_put(alg); in crypto_mod_put()
60 return larval->alg.cra_driver_name[0]; in crypto_is_test_larval()
66 struct crypto_alg *q, *alg = NULL; in __crypto_alg_lookup() local
[all …]
Daead.c80 static unsigned int crypto_aead_ctxsize(struct crypto_alg *alg, u32 type, in crypto_aead_ctxsize() argument
83 return alg->cra_ctxsize; in crypto_aead_ctxsize()
93 struct aead_alg *alg = &tfm->__crt_alg->cra_aead; in crypto_init_aead_ops() local
96 if (max(alg->maxauthsize, alg->ivsize) > PAGE_SIZE / 8) in crypto_init_aead_ops()
100 alg->setkey : setkey; in crypto_init_aead_ops()
101 crt->encrypt = alg->encrypt; in crypto_init_aead_ops()
102 crt->decrypt = alg->decrypt; in crypto_init_aead_ops()
103 crt->givencrypt = alg->givencrypt ?: no_givcrypt; in crypto_init_aead_ops()
104 crt->givdecrypt = alg->givdecrypt ?: no_givcrypt; in crypto_init_aead_ops()
106 crt->ivsize = alg->ivsize; in crypto_init_aead_ops()
[all …]
Dalgapi.c31 struct crypto_alg *alg; in crypto_larval_error() local
33 alg = crypto_alg_lookup(name, type, mask); in crypto_larval_error()
35 if (alg) { in crypto_larval_error()
36 if (crypto_is_larval(alg)) { in crypto_larval_error()
37 struct crypto_larval *larval = (void *)alg; in crypto_larval_error()
40 crypto_mod_put(alg); in crypto_larval_error()
45 static inline int crypto_set_driver_name(struct crypto_alg *alg) in crypto_set_driver_name() argument
48 char *driver_name = alg->cra_driver_name; in crypto_set_driver_name()
54 len = strlcpy(driver_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in crypto_set_driver_name()
62 static int crypto_check_alg(struct crypto_alg *alg) in crypto_check_alg() argument
[all …]
Dctr.c178 struct crypto_alg *alg; in crypto_ctr_alloc() local
185 alg = crypto_attr_alg(tb[1], CRYPTO_ALG_TYPE_CIPHER, in crypto_ctr_alloc()
187 if (IS_ERR(alg)) in crypto_ctr_alloc()
188 return ERR_CAST(alg); in crypto_ctr_alloc()
192 if (alg->cra_blocksize < 4) in crypto_ctr_alloc()
196 if (alg->cra_blocksize % 4) in crypto_ctr_alloc()
199 inst = crypto_alloc_instance("ctr", alg); in crypto_ctr_alloc()
203 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in crypto_ctr_alloc()
204 inst->alg.cra_priority = alg->cra_priority; in crypto_ctr_alloc()
205 inst->alg.cra_blocksize = 1; in crypto_ctr_alloc()
[all …]
Dinternal.h43 struct crypto_alg alg; member
63 static inline unsigned int crypto_cipher_ctxsize(struct crypto_alg *alg) in crypto_cipher_ctxsize() argument
65 return alg->cra_ctxsize; in crypto_cipher_ctxsize()
68 static inline unsigned int crypto_compress_ctxsize(struct crypto_alg *alg) in crypto_compress_ctxsize() argument
70 return alg->cra_ctxsize; in crypto_compress_ctxsize()
73 struct crypto_alg *crypto_mod_get(struct crypto_alg *alg);
84 void crypto_larval_kill(struct crypto_alg *alg);
89 void crypto_shoot_alg(struct crypto_alg *alg);
90 struct crypto_tfm *__crypto_alloc_tfm(struct crypto_alg *alg, u32 type,
92 void *crypto_create_tfm(struct crypto_alg *alg,
[all …]
Dablkcipher.c346 static unsigned int crypto_ablkcipher_ctxsize(struct crypto_alg *alg, u32 type, in crypto_ablkcipher_ctxsize() argument
349 return alg->cra_ctxsize; in crypto_ablkcipher_ctxsize()
365 struct ablkcipher_alg *alg = &tfm->__crt_alg->cra_ablkcipher; in crypto_init_ablkcipher_ops() local
368 if (alg->ivsize > PAGE_SIZE / 8) in crypto_init_ablkcipher_ops()
372 crt->encrypt = alg->encrypt; in crypto_init_ablkcipher_ops()
373 crt->decrypt = alg->decrypt; in crypto_init_ablkcipher_ops()
374 if (!alg->ivsize) { in crypto_init_ablkcipher_ops()
379 crt->ivsize = alg->ivsize; in crypto_init_ablkcipher_ops()
384 static void crypto_ablkcipher_show(struct seq_file *m, struct crypto_alg *alg)
386 static void crypto_ablkcipher_show(struct seq_file *m, struct crypto_alg *alg) in crypto_ablkcipher_show() argument
[all …]
Decb.c121 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()
[all …]
Dproc.c81 struct crypto_alg *alg = list_entry(p, struct crypto_alg, cra_list); in c_show() local
83 seq_printf(m, "name : %s\n", alg->cra_name); in c_show()
84 seq_printf(m, "driver : %s\n", alg->cra_driver_name); in c_show()
85 seq_printf(m, "module : %s\n", module_name(alg->cra_module)); in c_show()
86 seq_printf(m, "priority : %d\n", alg->cra_priority); in c_show()
87 seq_printf(m, "refcnt : %d\n", atomic_read(&alg->cra_refcnt)); in c_show()
89 (alg->cra_flags & CRYPTO_ALG_TESTED) ? in c_show()
92 if (alg->cra_flags & CRYPTO_ALG_LARVAL) { in c_show()
94 seq_printf(m, "flags : 0x%x\n", alg->cra_flags); in c_show()
98 if (alg->cra_type && alg->cra_type->show) { in c_show()
[all …]
Dlrw.c241 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()
[all …]
Dcryptd.c279 static void *cryptd_alloc_instance(struct crypto_alg *alg, unsigned int head, in cryptd_alloc_instance() argument
293 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in cryptd_alloc_instance()
294 "cryptd(%s)", alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME) in cryptd_alloc_instance()
297 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in cryptd_alloc_instance()
299 inst->alg.cra_priority = alg->cra_priority + 50; in cryptd_alloc_instance()
300 inst->alg.cra_blocksize = alg->cra_blocksize; in cryptd_alloc_instance()
301 inst->alg.cra_alignmask = alg->cra_alignmask; in cryptd_alloc_instance()
318 struct crypto_alg *alg; in cryptd_create_blkcipher() local
321 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_BLKCIPHER, in cryptd_create_blkcipher()
323 if (IS_ERR(alg)) in cryptd_create_blkcipher()
[all …]
Dblkcipher.c406 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in async_encrypt() local
414 return alg->encrypt(&desc, req->dst, req->src, req->nbytes); in async_encrypt()
420 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in async_decrypt() local
427 return alg->decrypt(&desc, req->dst, req->src, req->nbytes); in async_decrypt()
430 static unsigned int crypto_blkcipher_ctxsize(struct crypto_alg *alg, u32 type, in crypto_blkcipher_ctxsize() argument
433 struct blkcipher_alg *cipher = &alg->cra_blkcipher; in crypto_blkcipher_ctxsize()
434 unsigned int len = alg->cra_ctxsize; in crypto_blkcipher_ctxsize()
438 len = ALIGN(len, (unsigned long)alg->cra_alignmask + 1); in crypto_blkcipher_ctxsize()
448 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in crypto_init_blkcipher_ops_async() local
453 if (!alg->ivsize) { in crypto_init_blkcipher_ops_async()
[all …]
Dxts.c217 struct crypto_alg *alg; in alloc() local
224 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, in alloc()
226 if (IS_ERR(alg)) in alloc()
227 return ERR_CAST(alg); in alloc()
229 inst = crypto_alloc_instance("xts", alg); in alloc()
233 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in alloc()
234 inst->alg.cra_priority = alg->cra_priority; in alloc()
235 inst->alg.cra_blocksize = alg->cra_blocksize; in alloc()
237 if (alg->cra_alignmask < 7) in alloc()
238 inst->alg.cra_alignmask = 7; in alloc()
[all …]
Dxcbc.c201 struct crypto_alg *alg; in xcbc_create() local
209 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, in xcbc_create()
211 if (IS_ERR(alg)) in xcbc_create()
212 return PTR_ERR(alg); in xcbc_create()
214 switch(alg->cra_blocksize) { in xcbc_create()
221 inst = shash_alloc_instance("xcbc", alg); in xcbc_create()
226 err = crypto_init_spawn(shash_instance_ctx(inst), alg, in xcbc_create()
232 alignmask = alg->cra_alignmask | 3; in xcbc_create()
233 inst->alg.base.cra_alignmask = alignmask; in xcbc_create()
234 inst->alg.base.cra_priority = alg->cra_priority; in xcbc_create()
[all …]
Dcbc.c217 struct crypto_alg *alg; in crypto_cbc_alloc() local
224 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, in crypto_cbc_alloc()
226 if (IS_ERR(alg)) in crypto_cbc_alloc()
227 return ERR_CAST(alg); in crypto_cbc_alloc()
230 if (!is_power_of_2(alg->cra_blocksize)) in crypto_cbc_alloc()
233 inst = crypto_alloc_instance("cbc", alg); in crypto_cbc_alloc()
237 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in crypto_cbc_alloc()
238 inst->alg.cra_priority = alg->cra_priority; in crypto_cbc_alloc()
239 inst->alg.cra_blocksize = alg->cra_blocksize; in crypto_cbc_alloc()
240 inst->alg.cra_alignmask = alg->cra_alignmask; in crypto_cbc_alloc()
[all …]
Dhmac.c187 struct crypto_alg *alg; in hmac_create() local
204 alg = &salg->base; in hmac_create()
205 if (ds > alg->cra_blocksize || in hmac_create()
206 ss < alg->cra_blocksize) in hmac_create()
209 inst = shash_alloc_instance("hmac", alg); in hmac_create()
219 inst->alg.base.cra_priority = alg->cra_priority; in hmac_create()
220 inst->alg.base.cra_blocksize = alg->cra_blocksize; in hmac_create()
221 inst->alg.base.cra_alignmask = alg->cra_alignmask; in hmac_create()
223 ss = ALIGN(ss, alg->cra_alignmask + 1); in hmac_create()
224 inst->alg.digestsize = ds; in hmac_create()
[all …]
Dpcbc.c227 struct crypto_alg *alg; in crypto_pcbc_alloc() local
234 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_CIPHER, in crypto_pcbc_alloc()
236 if (IS_ERR(alg)) in crypto_pcbc_alloc()
237 return ERR_CAST(alg); in crypto_pcbc_alloc()
239 inst = crypto_alloc_instance("pcbc", alg); in crypto_pcbc_alloc()
243 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in crypto_pcbc_alloc()
244 inst->alg.cra_priority = alg->cra_priority; in crypto_pcbc_alloc()
245 inst->alg.cra_blocksize = alg->cra_blocksize; in crypto_pcbc_alloc()
246 inst->alg.cra_alignmask = alg->cra_alignmask; in crypto_pcbc_alloc()
247 inst->alg.cra_type = &crypto_blkcipher_type; in crypto_pcbc_alloc()
[all …]
Dcts.c276 struct crypto_alg *alg; in crypto_cts_alloc() local
283 alg = crypto_attr_alg(tb[1], CRYPTO_ALG_TYPE_BLKCIPHER, in crypto_cts_alloc()
285 err = PTR_ERR(alg); in crypto_cts_alloc()
286 if (IS_ERR(alg)) in crypto_cts_alloc()
290 if (!is_power_of_2(alg->cra_blocksize)) in crypto_cts_alloc()
293 inst = crypto_alloc_instance("cts", alg); in crypto_cts_alloc()
297 inst->alg.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER; in crypto_cts_alloc()
298 inst->alg.cra_priority = alg->cra_priority; in crypto_cts_alloc()
299 inst->alg.cra_blocksize = alg->cra_blocksize; in crypto_cts_alloc()
300 inst->alg.cra_alignmask = alg->cra_alignmask; in crypto_cts_alloc()
[all …]
Dahash.c367 struct ahash_alg *alg = crypto_ahash_alg(hash); in crypto_ahash_init_tfm() local
376 hash->init = alg->init; in crypto_ahash_init_tfm()
377 hash->update = alg->update; in crypto_ahash_init_tfm()
378 hash->final = alg->final; in crypto_ahash_init_tfm()
379 hash->finup = alg->finup ?: ahash_def_finup; in crypto_ahash_init_tfm()
380 hash->digest = alg->digest; in crypto_ahash_init_tfm()
382 if (alg->setkey) in crypto_ahash_init_tfm()
383 hash->setkey = alg->setkey; in crypto_ahash_init_tfm()
384 if (alg->export) in crypto_ahash_init_tfm()
385 hash->export = alg->export; in crypto_ahash_init_tfm()
[all …]
Dalgboss.c40 } alg; member
56 char alg[CRYPTO_MAX_ALG_NAME]; member
102 const char *name = larval->alg.cra_name; in cryptomgr_schedule_probe()
154 param->attrs[i].alg.attr.rta_len = in cryptomgr_schedule_probe()
155 sizeof(param->attrs[i].alg); in cryptomgr_schedule_probe()
156 param->attrs[i].alg.attr.rta_type = CRYPTOA_ALG; in cryptomgr_schedule_probe()
157 memcpy(param->attrs[i].alg.data.name, name, len); in cryptomgr_schedule_probe()
186 param->type.data.type = larval->alg.cra_flags & ~CRYPTO_ALG_TESTED; in cryptomgr_schedule_probe()
190 param->otype = larval->alg.cra_flags; in cryptomgr_schedule_probe()
193 memcpy(param->larval, larval->alg.cra_name, CRYPTO_MAX_ALG_NAME); in cryptomgr_schedule_probe()
[all …]
Dshash.c332 struct shash_alg *alg = __crypto_shash_alg(calg); in crypto_init_shash_ops_async() local
355 if (alg->setkey) in crypto_init_shash_ops_async()
357 if (alg->export) in crypto_init_shash_ops_async()
359 if (alg->import) in crypto_init_shash_ops_async()
455 struct shash_alg *alg = __crypto_shash_alg(calg); in crypto_init_shash_ops_compat() local
486 crt->digestsize = alg->digestsize; in crypto_init_shash_ops_compat()
501 static unsigned int crypto_shash_ctxsize(struct crypto_alg *alg, u32 type, in crypto_shash_ctxsize() argument
520 static unsigned int crypto_shash_extsize(struct crypto_alg *alg) in crypto_shash_extsize() argument
522 return alg->cra_ctxsize; in crypto_shash_extsize()
525 static void crypto_shash_show(struct seq_file *m, struct crypto_alg *alg)
[all …]
Dpcrypt.c309 static struct crypto_instance *pcrypt_alloc_instance(struct crypto_alg *alg) in pcrypt_alloc_instance() argument
322 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in pcrypt_alloc_instance()
323 "pcrypt(%s)", alg->cra_driver_name) >= CRYPTO_MAX_ALG_NAME) in pcrypt_alloc_instance()
326 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in pcrypt_alloc_instance()
329 err = crypto_init_spawn(&ctx->spawn, alg, inst, in pcrypt_alloc_instance()
334 inst->alg.cra_priority = alg->cra_priority + 100; in pcrypt_alloc_instance()
335 inst->alg.cra_blocksize = alg->cra_blocksize; in pcrypt_alloc_instance()
336 inst->alg.cra_alignmask = alg->cra_alignmask; in pcrypt_alloc_instance()
351 struct crypto_alg *alg; in pcrypt_alloc_aead() local
353 alg = crypto_get_attr_alg(tb, type, (mask & CRYPTO_ALG_TYPE_MASK)); in pcrypt_alloc_aead()
[all …]
/linux-2.6.39/drivers/staging/rtl8192u/ieee80211/
Dapi.c30 static inline int crypto_alg_get(struct crypto_alg *alg) in crypto_alg_get() argument
32 return try_inc_mod_count(alg->cra_module); in crypto_alg_get()
35 static inline void crypto_alg_put(struct crypto_alg *alg) in crypto_alg_put() argument
37 if (alg->cra_module) in crypto_alg_put()
38 __MOD_DEC_USE_COUNT(alg->cra_module); in crypto_alg_put()
43 struct crypto_alg *q, *alg = NULL; in crypto_alg_lookup() local
53 alg = q; in crypto_alg_lookup()
59 return alg; in crypto_alg_lookup()
128 struct crypto_alg *alg; in crypto_alloc_tfm() local
130 alg = crypto_alg_mod_lookup(name); in crypto_alloc_tfm()
[all …]
/linux-2.6.39/arch/x86/crypto/
Dfpu.c104 struct crypto_alg *alg; in crypto_fpu_alloc() local
111 alg = crypto_get_attr_alg(tb, CRYPTO_ALG_TYPE_BLKCIPHER, in crypto_fpu_alloc()
113 if (IS_ERR(alg)) in crypto_fpu_alloc()
114 return ERR_CAST(alg); in crypto_fpu_alloc()
116 inst = crypto_alloc_instance("fpu", alg); in crypto_fpu_alloc()
120 inst->alg.cra_flags = alg->cra_flags; in crypto_fpu_alloc()
121 inst->alg.cra_priority = alg->cra_priority; in crypto_fpu_alloc()
122 inst->alg.cra_blocksize = alg->cra_blocksize; in crypto_fpu_alloc()
123 inst->alg.cra_alignmask = alg->cra_alignmask; in crypto_fpu_alloc()
124 inst->alg.cra_type = alg->cra_type; in crypto_fpu_alloc()
[all …]
/linux-2.6.39/include/crypto/internal/
Dhash.h38 struct ahash_alg alg; member
42 struct shash_alg alg; member
67 int crypto_register_ahash(struct ahash_alg *alg);
68 int crypto_unregister_ahash(struct ahash_alg *alg);
74 struct hash_alg_common *alg,
84 int crypto_register_shash(struct shash_alg *alg);
85 int crypto_unregister_shash(struct shash_alg *alg);
91 struct shash_alg *alg,
112 static inline struct ahash_alg *__crypto_ahash_alg(struct crypto_alg *alg) in __crypto_ahash_alg() argument
114 return container_of(__crypto_hash_alg_common(alg), struct ahash_alg, in __crypto_ahash_alg()
[all …]
/linux-2.6.39/drivers/staging/rtl8187se/ieee80211/
Dieee80211_crypt.c107 struct ieee80211_crypto_alg *alg; in ieee80211_register_crypto_ops() local
112 alg = kzalloc(sizeof(*alg), GFP_KERNEL); in ieee80211_register_crypto_ops()
113 if (alg == NULL) in ieee80211_register_crypto_ops()
116 alg->ops = ops; in ieee80211_register_crypto_ops()
119 list_add(&alg->list, &hcrypt->algs); in ieee80211_register_crypto_ops()
139 struct ieee80211_crypto_alg *alg = in ieee80211_unregister_crypto_ops() local
141 if (alg->ops == ops) { in ieee80211_unregister_crypto_ops()
142 list_del(&alg->list); in ieee80211_unregister_crypto_ops()
143 del_alg = alg; in ieee80211_unregister_crypto_ops()
170 struct ieee80211_crypto_alg *alg = in ieee80211_get_crypto_ops() local
[all …]

123456