Home
last modified time | relevance | path

Searched refs:len (Results 1 – 25 of 69) sorted by relevance

123

/crypto/
Dtestmgr.h72 unsigned int len; member
7227 .len = 8,
7233 .len = 8,
7239 .len = 8,
7249 .len = 24,
7257 .len = 8,
7265 .len = 16,
7273 .len = 16,
7285 .len = 32,
7351 .len = 248,
[all …]
Dalgif_rng.c54 unsigned int len; member
58 static int rng_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, in rng_recvmsg() argument
68 if (len == 0) in rng_recvmsg()
70 if (len > MAXSIZE) in rng_recvmsg()
71 len = MAXSIZE; in rng_recvmsg()
77 memset(result, 0, len); in rng_recvmsg()
85 genlen = crypto_rng_get_bytes(ctx->drng, result, len); in rng_recvmsg()
89 err = memcpy_to_msg(msg, result, len); in rng_recvmsg()
90 memzero_explicit(result, len); in rng_recvmsg()
92 return err ? err : len; in rng_recvmsg()
[all …]
Dxcbc.c44 unsigned int len; member
78 ctx->len = 0; in crypto_xcbc_digest_init()
85 unsigned int len) in crypto_xcbc_digest_update() argument
97 if ((ctx->len + len) <= bs) { in crypto_xcbc_digest_update()
98 memcpy(odds + ctx->len, p, len); in crypto_xcbc_digest_update()
99 ctx->len += len; in crypto_xcbc_digest_update()
104 memcpy(odds + ctx->len, p, bs - ctx->len); in crypto_xcbc_digest_update()
105 len -= bs - ctx->len; in crypto_xcbc_digest_update()
106 p += bs - ctx->len; in crypto_xcbc_digest_update()
112 ctx->len = 0; in crypto_xcbc_digest_update()
[all …]
Dcmac.c45 unsigned int len; member
111 ctx->len = 0; in crypto_cmac_digest_init()
118 unsigned int len) in crypto_cmac_digest_update() argument
130 if ((ctx->len + len) <= bs) { in crypto_cmac_digest_update()
131 memcpy(odds + ctx->len, p, len); in crypto_cmac_digest_update()
132 ctx->len += len; in crypto_cmac_digest_update()
137 memcpy(odds + ctx->len, p, bs - ctx->len); in crypto_cmac_digest_update()
138 len -= bs - ctx->len; in crypto_cmac_digest_update()
139 p += bs - ctx->len; in crypto_cmac_digest_update()
145 ctx->len = 0; in crypto_cmac_digest_update()
[all …]
Ddrbg.c333 size_t len = curr->len; in drbg_ctr_bcc() local
335 while (len) { in drbg_ctr_bcc()
346 len--; in drbg_ctr_bcc()
434 inputlen += seed->len; in drbg_ctr_df()
598 int len = min_t(int, buflen, INT_MAX); in drbg_ctr_generate() local
608 ret = drbg_kcapi_sym_ctr(drbg, NULL, 0, buf, len); in drbg_ctr_generate()
615 len = ret; in drbg_ctr_generate()
617 return len; in drbg_ctr_generate()
710 int len = 0; in drbg_hmac_generate() local
724 while (len < buflen) { in drbg_hmac_generate()
[all …]
Dalgif_skcipher.c62 size_t len = 0; in _skcipher_recvmsg() local
77 err = af_alg_get_rsgl(sk, msg, flags, areq, -1, &len); in _skcipher_recvmsg()
82 if (len > ctx->used) in _skcipher_recvmsg()
83 len = ctx->used; in _skcipher_recvmsg()
89 if (ctx->more || len < ctx->used) in _skcipher_recvmsg()
90 len -= len % bs; in _skcipher_recvmsg()
96 areq->tsgl_entries = af_alg_count_tsgl(sk, len, 0); in _skcipher_recvmsg()
107 af_alg_pull_tsgl(sk, len, areq->tsgl, 0); in _skcipher_recvmsg()
112 areq->first_rsgl.sgl.sg, len, ctx->iv); in _skcipher_recvmsg()
120 areq->outlen = len; in _skcipher_recvmsg()
[all …]
Dalgif_hash.c26 unsigned int len; member
89 int len = msg_data_left(msg); in hash_sendmsg() local
91 if (len > limit) in hash_sendmsg()
92 len = limit; in hash_sendmsg()
94 len = af_alg_make_sg(&ctx->sgl, &msg->msg_iter, len); in hash_sendmsg()
95 if (len < 0) { in hash_sendmsg()
96 err = copied ? 0 : len; in hash_sendmsg()
100 ahash_request_set_crypt(&ctx->req, ctx->sgl.sg, NULL, len); in hash_sendmsg()
108 copied += len; in hash_sendmsg()
109 iov_iter_advance(&msg->msg_iter, len); in hash_sendmsg()
[all …]
Dcrc32_generic.c82 unsigned int len) in crc32_update() argument
86 *crcp = crc32_le(*crcp, data, len); in crc32_update()
91 static int __crc32_finup(u32 *crcp, const u8 *data, unsigned int len, in __crc32_finup() argument
94 put_unaligned_le32(crc32_le(*crcp, data, len), out); in __crc32_finup()
99 unsigned int len, u8 *out) in crc32_finup() argument
101 return __crc32_finup(shash_desc_ctx(desc), data, len, out); in crc32_finup()
113 unsigned int len, u8 *out) in crc32_digest() argument
115 return __crc32_finup(crypto_shash_ctx(desc->tfm), data, len, in crc32_digest()
Decdh_helper.c33 int crypto_ecdh_encode_key(char *buf, unsigned int len, in crypto_ecdh_encode_key() argument
39 .len = len in crypto_ecdh_encode_key()
45 if (len != crypto_ecdh_key_len(params)) in crypto_ecdh_encode_key()
57 int crypto_ecdh_decode_key(const char *buf, unsigned int len, in crypto_ecdh_decode_key() argument
63 if (unlikely(!buf || len < ECDH_KPP_SECRET_MIN_SIZE)) in crypto_ecdh_decode_key()
72 if (secret.len != crypto_ecdh_key_len(params)) in crypto_ecdh_decode_key()
Dmichael_mic.c60 unsigned int len) in michael_update() argument
67 if (flen > len) in michael_update()
68 flen = len; in michael_update()
72 len -= flen; in michael_update()
85 while (len >= 4) { in michael_update()
88 len -= 4; in michael_update()
91 if (len > 0) { in michael_update()
92 mctx->pending_len = len; in michael_update()
93 memcpy(mctx->pending, src, len); in michael_update()
Dscatterwalk.c74 unsigned int len) in scatterwalk_ffwd() argument
77 if (!len) in scatterwalk_ffwd()
80 if (src->length > len) in scatterwalk_ffwd()
83 len -= src->length; in scatterwalk_ffwd()
88 sg_set_page(dst, sg_page(src), src->length - len, src->offset + len); in scatterwalk_ffwd()
Ddh_helper.c40 int crypto_dh_encode_key(char *buf, unsigned int len, const struct dh *params) in crypto_dh_encode_key() argument
43 u8 * const end = ptr + len; in crypto_dh_encode_key()
46 .len = len in crypto_dh_encode_key()
49 if (unlikely(!len)) in crypto_dh_encode_key()
68 int crypto_dh_decode_key(const char *buf, unsigned int len, struct dh *params) in crypto_dh_decode_key() argument
73 if (unlikely(!buf || len < DH_KPP_SECRET_MIN_SIZE)) in crypto_dh_decode_key()
84 if (secret.len != crypto_dh_key_len(params)) in crypto_dh_decode_key()
Dshash.c81 unsigned int len) in shash_update_unaligned() argument
99 if (unaligned_len > len) in shash_update_unaligned()
100 unaligned_len = len; in shash_update_unaligned()
107 shash->update(desc, data + unaligned_len, len - unaligned_len); in shash_update_unaligned()
111 unsigned int len) in crypto_shash_update() argument
118 return shash_update_unaligned(desc, data, len); in crypto_shash_update()
120 return shash->update(desc, data, len); in crypto_shash_update()
166 unsigned int len, u8 *out) in shash_finup_unaligned() argument
168 return crypto_shash_update(desc, data, len) ?: in shash_finup_unaligned()
173 unsigned int len, u8 *out) in crypto_shash_finup() argument
[all …]
Dsha1_generic.c44 unsigned int len) in crypto_sha1_update() argument
46 return sha1_base_do_update(desc, data, len, sha1_generic_block_fn); in crypto_sha1_update()
57 unsigned int len, u8 *out) in crypto_sha1_finup() argument
59 sha1_base_do_update(desc, data, len, sha1_generic_block_fn); in crypto_sha1_finup()
Dcrct10dif_generic.c68 static int __chksum_finup(__u16 crc, const u8 *data, unsigned int len, u8 *out) in __chksum_finup() argument
70 *(__u16 *)out = crc_t10dif_generic(crc, data, len); in __chksum_finup()
75 unsigned int len, u8 *out) in chksum_finup() argument
79 return __chksum_finup(ctx->crc, data, len, out); in chksum_finup()
Daf_alg.c393 int af_alg_make_sg(struct af_alg_sgl *sgl, struct iov_iter *iter, int len) in af_alg_make_sg() argument
399 n = iov_iter_get_pages(iter, sgl->pages, len, ALG_MAX_PAGES, &off); in af_alg_make_sg()
409 for (i = 0, len = n; i < npages; i++) { in af_alg_make_sg()
410 int plen = min_t(int, len, PAGE_SIZE - off); in af_alg_make_sg()
415 len -= plen; in af_alg_make_sg()
865 size_t len = size; in af_alg_sendmsg() local
873 len = min_t(size_t, len, in af_alg_sendmsg()
878 msg, len); in af_alg_sendmsg()
882 sg->length += len; in af_alg_sendmsg()
886 ctx->used += len; in af_alg_sendmsg()
[all …]
Dsha256_generic.c47 unsigned int len) in crypto_sha256_update() argument
49 return sha256_update(shash_desc_ctx(desc), data, len); in crypto_sha256_update()
62 unsigned int len, u8 *hash) in crypto_sha256_finup() argument
64 sha256_update(shash_desc_ctx(desc), data, len); in crypto_sha256_finup()
Dalgboss.c96 unsigned int len; in cryptomgr_schedule_probe() local
109 len = p - name; in cryptomgr_schedule_probe()
110 if (!len || *p != '(') in cryptomgr_schedule_probe()
113 memcpy(param->template, name, len); in cryptomgr_schedule_probe()
140 len = p - name; in cryptomgr_schedule_probe()
141 if (!len) in cryptomgr_schedule_probe()
148 memcpy(param->attrs[i].alg.data.name, name, len); in cryptomgr_schedule_probe()
Dstreebog_generic.c1003 unsigned int len) in streebog_update() argument
1010 if (chunksize > len) in streebog_update()
1011 chunksize = len; in streebog_update()
1014 len -= chunksize; in streebog_update()
1023 while (len >= STREEBOG_BLOCK_SIZE) { in streebog_update()
1026 len -= STREEBOG_BLOCK_SIZE; in streebog_update()
1029 if (len) { in streebog_update()
1030 memcpy(&ctx->buffer, data, len); in streebog_update()
1031 ctx->fillsize = len; in streebog_update()
/crypto/async_tx/
Dasync_xor.c66 xor_src_cnt, unmap->len, in do_async_xor()
77 xor_src_cnt, unmap->len, in do_async_xor()
101 int src_cnt, size_t len, struct async_submit_ctl *submit) in do_sync_xor() argument
123 memset(dest_buf, 0, len); in do_sync_xor()
128 xor_blocks(xor_src_cnt, len, dest_buf, &srcs[src_off]); in do_sync_xor()
161 int src_cnt, size_t len, struct async_submit_ctl *submit) in async_xor() argument
165 src_cnt, len); in async_xor()
174 if (unmap && is_dma_xor_aligned(device, offset, 0, len)) { in async_xor()
179 pr_debug("%s (async): len: %zu\n", __func__, len); in async_xor()
181 unmap->len = len; in async_xor()
[all …]
Dasync_pq.c81 &scfs[src_off], unmap->len, in do_async_gen_syndrome()
108 size_t len, struct async_submit_ctl *submit) in do_sync_gen_syndrome() argument
135 raid6_call.xor_syndrome(disks, start, stop, len, srcs); in do_sync_gen_syndrome()
137 raid6_call.gen_syndrome(disks, len, srcs); in do_sync_gen_syndrome()
164 size_t len, struct async_submit_ctl *submit) in async_gen_syndrome() argument
169 blocks, src_cnt, len); in async_gen_syndrome()
182 is_dma_pq_aligned(device, offset, 0, len)) { in async_gen_syndrome()
190 __func__, disks, len); in async_gen_syndrome()
195 unmap->len = len; in async_gen_syndrome()
200 len, DMA_TO_DEVICE); in async_gen_syndrome()
[all …]
Dasync_memcpy.c33 unsigned int src_offset, size_t len, in async_memcpy() argument
37 &dest, 1, &src, 1, len); in async_memcpy()
45 if (unmap && is_dma_copy_aligned(device, src_offset, dest_offset, len)) { in async_memcpy()
54 unmap->addr[0] = dma_map_page(device->dev, src, src_offset, len, in async_memcpy()
57 unmap->addr[1] = dma_map_page(device->dev, dest, dest_offset, len, in async_memcpy()
59 unmap->len = len; in async_memcpy()
62 unmap->addr[0], len, in async_memcpy()
67 pr_debug("%s: (async) len: %zu\n", __func__, len); in async_memcpy()
73 pr_debug("%s: (sync) len: %zu\n", __func__, len); in async_memcpy()
81 memcpy(dest_buf, src_buf, len); in async_memcpy()
Dasync_raid6_recov.c19 size_t len, struct async_submit_ctl *submit) in async_sum_product() argument
22 &dest, 1, srcs, 2, len); in async_sum_product()
40 unmap->addr[0] = dma_map_page(dev, srcs[0], 0, len, DMA_TO_DEVICE); in async_sum_product()
41 unmap->addr[1] = dma_map_page(dev, srcs[1], 0, len, DMA_TO_DEVICE); in async_sum_product()
44 unmap->addr[2] = dma_map_page(dev, dest, 0, len, DMA_BIDIRECTIONAL); in async_sum_product()
49 unmap->len = len; in async_sum_product()
51 len, dma_flags); in async_sum_product()
73 while (len--) { in async_sum_product()
83 async_mult(struct page *dest, struct page *src, u8 coef, size_t len, in async_mult() argument
87 &dest, 1, &src, 1, len); in async_mult()
[all …]
/crypto/asymmetric_keys/
Dasym_tpm.c325 static inline uint32_t definite_length(uint32_t len) in definite_length() argument
327 if (len <= 127) in definite_length()
329 if (len <= 255) in definite_length()
335 uint32_t len) in encode_tag_length() argument
339 if (len <= 127) { in encode_tag_length()
340 buf[0] = len; in encode_tag_length()
344 if (len <= 255) { in encode_tag_length()
346 buf[1] = len; in encode_tag_length()
351 put_unaligned_be16(len, buf + 1); in encode_tag_length()
355 static uint32_t derive_pub_key(const void *pub_key, uint32_t len, uint8_t *buf) in derive_pub_key() argument
[all …]
Dasymmetric_type.c55 int len; in find_asymmetric_key() local
61 len = id_0->len; in find_asymmetric_key()
64 len = id_1->len; in find_asymmetric_key()
68 p = req = kmalloc(2 + 1 + len * 2 + 1, GFP_KERNEL); in find_asymmetric_key()
80 p = bin2hex(p, lookup, len); in find_asymmetric_key()
146 kid->len = len_1 + len_2; in asymmetric_key_generate_id()
162 if (kid1->len != kid2->len) in asymmetric_key_id_same()
164 return memcmp(kid1->data, kid2->data, kid1->len) == 0; in asymmetric_key_id_same()
178 if (kid1->len < kid2->len) in asymmetric_key_id_partial()
180 return memcmp(kid1->data + (kid1->len - kid2->len), in asymmetric_key_id_partial()
[all …]

123