Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
crypto/authenc.c
static int crypto_authenc_decrypt(struct aead_request *req) { struct crypto_aead *authenc = crypto_aead_reqtfm(req); unsigned int authsize = crypto_aead_authsize(authenc); struct aead_instance *inst = aead_alg_instance(authenc); struct crypto_authenc_ctx *ctx = crypto_aead_ctx(authenc); struct authenc_instan...
[ 1, 0 ]
Linux Kernel
crypto/authenc.c
static int __init crypto_authenc_module_init(void) { return crypto_register_template(&crypto_authenc_tmpl); }
[ 0, 0 ]
Linux Kernel
crypto/authenc.c
static void __exit crypto_authenc_module_exit(void) { crypto_unregister_template(&crypto_authenc_tmpl); }
[ 0, 0 ]
Linux Kernel
crypto/authencesn.c
static int crypto_authenc_esn_setauthsize(struct crypto_aead *authenc_esn, unsigned int authsize) { if (authsize > 0 && authsize < 4) return -EINVAL; return 0; }
[ 1, 0 ]
Linux Kernel
crypto/authencesn.c
static int crypto_authenc_esn_genicv_tail(struct aead_request *req, unsigned int flags) { struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req); struct crypto_authenc_esn_ctx *ctx = crypto_aead_ctx(authenc_esn); struct authenc_esn_request_ctx *areq_ctx = aead_request_...
[ 1, 0 ]
Linux Kernel
crypto/authencesn.c
static int crypto_authenc_esn_encrypt(struct aead_request *req) { struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req); struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req); struct crypto_authenc_esn_ctx *ctx = crypto_aead_ctx(authenc_esn); struct skcipher_request *skreq = (void *)(areq_ctx->t...
[ 1, 0 ]
Linux Kernel
crypto/authencesn.c
static int crypto_authenc_esn_decrypt_tail(struct aead_request *req, unsigned int flags) { struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req); unsigned int authsize = crypto_aead_authsize(authenc_esn); struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(re...
[ 1, 0 ]
Linux Kernel
crypto/authencesn.c
static int crypto_authenc_esn_decrypt(struct aead_request *req) { struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req); struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req); struct crypto_authenc_esn_ctx *ctx = crypto_aead_ctx(authenc_esn); struct ahash_request *ahreq = (void *)(areq_ctx->tail ...
[ 1, 0 ]
Linux Kernel
crypto/authencesn.c
static int crypto_authenc_esn_init_tfm(struct crypto_aead *tfm) { struct aead_instance *inst = aead_alg_instance(tfm); struct authenc_esn_instance_ctx *ictx = aead_instance_ctx(inst); struct crypto_authenc_esn_ctx *ctx = crypto_aead_ctx(tfm); struct crypto_ahash *auth; struct crypto_skcipher *enc; struct c...
[ 1, 0 ]
Linux Kernel
crypto/authencesn.c
static void crypto_authenc_esn_exit_tfm(struct crypto_aead *tfm) { struct crypto_authenc_esn_ctx *ctx = crypto_aead_ctx(tfm); crypto_free_ahash(ctx->auth); crypto_free_skcipher(ctx->enc); crypto_put_default_null_skcipher(); }
[ 0, 0 ]
Linux Kernel
crypto/blake2b_generic.c
static void blake2b_increment_counter(struct blake2b_state *S, const u64 inc) { S->t[0] += inc; S->t[1] += (S->t[0] < inc); } #define G(r, i, a, b, c, d) \ do { \ a = a + b + m[blake2b_...
[ 1, 0 ]
Linux Kernel
crypto/blake2b_generic.c
static void blake2b_compress_one_generic(struct blake2b_state *S, const u8 block[BLAKE2B_BLOCK_SIZE]) { u64 m[16]; u64 v[16]; size_t i; for (i = 0; i < 16; ++i) m[i] = get_unaligned_le64(block + i * sizeof(m[i])); for (i = 0; i < 8; ++i) v[i] = S->h[i]; v[...
[ 1, 0 ]
Linux Kernel
crypto/blake2b_generic.c
static int __init blake2b_mod_init(void) { return crypto_register_shashes(blake2b_algs, ARRAY_SIZE(blake2b_algs)); }
[ 0, 0 ]
Linux Kernel
crypto/blowfish_generic.c
static void bf_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) { struct bf_ctx *ctx = crypto_tfm_ctx(tfm); const u32 *P = ctx->p; const u32 *S = ctx->s; u32 yl = get_unaligned_be32(src); u32 yr = get_unaligned_be32(src + 4); ROUND(yr, yl, 17); ROUND(yl, yr, 16); ROUND(yr, yl, 15); ROUND(yl, ...
[ 0, 0 ]
Linux Kernel
crypto/blowfish_generic.c
static int __init blowfish_mod_init(void) { return crypto_register_alg(&alg); }
[ 0, 0 ]
Linux Kernel
crypto/camellia_generic.c
static int camellia_set_key(struct crypto_tfm *tfm, const u8 *in_key, unsigned int key_len) { struct camellia_ctx *cctx = crypto_tfm_ctx(tfm); const unsigned char *key = (const unsigned char *)in_key; if (key_len != 16 && key_len != 24 && key_len != 32) return -EINVAL; cctx->k...
[ 1, 0 ]
Linux Kernel
crypto/camellia_generic.c
static int __init camellia_init(void) { return crypto_register_alg(&camellia_alg); }
[ 0, 0 ]
Linux Kernel
crypto/cast6_generic.c
static void cast6_encrypt(struct crypto_tfm *tfm, u8 *outbuf, const u8 *inbuf) { __cast6_encrypt(crypto_tfm_ctx(tfm), outbuf, inbuf); }
[ 0, 0 ]
Linux Kernel
crypto/cast6_generic.c
static void __exit cast6_mod_fini(void) { crypto_unregister_alg(&alg); }
[ 0, 0 ]
Linux Kernel
crypto/cbc.c
static int crypto_cbc_encrypt_segment(struct skcipher_walk *walk, struct crypto_skcipher *skcipher) { unsigned int bsize = crypto_skcipher_blocksize(skcipher); void (*fn)(struct crypto_tfm *, u8 *, const u8 *); unsigned int nbytes = walk->nbytes; u8 *src = walk->src.virt.a...
[ 1, 0 ]
Linux Kernel
crypto/cbc.c
static int crypto_cbc_encrypt_inplace(struct skcipher_walk *walk, struct crypto_skcipher *skcipher) { unsigned int bsize = crypto_skcipher_blocksize(skcipher); void (*fn)(struct crypto_tfm *, u8 *, const u8 *); unsigned int nbytes = walk->nbytes; u8 *src = walk->src.virt.a...
[ 1, 0 ]
Linux Kernel
crypto/cbc.c
static void __exit crypto_cbc_module_exit(void) { crypto_unregister_template(&crypto_cbc_tmpl); }
[ 0, 0 ]
Linux Kernel
crypto/ccm.c
static int crypto_ccm_setauthsize(struct crypto_aead *tfm, unsigned int authsize) { switch (authsize) { case 4: case 6: case 8: case 10: case 12: case 14: case 16: break; default: return -EINVAL; } return 0; }
[ 0, 0 ]
Linux Kernel
crypto/ccm.c
static inline int crypto_ccm_check_iv(const u8 *iv) { if (1 > iv[0] || iv[0] > 7) return -EINVAL; return 0; }
[ 1, 0 ]
Linux Kernel
crypto/ccm.c
static int crypto_ccm_init_crypt(struct aead_request *req, u8 *tag) { struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); struct scatterlist *sg; u8 *iv = req->iv; int err; err = crypto_ccm_check_iv(iv); if (err) return err; pctx->flags = aead_request_flags(req); memset(iv + 15 - iv[0]...
[ 1, 0 ]
Linux Kernel
crypto/ccm.c
static int crypto_ccm_encrypt(struct aead_request *req) { struct crypto_aead *aead = crypto_aead_reqtfm(req); struct crypto_ccm_ctx *ctx = crypto_aead_ctx(aead); struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); struct skcipher_request *skreq = &pctx->skreq; struct scatterlist *dst; unsigned in...
[ 1, 0 ]
Linux Kernel
crypto/ccm.c
static void crypto_ccm_decrypt_done(struct crypto_async_request *areq, int err) { struct aead_request *req = areq->data; struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); struct crypto_aead *aead = crypto_aead_reqtfm(req); unsigned int authsize = crypto_aead_aut...
[ 1, 0 ]
Linux Kernel
crypto/ccm.c
static int crypto_ccm_decrypt(struct aead_request *req) { struct crypto_aead *aead = crypto_aead_reqtfm(req); struct crypto_ccm_ctx *ctx = crypto_aead_ctx(aead); struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); struct skcipher_request *skreq = &pctx->skreq; struct scatterlist *dst; unsigned in...
[ 1, 0 ]
Linux Kernel
crypto/ccm.c
static int crypto_rfc4309_setkey(struct crypto_aead *parent, const u8 *key, unsigned int keylen) { struct crypto_rfc4309_ctx *ctx = crypto_aead_ctx(parent); struct crypto_aead *child = ctx->child; if (keylen < 3) return -EINVAL; keylen -= 3; memcpy(ctx->nonce, key + key...
[ 1, 0 ]
Linux Kernel
crypto/ccm.c
static int crypto_rfc4309_setauthsize(struct crypto_aead *parent, unsigned int authsize) { struct crypto_rfc4309_ctx *ctx = crypto_aead_ctx(parent); switch (authsize) { case 8: case 12: case 16: break; default: return -EINVAL; } return crypto_aead_setauth...
[ 0, 0 ]
Linux Kernel
crypto/ccm.c
static void crypto_rfc4309_free(struct aead_instance *inst) { crypto_drop_aead(aead_instance_ctx(inst)); kfree(inst); }
[ 0, 0 ]
Linux Kernel
crypto/ccm.c
static void cbcmac_exit_tfm(struct crypto_tfm *tfm) { struct cbcmac_tfm_ctx *ctx = crypto_tfm_ctx(tfm); crypto_free_cipher(ctx->child); }
[ 0, 0 ]
Linux Kernel
crypto/ccm.c
static int __init crypto_ccm_module_init(void) { return crypto_register_templates(crypto_ccm_tmpls, ARRAY_SIZE(crypto_ccm_tmpls)); }
[ 0, 0 ]
Linux Kernel
crypto/cfb.c
static int crypto_cfb_encrypt_segment(struct skcipher_walk *walk, struct crypto_skcipher *tfm) { const unsigned int bsize = crypto_cfb_bsize(tfm); unsigned int nbytes = walk->nbytes; u8 *src = walk->src.virt.addr; u8 *dst = walk->dst.virt.addr; u8 *iv = walk->iv; do {...
[ 1, 0 ]
Linux Kernel
crypto/cfb.c
static int crypto_cfb_encrypt_inplace(struct skcipher_walk *walk, struct crypto_skcipher *tfm) { const unsigned int bsize = crypto_cfb_bsize(tfm); unsigned int nbytes = walk->nbytes; u8 *src = walk->src.virt.addr; u8 *iv = walk->iv; u8 tmp[MAX_CIPHER_BLOCKSIZE]; do { ...
[ 1, 0 ]
Linux Kernel
crypto/cfb.c
static int crypto_cfb_decrypt_inplace(struct skcipher_walk *walk, struct crypto_skcipher *tfm) { const unsigned int bsize = crypto_cfb_bsize(tfm); unsigned int nbytes = walk->nbytes; u8 *src = walk->src.virt.addr; u8 *const iv = walk->iv; u8 tmp[MAX_CIPHER_BLOCKSIZE]; ...
[ 1, 0 ]
Linux Kernel
crypto/cfb.c
static int crypto_cfb_decrypt_blocks(struct skcipher_walk *walk, struct crypto_skcipher *tfm) { if (walk->src.virt.addr == walk->dst.virt.addr) return crypto_cfb_decrypt_inplace(walk, tfm); else return crypto_cfb_decrypt_segment(walk, tfm); }
[ 0, 0 ]
Linux Kernel
crypto/cfb.c
static int crypto_cfb_decrypt(struct skcipher_request *req) { struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); struct skcipher_walk walk; const unsigned int bsize = crypto_cfb_bsize(tfm); int err; err = skcipher_walk_virt(&walk, req, false); while (walk.nbytes >= bsize) { err = crypto_cfb_d...
[ 1, 0 ]
Linux Kernel
crypto/chacha20poly1305.c
static inline void async_done_continue(struct aead_request *req, int err, int (*cont)(struct aead_request *)) { if (!err) { struct chachapoly_req_ctx *rctx = aead_request_ctx(req); rctx->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP; err = cont(req); } if (err != -EINPRO...
[ 1, 0 ]
Linux Kernel
crypto/chacha20poly1305.c
static int poly_verify_tag(struct aead_request *req) { struct chachapoly_req_ctx *rctx = aead_request_ctx(req); u8 tag[sizeof(rctx->tag)]; scatterwalk_map_and_copy(tag, req->src, req->assoclen + rctx->cryptlen, sizeof(tag), 0); if (crypto_memneq(tag, rctx->tag, sizeof(tag))) ret...
[ 1, 0 ]
Linux Kernel
crypto/chacha20poly1305.c
static int poly_copy_tag(struct aead_request *req) { struct chachapoly_req_ctx *rctx = aead_request_ctx(req); scatterwalk_map_and_copy(rctx->tag, req->dst, req->assoclen + rctx->cryptlen, sizeof(rctx->tag), 1); return 0; }
[ 1, 0 ]
Linux Kernel
crypto/chacha20poly1305.c
static void chacha_decrypt_done(struct crypto_async_request *areq, int err) { async_done_continue(areq->data, err, poly_verify_tag); }
[ 0, 0 ]
Linux Kernel
crypto/chacha20poly1305.c
static int poly_cipherpad(struct aead_request *req) { struct chachapoly_ctx *ctx = crypto_aead_ctx(crypto_aead_reqtfm(req)); struct chachapoly_req_ctx *rctx = aead_request_ctx(req); struct poly_req *preq = &rctx->u.poly; unsigned int padlen; int err; padlen = -rctx->cryptlen % POLY1305_BLOCK_SIZE; memse...
[ 1, 0 ]
Linux Kernel
crypto/chacha20poly1305.c
static int poly_cipher(struct aead_request *req) { struct chachapoly_ctx *ctx = crypto_aead_ctx(crypto_aead_reqtfm(req)); struct chachapoly_req_ctx *rctx = aead_request_ctx(req); struct poly_req *preq = &rctx->u.poly; struct scatterlist *crypt = req->src; int err; if (rctx->cryptlen == req->cryptlen) c...
[ 1, 0 ]
Linux Kernel
crypto/chacha20poly1305.c
static void poly_init_done(struct crypto_async_request *areq, int err) { async_done_continue(areq->data, err, poly_setkey); }
[ 0, 0 ]
Linux Kernel
crypto/chacha20poly1305.c
static void chacha_encrypt_done(struct crypto_async_request *areq, int err) { async_done_continue(areq->data, err, poly_genkey); }
[ 0, 0 ]
Linux Kernel
crypto/chacha20poly1305.c
static int chachapoly_setkey(struct crypto_aead *aead, const u8 *key, unsigned int keylen) { struct chachapoly_ctx *ctx = crypto_aead_ctx(aead); if (keylen != ctx->saltlen + CHACHA_KEY_SIZE) return -EINVAL; keylen -= ctx->saltlen; memcpy(ctx->salt, key + keylen, ctx->saltlen)...
[ 1, 0 ]
Linux Kernel
crypto/chacha20poly1305.c
static int chachapoly_setauthsize(struct crypto_aead *tfm, unsigned int authsize) { if (authsize != POLY1305_DIGEST_SIZE) return -EINVAL; return 0; }
[ 0, 0 ]
Linux Kernel
crypto/chacha20poly1305.c
static void chachapoly_exit(struct crypto_aead *tfm) { struct chachapoly_ctx *ctx = crypto_aead_ctx(tfm); crypto_free_ahash(ctx->poly); crypto_free_skcipher(ctx->chacha); }
[ 0, 0 ]
Linux Kernel
crypto/chacha20poly1305.c
static void chachapoly_free(struct aead_instance *inst) { struct chachapoly_instance_ctx *ctx = aead_instance_ctx(inst); crypto_drop_skcipher(&ctx->chacha); crypto_drop_ahash(&ctx->poly); kfree(inst); }
[ 0, 0 ]
Linux Kernel
crypto/chacha20poly1305.c
static int __init chacha20poly1305_module_init(void) { return crypto_register_templates(rfc7539_tmpls, ARRAY_SIZE(rfc7539_tmpls)); }
[ 0, 0 ]
Linux Kernel
crypto/chacha_generic.c
static int crypto_xchacha_crypt(struct skcipher_request *req) { struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); struct chacha_ctx *ctx = crypto_skcipher_ctx(tfm); struct chacha_ctx subctx; u32 state[16]; u8 real_iv[16]; chacha_init_generic(state, ctx->key, req->iv); hchacha_block_generic(state...
[ 1, 0 ]
Linux Kernel
crypto/chacha_generic.c
static void __exit chacha_generic_mod_fini(void) { crypto_unregister_skciphers(algs, ARRAY_SIZE(algs)); }
[ 0, 0 ]
Linux Kernel
crypto/cipher.c
static inline void cipher_crypt_one(struct crypto_cipher *tfm, u8 *dst, const u8 *src, bool enc) { unsigned long alignmask = crypto_cipher_alignmask(tfm); struct cipher_alg *cia = crypto_cipher_alg(tfm); void (*fn)(struct crypto_tfm *, u8 *, const u8 *) = enc ? cia->cia_...
[ 1, 0 ]
Linux Kernel
crypto/cmac.c
static int crypto_cmac_digest_init(struct shash_desc *pdesc) { unsigned long alignmask = crypto_shash_alignmask(pdesc->tfm); struct cmac_desc_ctx *ctx = shash_desc_ctx(pdesc); int bs = crypto_shash_blocksize(pdesc->tfm); u8 *prev = PTR_ALIGN((void *)ctx->ctx, alignmask + 1) + bs; ctx->len = 0; memset(prev...
[ 1, 0 ]
Linux Kernel
crypto/cmac.c
static int crypto_cmac_digest_update(struct shash_desc *pdesc, const u8 *p, unsigned int len) { struct crypto_shash *parent = pdesc->tfm; unsigned long alignmask = crypto_shash_alignmask(parent); struct cmac_tfm_ctx *tctx = crypto_shash_ctx(parent); struct cmac_desc_ctx *ctx...
[ 1, 0 ]
Linux Kernel
crypto/cmac.c
static int crypto_cmac_digest_final(struct shash_desc *pdesc, u8 *out) { struct crypto_shash *parent = pdesc->tfm; unsigned long alignmask = crypto_shash_alignmask(parent); struct cmac_tfm_ctx *tctx = crypto_shash_ctx(parent); struct cmac_desc_ctx *ctx = shash_desc_ctx(pdesc); struct crypto_cipher *tfm = tct...
[ 1, 0 ]
Linux Kernel
crypto/cmac.c
static void cmac_exit_tfm(struct crypto_tfm *tfm) { struct cmac_tfm_ctx *ctx = crypto_tfm_ctx(tfm); crypto_free_cipher(ctx->child); }
[ 0, 0 ]
Linux Kernel
crypto/cmac.c
static void __exit crypto_cmac_module_exit(void) { crypto_unregister_template(&crypto_cmac_tmpl); }
[ 0, 0 ]
Linux Kernel
crypto/crc32_generic.c
static int crc32_finup(struct shash_desc *desc, const u8 *data, unsigned int len, u8 *out) { return __crc32_finup(shash_desc_ctx(desc), data, len, out); }
[ 0, 0 ]
Linux Kernel
crypto/crc64_rocksoft_generic.c
static void __exit crc64_rocksoft_exit(void) { crypto_unregister_shash(&alg); }
[ 0, 0 ]
Linux Kernel
crypto/crct10dif_generic.c
static int chksum_init(struct shash_desc *desc) { struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); ctx->crc = 0; return 0; }
[ 0, 0 ]
Linux Kernel
crypto/cryptd.c
static void cryptd_queue_worker(struct work_struct *work) { struct cryptd_cpu_queue *cpu_queue; struct crypto_async_request *req, *backlog; cpu_queue = container_of(work, struct cryptd_cpu_queue, work); local_bh_disable(); backlog = crypto_get_backlog(&cpu_queue->queue); req = crypto_dequeue_request(&cpu_...
[ 0, 0 ]
Linux Kernel
crypto/cryptd.c
static void cryptd_type_and_mask(struct crypto_attr_type *algt, u32 *type, u32 *mask) { *type = algt->type & CRYPTO_ALG_INTERNAL; *mask = algt->mask & CRYPTO_ALG_INTERNAL; /* No point in cryptd wrapping an algorithm that's already async. */ *mask |= CRYPTO_ALG_ASYNC; *mask ...
[ 0, 0 ]
Linux Kernel
crypto/cryptd.c
static void cryptd_skcipher_complete(struct skcipher_request *req, int err) { struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); struct cryptd_skcipher_request_ctx *rctx = skcipher_request_ctx(req); int refcnt = refcount_read(&ctx->refcnt); ...
[ 0, 0 ]
Linux Kernel
crypto/cryptd.c
static int cryptd_skcipher_init_tfm(struct crypto_skcipher *tfm) { struct skcipher_instance *inst = skcipher_alg_instance(tfm); struct skcipherd_instance_ctx *ictx = skcipher_instance_ctx(inst); struct crypto_skcipher_spawn *spawn = &ictx->spawn; struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); st...
[ 1, 0 ]
Linux Kernel
crypto/cryptd.c
static void cryptd_skcipher_free(struct skcipher_instance *inst) { struct skcipherd_instance_ctx *ctx = skcipher_instance_ctx(inst); crypto_drop_skcipher(&ctx->spawn); kfree(inst); }
[ 0, 0 ]
Linux Kernel
crypto/cryptd.c
static int cryptd_create_skcipher(struct crypto_template *tmpl, struct rtattr **tb, struct crypto_attr_type *algt, struct cryptd_queue *queue) { struct skcipherd_instance_ctx *ctx; struct skcipher_instance *inst; ...
[ 1, 0 ]
Linux Kernel
crypto/cryptd.c
static int cryptd_hash_setkey(struct crypto_ahash *parent, const u8 *key, unsigned int keylen) { struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(parent); struct crypto_shash *child = ctx->child; crypto_shash_clear_flags(child, CRYPTO_TFM_REQ_MASK); crypto_shash_set_flags(child, ...
[ 0, 0 ]
Linux Kernel
crypto/cryptd.c
static int cryptd_hash_init_enqueue(struct ahash_request *req) { return cryptd_hash_enqueue(req, cryptd_hash_init); }
[ 0, 0 ]
Linux Kernel
crypto/cryptd.c
static int cryptd_aead_setauthsize(struct crypto_aead *parent, unsigned int authsize) { struct cryptd_aead_ctx *ctx = crypto_aead_ctx(parent); struct crypto_aead *child = ctx->child; return crypto_aead_setauthsize(child, authsize); }
[ 0, 0 ]
Linux Kernel
crypto/cryptd.c
static void cryptd_aead_encrypt(struct crypto_async_request *areq, int err) { struct cryptd_aead_ctx *ctx = crypto_tfm_ctx(areq->tfm); struct crypto_aead *child = ctx->child; struct aead_request *req; req = container_of(areq, struct aead_request, base); cryptd_aead_crypt(req, child, err, crypto_aead_alg(chi...
[ 0, 0 ]
Linux Kernel
crypto/cryptd.c
struct crypto_skcipher *cryptd_skcipher_child(struct cryptd_skcipher *tfm) { struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); return &ctx->child->base; }
[ 1, 0 ]
Linux Kernel
crypto/cryptd.c
struct cryptd_ahash *cryptd_alloc_ahash(const char *alg_name, u32 type, u32 mask) { char cryptd_alg_name[CRYPTO_MAX_ALG_NAME]; struct cryptd_hash_ctx *ctx; struct crypto_ahash *tfm; if (snprintf(cryptd_alg_name, CRYPTO_MAX_ALG_NAME, "cryptd(%s)", alg_name) >= CRYP...
[ 1, 0 ]
Linux Kernel
crypto/cryptd.c
bool cryptd_ahash_queued(struct cryptd_ahash *tfm) { struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); return refcount_read(&ctx->refcnt) - 1; }
[ 0, 0 ]
Linux Kernel
crypto/cryptd.c
struct cryptd_aead *cryptd_alloc_aead(const char *alg_name, u32 type, u32 mask) { char cryptd_alg_name[CRYPTO_MAX_ALG_NAME]; struct cryptd_aead_ctx *ctx; struct crypto_aead *tfm; if (snprintf(cryptd_alg_name, CRYPTO_MAX_ALG_NAME, "cryptd(%s)", alg_name) >= CRYPTO_MA...
[ 1, 0 ]
Linux Kernel
crypto/cryptd.c
struct crypto_aead *cryptd_aead_child(struct cryptd_aead *tfm) { struct cryptd_aead_ctx *ctx; ctx = crypto_aead_ctx(&tfm->base); return ctx->child; }
[ 0, 0 ]
Linux Kernel
crypto/cryptd.c
void cryptd_free_aead(struct cryptd_aead *tfm) { struct cryptd_aead_ctx *ctx = crypto_aead_ctx(&tfm->base); if (refcount_dec_and_test(&ctx->refcnt)) crypto_free_aead(&tfm->base); }
[ 0, 0 ]
Linux Kernel
crypto/cryptd.c
static void __exit cryptd_exit(void) { destroy_workqueue(cryptd_wq); cryptd_fini_queue(&queue); crypto_unregister_template(&cryptd_tmpl); }
[ 0, 0 ]
Linux Kernel
crypto/crypto_engine.c
static void crypto_finalize_request(struct crypto_engine *engine, struct crypto_async_request *req, int err) { unsigned long flags; bool finalize_req = false; int ret; struct crypto_engine_ctx *enginectx; if (!engine->retry_support) { spin_lock_irqsave(&engine->queue_l...
[ 1, 0 ]
Linux Kernel
crypto/crypto_engine.c
static void crypto_pump_work(struct kthread_work *work) { struct crypto_engine *engine = container_of(work, struct crypto_engine, pump_requests); crypto_pump_requests(engine, true); }
[ 0, 0 ]
Linux Kernel
crypto/crypto_engine.c
int crypto_transfer_aead_request_to_engine(struct crypto_engine *engine, struct aead_request *req) { return crypto_transfer_request_to_engine(engine, &req->base); }
[ 0, 0 ]
Linux Kernel
crypto/crypto_engine.c
int crypto_transfer_skcipher_request_to_engine(struct crypto_engine *engine, struct skcipher_request *req) { return crypto_transfer_request_to_engine(engine, &req->base); }
[ 0, 0 ]
Linux Kernel
crypto/crypto_engine.c
void crypto_finalize_akcipher_request(struct crypto_engine *engine, struct akcipher_request *req, int err) { return crypto_finalize_request(engine, &req->base, err); }
[ 0, 0 ]
Linux Kernel
crypto/crypto_engine.c
void crypto_finalize_kpp_request(struct crypto_engine *engine, struct kpp_request *req, int err) { return crypto_finalize_request(engine, &req->base, err); }
[ 0, 0 ]
Linux Kernel
crypto/crypto_engine.c
struct crypto_engine *crypto_engine_alloc_init_and_set( struct device *dev, bool retry_support, int (*cbk_do_batch)(struct crypto_engine *engine), bool rt, int qlen) { struct crypto_engine *engine; if (!dev) return NULL; engine = devm_kzalloc(dev, sizeof(*engine), GFP_KERNEL); if (!engine) ret...
[ 1, 0 ]
Linux Kernel
crypto/crypto_engine.c
struct crypto_engine *crypto_engine_alloc_init(struct device *dev, bool rt) { return crypto_engine_alloc_init_and_set(dev, false, NULL, rt, CRYPTO_ENGINE_MAX_QLEN); }
[ 0, 0 ]
Linux Kernel
crypto/crypto_null.c
static int null_skcipher_setkey(struct crypto_skcipher *tfm, const u8 *key, unsigned int keylen) { return 0; }
[ 0, 0 ]
Linux Kernel
crypto/crypto_null.c
static void null_crypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) { memcpy(dst, src, NULL_BLOCK_SIZE); }
[ 1, 0 ]
Linux Kernel
crypto/crypto_null.c
static int __init crypto_null_mod_init(void) { int ret = 0; ret = crypto_register_algs(null_algs, ARRAY_SIZE(null_algs)); if (ret < 0) goto out; ret = crypto_register_shash(&digest_null); if (ret < 0) goto out_unregister_algs; ret = crypto_register_skcipher(&skcipher_null); if (ret < 0) go...
[ 0, 0 ]
Linux Kernel
crypto/crypto_user_base.c
struct crypto_alg *crypto_alg_match(struct crypto_user_alg *p, int exact) { struct crypto_alg *q, *alg = NULL; down_read(&crypto_alg_sem); list_for_each_entry(q, &crypto_alg_list, cra_list) { int match = 0; if (crypto_is_larval(q)) continue; if ((q->cra_flags ^ p->cru_type) & p->cru_mask) ...
[ 0, 0 ]
Linux Kernel
crypto/crypto_user_base.c
static int crypto_report_one(struct crypto_alg *alg, struct crypto_user_alg *ualg, struct sk_buff *skb) { memset(ualg, 0, sizeof(*ualg)); strscpy(ualg->cru_name, alg->cra_name, sizeof(ualg->cru_name)); strscpy(ualg->cru_driver_name, alg->cra_driver_name,...
[ 1, 0 ]
Linux Kernel
crypto/crypto_user_base.c
static int crypto_report_alg(struct crypto_alg *alg, struct crypto_dump_info *info) { struct sk_buff *in_skb = info->in_skb; struct sk_buff *skb = info->out_skb; struct nlmsghdr *nlh; struct crypto_user_alg *ualg; int err = 0; nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, in...
[ 1, 0 ]
Linux Kernel
crypto/crypto_user_base.c
static int crypto_dump_report_done(struct netlink_callback *cb) { return 0; }
[ 0, 0 ]
Linux Kernel
crypto/crypto_user_base.c
static int crypto_update_alg(struct sk_buff *skb, struct nlmsghdr *nlh, struct nlattr **attrs) { struct crypto_alg *alg; struct crypto_user_alg *p = nlmsg_data(nlh); struct nlattr *priority = attrs[CRYPTOCFGA_PRIORITY_VAL]; LIST_HEAD(list); if (!netlink_capable(skb, CAP_NET_ADMI...
[ 0, 0 ]
Linux Kernel
crypto/crypto_user_base.c
static void crypto_netlink_rcv(struct sk_buff *skb) { mutex_lock(&crypto_cfg_mutex); netlink_rcv_skb(skb, &crypto_user_rcv_msg); mutex_unlock(&crypto_cfg_mutex); }
[ 0, 0 ]
Linux Kernel
crypto/crypto_user_stat.c
static int crypto_report_aead(struct sk_buff *skb, struct crypto_alg *alg) { struct crypto_stat_aead raead; memset(&raead, 0, sizeof(raead)); strscpy(raead.type, "aead", sizeof(raead.type)); raead.stat_encrypt_cnt = atomic64_read(&alg->stats.aead.encrypt_cnt); raead.stat_encrypt_tlen = atomic64_read(&alg-...
[ 1, 0 ]
Linux Kernel
crypto/crypto_user_stat.c
static int crypto_report_akcipher(struct sk_buff *skb, struct crypto_alg *alg) { struct crypto_stat_akcipher rakcipher; memset(&rakcipher, 0, sizeof(rakcipher)); strscpy(rakcipher.type, "akcipher", sizeof(rakcipher.type)); rakcipher.stat_encrypt_cnt = atomic64_read(&alg->stats.akcipher.encrypt_cnt); rakcip...
[ 1, 0 ]
Linux Kernel
crypto/crypto_user_stat.c
static int crypto_report_kpp(struct sk_buff *skb, struct crypto_alg *alg) { struct crypto_stat_kpp rkpp; memset(&rkpp, 0, sizeof(rkpp)); strscpy(rkpp.type, "kpp", sizeof(rkpp.type)); rkpp.stat_setsecret_cnt = atomic64_read(&alg->stats.kpp.setsecret_cnt); rkpp.stat_generate_public_key_cnt = atomic64_...
[ 1, 0 ]
Linux Kernel
crypto/ctr.c
static void crypto_ctr_crypt_final(struct skcipher_walk *walk, struct crypto_cipher *tfm) { unsigned int bsize = crypto_cipher_blocksize(tfm); unsigned long alignmask = crypto_cipher_alignmask(tfm); u8 *ctrblk = walk->iv; u8 tmp[MAX_CIPHER_BLOCKSIZE + MAX_CIPHER_ALIGNMASK]; ...
[ 1, 0 ]