Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
crypto/ghash-generic.c
static int ghash_init(struct shash_desc *desc) { struct ghash_desc_ctx *dctx = shash_desc_ctx(desc); memset(dctx, 0, sizeof(*dctx)); return 0; }
[ 1, 0 ]
Linux Kernel
crypto/ghash-generic.c
static int ghash_setkey(struct crypto_shash *tfm, const u8 *key, unsigned int keylen) { struct ghash_ctx *ctx = crypto_shash_ctx(tfm); be128 k; if (keylen != GHASH_BLOCK_SIZE) return -EINVAL; if (ctx->gf128) gf128mul_free_4k(ctx->gf128); BUILD_BUG_ON(sizeof(k) != GHASH_BLOCK...
[ 1, 0 ]
Linux Kernel
crypto/ghash-generic.c
static void __exit ghash_mod_exit(void) { crypto_unregister_shash(&ghash_alg); }
[ 0, 0 ]
Linux Kernel
crypto/hctr2.c
static int hctr2_hash_tweaklen(struct hctr2_tfm_ctx *tctx, bool has_remainder) { SHASH_DESC_ON_STACK(shash, tfm->polyval); __le64 tweak_length_block[2]; int err; shash->tfm = tctx->polyval; memset(tweak_length_block, 0, sizeof(tweak_length_block)); tweak_length_block[0] = cpu_to_le64(TWEAK_SIZE * 8 * 2 + ...
[ 1, 0 ]
Linux Kernel
crypto/hctr2.c
static void hctr2_xctr_done(struct crypto_async_request *areq, int err) { struct skcipher_request *req = areq->data; if (!err) err = hctr2_finish(req); skcipher_request_complete(req, err); }
[ 0, 0 ]
Linux Kernel
crypto/hctr2.c
static int hctr2_encrypt(struct skcipher_request *req) { return hctr2_crypt(req, true); }
[ 0, 0 ]
Linux Kernel
crypto/hctr2.c
static int hctr2_init_tfm(struct crypto_skcipher *tfm) { struct skcipher_instance *inst = skcipher_alg_instance(tfm); struct hctr2_instance_ctx *ictx = skcipher_instance_ctx(inst); struct hctr2_tfm_ctx *tctx = crypto_skcipher_ctx(tfm); struct crypto_skcipher *xctr; struct crypto_cipher *blockcipher; struct...
[ 1, 0 ]
Linux Kernel
crypto/hctr2.c
static int hctr2_create_base(struct crypto_template *tmpl, struct rtattr **tb) { const char *xctr_name; const char *polyval_name; xctr_name = crypto_attr_alg_name(tb[1]); if (IS_ERR(xctr_name)) return PTR_ERR(xctr_name); polyval_name = crypto_attr_alg_name(tb[2]); if (IS_ERR(polyval_name)) return...
[ 0, 0 ]
Linux Kernel
crypto/hmac.c
static int hmac_export(struct shash_desc *pdesc, void *out) { struct shash_desc *desc = shash_desc_ctx(pdesc); return crypto_shash_export(desc, out); }
[ 0, 0 ]
Linux Kernel
crypto/hmac.c
static int hmac_finup(struct shash_desc *pdesc, const u8 *data, unsigned int nbytes, u8 *out) { struct crypto_shash *parent = pdesc->tfm; int ds = crypto_shash_digestsize(parent); int ss = crypto_shash_statesize(parent); char *opad = crypto_shash_ctx_aligned(parent) + ss; struct shash_...
[ 0, 0 ]
Linux Kernel
crypto/hmac.c
static void __exit hmac_module_exit(void) { crypto_unregister_template(&hmac_tmpl); }
[ 0, 0 ]
Linux Kernel
crypto/internal.h
static inline void crypto_init_proc(void) {}
[ 0, 0 ]
Linux Kernel
crypto/internal.h
static inline unsigned int crypto_cipher_ctxsize(struct crypto_alg *alg) { return alg->cra_ctxsize; }
[ 0, 0 ]
Linux Kernel
crypto/internal.h
static inline void *crypto_create_tfm(struct crypto_alg *alg, const struct crypto_type *frontend) { return crypto_create_tfm_node(alg, frontend, NUMA_NO_NODE); }
[ 0, 0 ]
Linux Kernel
crypto/internal.h
static inline void crypto_tmpl_put(struct crypto_template *tmpl) { module_put(tmpl->module); }
[ 0, 0 ]
Linux Kernel
crypto/internal.h
static inline int crypto_is_dead(struct crypto_alg *alg) { return alg->cra_flags & CRYPTO_ALG_DEAD; }
[ 0, 0 ]
Linux Kernel
crypto/internal.h
static inline void crypto_notify(unsigned long val, void *v) { blocking_notifier_call_chain(&crypto_chain, val, v); }
[ 0, 0 ]
Linux Kernel
crypto/jitterentropy-kcapi.c
void jent_panic(char *s) { panic("%s", s); }
[ 0, 0 ]
Linux Kernel
crypto/jitterentropy-kcapi.c
void jent_get_nstime(__u64 *out) { __u64 tmp = 0; tmp = random_get_entropy(); if (tmp == 0) tmp = ktime_get_ns(); *out = tmp; }
[ 0, 0 ]
Linux Kernel
crypto/jitterentropy-kcapi.c
static int jent_kcapi_reset(struct crypto_rng *tfm, const u8 *seed, unsigned int slen) { return 0; }
[ 0, 0 ]
Linux Kernel
crypto/jitterentropy.c
static void jent_apt_insert(struct rand_data *ec, unsigned int delta_masked) { if (!ec->apt_base_set) { ec->apt_base = delta_masked; ec->apt_base_set = 1; return; } if (delta_masked == ec->apt_base) { ec->apt_count++; if (ec->apt_count >= JENT_APT_CUTOFF) ec->health_failure = 1; } ...
[ 0, 0 ]
Linux Kernel
crypto/jitterentropy.c
static void jent_memaccess(struct rand_data *ec, __u64 loop_cnt) { unsigned int wrap = 0; __u64 i = 0; #define MAX_ACC_LOOP_BIT 7 #define MIN_ACC_LOOP_BIT 0 __u64 acc_loop_cnt = jent_loop_shuffle(ec, MAX_ACC_LOOP_BIT, MIN_ACC_LOOP_BIT); if (NULL == ec || NULL == ec->mem) return; wrap = ec->memblock...
[ 1, 0 ]
Linux Kernel
crypto/keywrap.c
static void __exit crypto_kw_exit(void) { crypto_unregister_template(&crypto_kw_tmpl); }
[ 0, 0 ]
Linux Kernel
crypto/khazad.c
static void khazad_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) { struct khazad_ctx *ctx = crypto_tfm_ctx(tfm); khazad_crypt(ctx->E, dst, src); }
[ 0, 0 ]
Linux Kernel
crypto/kpp.c
static int crypto_kpp_report(struct sk_buff *skb, struct crypto_alg *alg) { struct crypto_report_kpp rkpp; memset(&rkpp, 0, sizeof(rkpp)); strscpy(rkpp.type, "kpp", sizeof(rkpp.type)); return nla_put(skb, CRYPTOCFGA_REPORT_KPP, sizeof(rkpp), &rkpp); }
[ 1, 0 ]
Linux Kernel
crypto/kpp.c
static int crypto_kpp_report(struct sk_buff *skb, struct crypto_alg *alg) { return -ENOSYS; } #endif
[ 0, 0 ]
Linux Kernel
crypto/kpp.c
static int crypto_kpp_init_tfm(struct crypto_tfm *tfm) { struct crypto_kpp *kpp = __crypto_kpp_tfm(tfm); struct kpp_alg *alg = crypto_kpp_alg(kpp); if (alg->exit) kpp->base.exit = crypto_kpp_exit_tfm; if (alg->init) return alg->init(kpp); return 0; }
[ 0, 0 ]
Linux Kernel
crypto/kpp.c
struct crypto_kpp *crypto_alloc_kpp(const char *alg_name, u32 type, u32 mask) { return crypto_alloc_tfm(alg_name, &crypto_kpp_type, type, mask); }
[ 0, 0 ]
Linux Kernel
crypto/kpp.c
int crypto_grab_kpp(struct crypto_kpp_spawn *spawn, struct crypto_instance *inst, const char *name, u32 type, u32 mask) { spawn->base.frontend = &crypto_kpp_type; return crypto_grab_spawn(&spawn->base, inst, name, type, mask); }
[ 0, 0 ]
Linux Kernel
crypto/kpp.c
int crypto_has_kpp(const char *alg_name, u32 type, u32 mask) { return crypto_type_has_alg(alg_name, &crypto_kpp_type, type, mask); }
[ 0, 0 ]
Linux Kernel
crypto/kpp.c
void crypto_unregister_kpp(struct kpp_alg *alg) { crypto_unregister_alg(&alg->base); }
[ 0, 0 ]
Linux Kernel
crypto/lrw.c
static int lrw_setkey(struct crypto_skcipher *parent, const u8 *key, unsigned int keylen) { struct lrw_tfm_ctx *ctx = crypto_skcipher_ctx(parent); struct crypto_skcipher *child = ctx->child; int err, bsize = LRW_BLOCK_SIZE; const u8 *tweak = key + keylen - bsize; be128 tmp = {0}; int i...
[ 1, 0 ]
Linux Kernel
crypto/lrw.c
static int lrw_xor_tweak_post(struct skcipher_request *req) { return lrw_xor_tweak(req, true); }
[ 0, 0 ]
Linux Kernel
crypto/lrw.c
static void lrw_crypt_done(struct crypto_async_request *areq, int err) { struct skcipher_request *req = areq->data; if (!err) { struct lrw_request_ctx *rctx = skcipher_request_ctx(req); rctx->subreq.base.flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP; err = lrw_xor_tweak_post(req); } skcipher_request_comple...
[ 0, 0 ]
Linux Kernel
crypto/lrw.c
static int lrw_decrypt(struct skcipher_request *req) { struct lrw_request_ctx *rctx = skcipher_request_ctx(req); struct skcipher_request *subreq = &rctx->subreq; lrw_init_crypt(req); return lrw_xor_tweak_pre(req) ?: crypto_skcipher_decrypt(subreq) ?: lrw_xor_tweak_post(req); }
[ 0, 0 ]
Linux Kernel
crypto/lrw.c
static void lrw_free_instance(struct skcipher_instance *inst) { crypto_drop_skcipher(skcipher_instance_ctx(inst)); kfree(inst); }
[ 0, 0 ]
Linux Kernel
crypto/lz4.c
static int __lz4_compress_crypto(const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen, void *ctx) { int out_len = LZ4_compress_default(src, dst, slen, *dlen, ctx); if (!out_len) return -EINVAL; *dlen = out_len; return 0; }
[ 0, 0 ]
Linux Kernel
crypto/lz4.c
static int __lz4_decompress_crypto(const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen, void *ctx) { int out_len = LZ4_decompress_safe(src, dst, slen, *dlen); if (out_len < 0) return -EINVAL; *dlen = out_len; return 0; }
[ 0, 0 ]
Linux Kernel
crypto/lz4.c
static int lz4_sdecompress(struct crypto_scomp *tfm, const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen, void *ctx) { return __lz4_decompress_crypto(src, slen, dst, dlen, NULL); }
[ 0, 0 ]
Linux Kernel
crypto/lz4hc.c
static void *lz4hc_alloc_ctx(struct crypto_scomp *tfm) { void *ctx; ctx = vmalloc(LZ4HC_MEM_COMPRESS); if (!ctx) return ERR_PTR(-ENOMEM); return ctx; }
[ 0, 0 ]
Linux Kernel
crypto/lz4hc.c
static int lz4hc_init(struct crypto_tfm *tfm) { struct lz4hc_ctx *ctx = crypto_tfm_ctx(tfm); ctx->lz4hc_comp_mem = lz4hc_alloc_ctx(NULL); if (IS_ERR(ctx->lz4hc_comp_mem)) return -ENOMEM; return 0; }
[ 0, 0 ]
Linux Kernel
crypto/lz4hc.c
static int __lz4hc_compress_crypto(const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen, void *ctx) { int out_len = LZ4_compress_HC(src, dst, slen, *dlen, LZ4HC_DEFAULT_CLEVEL, ctx); if (!out_len) return -EINVAL; *dlen = out_len; return 0; }
[ 0, 0 ]
Linux Kernel
crypto/lz4hc.c
static int __lz4hc_decompress_crypto(const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen, void *ctx) { int out_len = LZ4_decompress_safe(src, dst, slen, *dlen); if (out_len < 0) return -EINVAL; *dlen = out_len; return 0; }
[ 0, 0 ]
Linux Kernel
crypto/lz4hc.c
static int lz4hc_sdecompress(struct crypto_scomp *tfm, const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen, void *ctx) { return __lz4hc_decompress_crypto(src, slen, dst, dlen, NULL); }
[ 0, 0 ]
Linux Kernel
crypto/lzo-rle.c
static void lzorle_exit(struct crypto_tfm *tfm) { struct lzorle_ctx *ctx = crypto_tfm_ctx(tfm); lzorle_free_ctx(NULL, ctx->lzorle_comp_mem); }
[ 0, 0 ]
Linux Kernel
crypto/lzo-rle.c
static int __lzorle_compress(const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen, void *ctx) { size_t tmp_len = *dlen; int err; err = lzorle1x_1_compress(src, slen, dst, &tmp_len, ctx); if (err != LZO_E_OK) return -EINVAL; *dlen = tmp_len; return 0; }
[ 0, 0 ]
Linux Kernel
crypto/lzo-rle.c
static int lzorle_scompress(struct crypto_scomp *tfm, const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen, void *ctx) { return __lzorle_compress(src, slen, dst, dlen, ctx); }
[ 0, 0 ]
Linux Kernel
crypto/lzo-rle.c
static void __exit lzorle_mod_fini(void) { crypto_unregister_alg(&alg); crypto_unregister_scomp(&scomp); }
[ 0, 0 ]
Linux Kernel
crypto/lzo.c
static int __lzo_decompress(const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen) { int err; size_t tmp_len = *dlen; err = lzo1x_decompress_safe(src, slen, dst, &tmp_len); if (err != LZO_E_OK) return -EINVAL; *dlen = tmp_len; return 0; }
[ 0, 0 ]
Linux Kernel
crypto/lzo.c
static int lzo_decompress(struct crypto_tfm *tfm, const u8 *src, unsigned int slen, u8 *dst, unsigned int *dlen) { return __lzo_decompress(src, slen, dst, dlen); }
[ 0, 0 ]
Linux Kernel
crypto/lzo.c
static int __init lzo_mod_init(void) { int ret; ret = crypto_register_alg(&alg); if (ret) return ret; ret = crypto_register_scomp(&scomp); if (ret) { crypto_unregister_alg(&alg); return ret; } return ret; }
[ 0, 0 ]
Linux Kernel
crypto/md4.c
static inline u32 lshift(u32 x, unsigned int s) { x &= 0xFFFFFFFF; return ((x << s) & 0xFFFFFFFF) | (x >> (32 - s)); }
[ 1, 0 ]
Linux Kernel
crypto/md4.c
static inline void md4_transform_helper(struct md4_ctx *ctx) { le32_to_cpu_array(ctx->block, ARRAY_SIZE(ctx->block)); md4_transform(ctx->hash, ctx->block); }
[ 0, 0 ]
Linux Kernel
crypto/md4.c
static int md4_update(struct shash_desc *desc, const u8 *data, unsigned int len) { struct md4_ctx *mctx = shash_desc_ctx(desc); const u32 avail = sizeof(mctx->block) - (mctx->byte_count & 0x3f); mctx->byte_count += len; if (avail > len) { memcpy((char *)mctx->block + (sizeof(mctx->b...
[ 1, 0 ]
Linux Kernel
crypto/md4.c
static int md4_final(struct shash_desc *desc, u8 *out) { struct md4_ctx *mctx = shash_desc_ctx(desc); const unsigned int offset = mctx->byte_count & 0x3f; char *p = (char *)mctx->block + offset; int padding = 56 - (offset + 1); *p++ = 0x80; if (padding < 0) { memset(p, 0x00, padding + sizeof(u64)); ...
[ 1, 0 ]
Linux Kernel
crypto/md5.c
static int md5_update(struct shash_desc *desc, const u8 *data, unsigned int len) { struct md5_state *mctx = shash_desc_ctx(desc); const u32 avail = sizeof(mctx->block) - (mctx->byte_count & 0x3f); mctx->byte_count += len; if (avail > len) { memcpy((char *)mctx->block + (sizeof(mctx-...
[ 1, 0 ]
Linux Kernel
crypto/md5.c
static void __exit md5_mod_fini(void) { crypto_unregister_shash(&alg); }
[ 0, 0 ]
Linux Kernel
crypto/michael_mic.c
static int michael_final(struct shash_desc *desc, u8 *out) { struct michael_mic_desc_ctx *mctx = shash_desc_ctx(desc); u8 *data = (u8 *)&mctx->pending; switch (mctx->pending_len) { case 0: mctx->l ^= 0x5a; break; case 1: mctx->l ^= data[0] | 0x5a00; break; case 2: mctx->l ^= data[0] | (...
[ 1, 0 ]
Linux Kernel
crypto/michael_mic.c
static int __init michael_mic_init(void) { return crypto_register_shash(&alg); }
[ 0, 0 ]
Linux Kernel
crypto/nhpoly1305.c
int crypto_nhpoly1305_setkey(struct crypto_shash *tfm, const u8 *key, unsigned int keylen) { struct nhpoly1305_key *ctx = crypto_shash_ctx(tfm); int i; if (keylen != NHPOLY1305_KEY_SIZE) return -EINVAL; poly1305_core_setkey(&ctx->poly_key, key); key += POLY1305_BLOCK_SIZE; ...
[ 1, 0 ]
Linux Kernel
crypto/nhpoly1305.c
int crypto_nhpoly1305_update_helper(struct shash_desc *desc, const u8 *src, unsigned int srclen, nh_t nh_fn) { struct nhpoly1305_state *state = shash_desc_ctx(desc); const struct nhpoly1305_key *key = crypto_shash_ctx(desc->tfm); unsigned int bytes; if (state->buflen) { ...
[ 1, 0 ]
Linux Kernel
crypto/nhpoly1305.c
int crypto_nhpoly1305_final_helper(struct shash_desc *desc, u8 *dst, nh_t nh_fn) { struct nhpoly1305_state *state = shash_desc_ctx(desc); const struct nhpoly1305_key *key = crypto_shash_ctx(desc->tfm); if (state->buflen) { memset(&state->buffer[state->buflen], 0, NH_MESSAG...
[ 1, 0 ]
Linux Kernel
crypto/nhpoly1305.c
static void __exit nhpoly1305_mod_exit(void) { crypto_unregister_shash(&nhpoly1305_alg); }
[ 0, 0 ]
Linux Kernel
crypto/pcbc.c
static int crypto_pcbc_encrypt_inplace(struct skcipher_request *req, struct skcipher_walk *walk, struct crypto_cipher *tfm) { int bsize = crypto_cipher_blocksize(tfm); unsigned int nbytes = walk->nbytes; u8 *src = walk->src.virt.addr; ...
[ 1, 0 ]
Linux Kernel
crypto/pcbc.c
static int crypto_pcbc_decrypt_segment(struct skcipher_request *req, struct skcipher_walk *walk, struct crypto_cipher *tfm) { int bsize = crypto_cipher_blocksize(tfm); unsigned int nbytes = walk->nbytes; u8 *src = walk->src.virt.addr; ...
[ 1, 0 ]
Linux Kernel
crypto/pcrypt.c
static int pcrypt_aead_setkey(struct crypto_aead *parent, const u8 *key, unsigned int keylen) { struct pcrypt_aead_ctx *ctx = crypto_aead_ctx(parent); return crypto_aead_setkey(ctx->child, key, keylen); }
[ 0, 0 ]
Linux Kernel
crypto/pcrypt.c
static void pcrypt_aead_serial(struct padata_priv *padata) { struct pcrypt_request *preq = pcrypt_padata_request(padata); struct aead_request *req = pcrypt_request_ctx(preq); aead_request_complete(req->base.data, padata->info); }
[ 0, 0 ]
Linux Kernel
crypto/pcrypt.c
static void pcrypt_aead_done(struct crypto_async_request *areq, int err) { struct aead_request *req = areq->data; struct pcrypt_request *preq = aead_request_ctx(req); struct padata_priv *padata = pcrypt_request_padata(preq); padata->info = err; padata_do_serial(padata); }
[ 0, 0 ]
Linux Kernel
crypto/pcrypt.c
static int pcrypt_create_aead(struct crypto_template *tmpl, struct rtattr **tb, struct crypto_attr_type *algt) { struct pcrypt_instance_ctx *ctx; struct aead_instance *inst; struct aead_alg *alg; u32 mask = crypto_algt_inherited_mask(algt); int err; inst = kzalloc(sizeof(*ins...
[ 1, 0 ]
Linux Kernel
crypto/pcrypt.c
static int pcrypt_init_padata(struct padata_instance **pinst, const char *name) { int ret = -ENOMEM; *pinst = padata_alloc(name); if (!*pinst) return ret; ret = pcrypt_sysfs_add(*pinst, name); if (ret) padata_free(*pinst); return ret; }
[ 0, 0 ]
Linux Kernel
crypto/pcrypt.c
static void __exit pcrypt_exit(void) { crypto_unregister_template(&pcrypt_tmpl); padata_free(pencrypt); padata_free(pdecrypt); kset_unregister(pcrypt_kset); }
[ 0, 0 ]
Linux Kernel
crypto/poly1305_generic.c
static unsigned int crypto_poly1305_setdesckey(struct poly1305_desc_ctx *dctx, const u8 *src, unsigned int srclen) { if (!dctx->sset) { if (!dctx->rset && srclen >= POLY1305_BLOCK_SIZE) { poly1305_core_setkey(&dct...
[ 1, 0 ]
Linux Kernel
crypto/poly1305_generic.c
static int crypto_poly1305_final(struct shash_desc *desc, u8 *dst) { struct poly1305_desc_ctx *dctx = shash_desc_ctx(desc); if (unlikely(!dctx->sset)) return -ENOKEY; poly1305_final_generic(dctx, dst); return 0; }
[ 0, 0 ]
Linux Kernel
crypto/polyval-generic.c
static void copy_and_reverse(u8 dst[POLYVAL_BLOCK_SIZE], const u8 src[POLYVAL_BLOCK_SIZE]) { u64 a = get_unaligned((const u64 *)&src[0]); u64 b = get_unaligned((const u64 *)&src[8]); put_unaligned(swab64(a), (u64 *)&dst[8]); put_unaligned(swab64(b), (u64 *)&dst[0]); }
[ 0, 0 ]
Linux Kernel
crypto/polyval-generic.c
static int polyval_setkey(struct crypto_shash *tfm, const u8 *key, unsigned int keylen) { struct polyval_tfm_ctx *ctx = crypto_shash_ctx(tfm); be128 k; if (keylen != POLYVAL_BLOCK_SIZE) return -EINVAL; gf128mul_free_4k(ctx->gf128); BUILD_BUG_ON(sizeof(k) != POLYVAL_BLOCK_SIZE...
[ 0, 0 ]
Linux Kernel
crypto/polyval-generic.c
static void polyval_exit_tfm(struct crypto_tfm *tfm) { struct polyval_tfm_ctx *ctx = crypto_tfm_ctx(tfm); gf128mul_free_4k(ctx->gf128); }
[ 0, 0 ]
Linux Kernel
crypto/proc.c
static void c_stop(struct seq_file *m, void *p) { up_read(&crypto_alg_sem); }
[ 0, 0 ]
Linux Kernel
crypto/rmd160.c
static int rmd160_init(struct shash_desc *desc) { struct rmd160_ctx *rctx = shash_desc_ctx(desc); rctx->byte_count = 0; rctx->state[0] = RMD_H0; rctx->state[1] = RMD_H1; rctx->state[2] = RMD_H2; rctx->state[3] = RMD_H3; rctx->state[4] = RMD_H4; memset(rctx->buffer, 0, sizeof(rctx->buffer)); retur...
[ 1, 0 ]
Linux Kernel
crypto/rmd160.c
static int rmd160_final(struct shash_desc *desc, u8 *out) { struct rmd160_ctx *rctx = shash_desc_ctx(desc); u32 i, index, padlen; __le64 bits; __le32 *dst = (__le32 *)out; static const u8 padding[64] = { 0x80, }; bits = cpu_to_le64(rctx->byte_count << 3); index = rctx->byte_count & 0x3f; padle...
[ 1, 0 ]
Linux Kernel
crypto/rng.c
static int crypto_rng_report(struct sk_buff *skb, struct crypto_alg *alg) { return -ENOSYS; } #endif
[ 0, 0 ]
Linux Kernel
crypto/rng.c
static void crypto_rng_show(struct seq_file *m, struct crypto_alg *alg) { seq_printf(m, "type : rng\n"); seq_printf(m, "seedsize : %u\n", seedsize(alg)); }
[ 0, 0 ]
Linux Kernel
crypto/rng.c
int crypto_get_default_rng(void) { struct crypto_rng *rng; int err; mutex_lock(&crypto_default_rng_lock); if (!crypto_default_rng) { rng = crypto_alloc_rng("stdrng", 0, 0); err = PTR_ERR(rng); if (IS_ERR(rng)) goto unlock; err = crypto_rng_reset(rng, NULL, crypto_rng_seedsize(rng)); ...
[ 0, 0 ]
Linux Kernel
crypto/rng.c
void crypto_unregister_rng(struct rng_alg *alg) { crypto_unregister_alg(&alg->base); }
[ 0, 0 ]
Linux Kernel
crypto/rng.c
int crypto_register_rngs(struct rng_alg *algs, int count) { int i, ret; for (i = 0; i < count; i++) { ret = crypto_register_rng(algs + i); if (ret) goto err; } return 0; err: for (--i; i >= 0; --i) crypto_unregister_rng(algs + i); return ret; }
[ 0, 0 ]
Linux Kernel
crypto/rsa-pkcs1pad.c
static const struct rsa_asn1_template *rsa_lookup_asn1(const char *name) { const struct rsa_asn1_template *p; for (p = rsa_asn1_templates; p->name; p++) if (strcmp(name, p->name) == 0) return p; return NULL; }
[ 0, 0 ]
Linux Kernel
crypto/rsa-pkcs1pad.c
static int pkcs1pad_set_pub_key(struct crypto_akcipher *tfm, const void *key, unsigned int keylen) { struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm); int err; ctx->key_size = 0; err = crypto_akcipher_set_pub_key(ctx->child, key, keylen); if (err) return err; err = cry...
[ 0, 0 ]
Linux Kernel
crypto/rsa-pkcs1pad.c
static int pkcs1pad_set_priv_key(struct crypto_akcipher *tfm, const void *key, unsigned int keylen) { struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm); int err; ctx->key_size = 0; err = crypto_akcipher_set_priv_key(ctx->child, key, keylen); if (err) return err; err = ...
[ 0, 0 ]
Linux Kernel
crypto/rsa-pkcs1pad.c
static int pkcs1pad_encrypt_sign_complete(struct akcipher_request *req, int err) { struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req); struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm); struct pkcs1pad_request *req_ctx = akcipher_request_ctx(req); unsigned int pad...
[ 0, 0 ]
Linux Kernel
crypto/rsa-pkcs1pad.c
static int pkcs1pad_encrypt(struct akcipher_request *req) { struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req); struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm); struct pkcs1pad_request *req_ctx = akcipher_request_ctx(req); int err; unsigned int i, ps_end; if (!ctx->key_size) return -EINVAL; ...
[ 1, 0 ]
Linux Kernel
crypto/rsa-pkcs1pad.c
static int pkcs1pad_decrypt_complete(struct akcipher_request *req, int err) { struct crypto_akcipher *tfm = crypto_akcipher_reqtfm(req); struct pkcs1pad_ctx *ctx = akcipher_tfm_ctx(tfm); struct pkcs1pad_request *req_ctx = akcipher_request_ctx(req); unsigned int dst_len; unsigned int pos; u8 *out_buf; if ...
[ 1, 0 ]
Linux Kernel
crypto/rsa-pkcs1pad.c
static void pkcs1pad_verify_complete_cb(struct crypto_async_request *child_async_req, int err) { struct akcipher_request *req = child_async_req->data; struct crypto_async_request async_req; if (err == -EINPROGRESS) return; async_req.data = req->base.data; async_req.tfm = cry...
[ 0, 0 ]
Linux Kernel
crypto/rsa.c
static unsigned int rsa_max_size(struct crypto_akcipher *tfm) { struct rsa_mpi_key *pkey = akcipher_tfm_ctx(tfm); return mpi_get_size(pkey->n); }
[ 0, 0 ]
Linux Kernel
crypto/rsa_helper.c
int rsa_get_e(void *context, size_t hdrlen, unsigned char tag, const void *value, size_t vlen) { struct rsa_key *key = context; if (!value || !key->n_sz || !vlen || vlen > key->n_sz) return -EINVAL; key->e = value; key->e_sz = vlen; return 0; }
[ 1, 0 ]
Linux Kernel
crypto/rsa_helper.c
int rsa_get_p(void *context, size_t hdrlen, unsigned char tag, const void *value, size_t vlen) { struct rsa_key *key = context; if (!value || !vlen || vlen > key->n_sz) return -EINVAL; key->p = value; key->p_sz = vlen; return 0; }
[ 1, 0 ]
Linux Kernel
crypto/rsa_helper.c
int rsa_get_q(void *context, size_t hdrlen, unsigned char tag, const void *value, size_t vlen) { struct rsa_key *key = context; if (!value || !vlen || vlen > key->n_sz) return -EINVAL; key->q = value; key->q_sz = vlen; return 0; }
[ 1, 0 ]
Linux Kernel
crypto/scatterwalk.c
static inline void memcpy_dir(void *buf, void *sgdata, size_t nbytes, int out) { void *src = out ? buf : sgdata; void *dst = out ? sgdata : buf; memcpy(dst, src, nbytes); }
[ 1, 0 ]
Linux Kernel
crypto/scompress.c
static int crypto_scomp_alloc_scratches(void) { struct scomp_scratch *scratch; int i; for_each_possible_cpu(i) { void *mem; scratch = per_cpu_ptr(&scomp_scratch, i); mem = vmalloc_node(SCOMP_SCRATCH_SIZE, cpu_to_node(i)); if (!mem) goto error; scratch->src = mem; mem = vmalloc_no...
[ 0, 0 ]
Linux Kernel
crypto/scompress.c
static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir) { struct crypto_acomp *tfm = crypto_acomp_reqtfm(req); void **tfm_ctx = acomp_tfm_ctx(tfm); struct crypto_scomp *scomp = *tfm_ctx; void **ctx = acomp_request_ctx(req); struct scomp_scratch *scratch; int ret; if (!req->src || !req->slen |...
[ 1, 0 ]
Linux Kernel
crypto/scompress.c
int crypto_init_scomp_ops_async(struct crypto_tfm *tfm) { struct crypto_alg *calg = tfm->__crt_alg; struct crypto_acomp *crt = __crypto_acomp_tfm(tfm); struct crypto_scomp **ctx = crypto_tfm_ctx(tfm); struct crypto_scomp *scomp; if (!crypto_mod_get(calg)) return -EAGAIN; scomp = crypto_create_tfm(cal...
[ 1, 0 ]
Linux Kernel
crypto/scompress.c
void crypto_acomp_scomp_free_ctx(struct acomp_req *req) { struct crypto_acomp *acomp = crypto_acomp_reqtfm(req); struct crypto_tfm *tfm = crypto_acomp_tfm(acomp); struct crypto_scomp **tfm_ctx = crypto_tfm_ctx(tfm); struct crypto_scomp *scomp = *tfm_ctx; void *ctx = *req->__ctx; if (ctx) crypto_scomp_...
[ 0, 0 ]