/crypto/ |
D | scatterwalk.c | 18 static inline void memcpy_dir(void *buf, void *sgdata, size_t nbytes, int out) in memcpy_dir() argument 20 void *src = out ? buf : sgdata; in memcpy_dir() 21 void *dst = out ? sgdata : buf; in memcpy_dir() 26 void scatterwalk_copychunks(void *buf, struct scatter_walk *walk, in scatterwalk_copychunks() argument 38 memcpy_dir(buf, vaddr, len_this_page, out); in scatterwalk_copychunks() 47 buf += len_this_page; in scatterwalk_copychunks() 55 void scatterwalk_map_and_copy(void *buf, struct scatterlist *sg, in scatterwalk_map_and_copy() argument 67 scatterwalk_copychunks(buf, &walk, nbytes, out); in scatterwalk_map_and_copy()
|
D | ecdh_helper.c | 33 int crypto_ecdh_encode_key(char *buf, unsigned int len, in crypto_ecdh_encode_key() argument 36 u8 *ptr = buf; in crypto_ecdh_encode_key() 42 if (unlikely(!buf)) in crypto_ecdh_encode_key() 56 int crypto_ecdh_decode_key(const char *buf, unsigned int len, in crypto_ecdh_decode_key() argument 59 const u8 *ptr = buf; in crypto_ecdh_decode_key() 62 if (unlikely(!buf || len < ECDH_KPP_SECRET_MIN_SIZE)) in crypto_ecdh_decode_key()
|
D | curve25519-generic.c | 9 static int curve25519_set_secret(struct crypto_kpp *tfm, const void *buf, in curve25519_set_secret() argument 17 crypto_memneq(buf, curve25519_null_point, CURVE25519_KEY_SIZE)) in curve25519_set_secret() 18 memcpy(secret, buf, CURVE25519_KEY_SIZE); in curve25519_set_secret() 29 u8 buf[CURVE25519_KEY_SIZE]; in curve25519_compute_value() local 45 curve25519_generic(buf, secret, bp); in curve25519_compute_value() 51 buf, nbytes); in curve25519_compute_value()
|
D | rng.c | 34 u8 *buf = NULL; in crypto_rng_reset() local 38 buf = kmalloc(slen, GFP_KERNEL); in crypto_rng_reset() 39 if (!buf) in crypto_rng_reset() 42 err = get_random_bytes_wait(buf, slen); in crypto_rng_reset() 45 seed = buf; in crypto_rng_reset() 52 kfree_sensitive(buf); in crypto_rng_reset()
|
D | ecdh.c | 26 static int ecdh_set_secret(struct crypto_kpp *tfm, const void *buf, in ecdh_set_secret() argument 32 if (crypto_ecdh_decode_key(buf, len, ¶ms) < 0 || in ecdh_set_secret() 56 void *buf; in ecdh_compute_value() local 91 buf = shared_secret; in ecdh_compute_value() 95 buf = public_key; in ecdh_compute_value() 106 buf, nbytes); in ecdh_compute_value()
|
D | dh_helper.c | 40 int crypto_dh_encode_key(char *buf, unsigned int len, const struct dh *params) in crypto_dh_encode_key() argument 42 u8 *ptr = buf; 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 70 const u8 *ptr = buf; in crypto_dh_decode_key() 73 if (unlikely(!buf || len < DH_KPP_SECRET_MIN_SIZE)) in crypto_dh_decode_key()
|
D | sha3_generic.c | 188 memcpy(sctx->buf + sctx->partial, data, in crypto_sha3_update() 190 src = sctx->buf; in crypto_sha3_update() 206 memcpy(sctx->buf + sctx->partial, src, len - done); in crypto_sha3_update() 220 sctx->buf[inlen++] = 0x06; in crypto_sha3_final() 221 memset(sctx->buf + inlen, 0, sctx->rsiz - inlen); in crypto_sha3_final() 222 sctx->buf[sctx->rsiz - 1] |= 0x80; in crypto_sha3_final() 225 sctx->st[i] ^= get_unaligned_le64(sctx->buf + 8 * i); in crypto_sha3_final()
|
D | drbg.c | 283 static inline void drbg_cpu_to_be32(__u32 val, unsigned char *buf) in drbg_cpu_to_be32() argument 288 struct s *conversion = (struct s *) buf; in drbg_cpu_to_be32() 333 const unsigned char *pos = curr->buf; in drbg_ctr_bcc() 595 unsigned char *buf, unsigned int buflen, in drbg_ctr_generate() argument 609 ret = drbg_kcapi_sym_ctr(drbg, NULL, 0, buf, len); in drbg_ctr_generate() 686 seed2.buf = &prefix; in drbg_hmac_update() 707 unsigned char *buf, in drbg_hmac_generate() argument 735 memcpy(buf + len, drbg->V, outlen); in drbg_hmac_generate() 936 unsigned char *buf, in drbg_hash_hashgen() argument 962 memcpy(buf + len, dst, outlen); in drbg_hash_hashgen() [all …]
|
D | sm2.c | 137 unsigned char *buf; in sm2_ecc_os2ec() local 141 buf = kmalloc(n, GFP_KERNEL); in sm2_ecc_os2ec() 142 if (!buf) in sm2_ecc_os2ec() 145 rc = mpi_print(GCRYMPI_FMT_USG, buf, n, &n, value); in sm2_ecc_os2ec() 153 if (*buf != 0x4) in sm2_ecc_os2ec() 158 x = mpi_read_raw_data(buf + 1, n); in sm2_ecc_os2ec() 161 y = mpi_read_raw_data(buf + 1 + n, n); in sm2_ecc_os2ec() 177 kfree(buf); in sm2_ecc_os2ec()
|
D | ansi_cprng.c | 53 static void hexdump(char *note, unsigned char *buf, unsigned int len) in hexdump() argument 59 buf, len, false); in hexdump() 181 static int get_prng_bytes(char *buf, size_t nbytes, struct prng_context *ctx, in get_prng_bytes() argument 184 unsigned char *ptr = buf; in get_prng_bytes() 219 memset(buf, 0, nbytes); in get_prng_bytes() 246 memset(buf, 0, nbytes); in get_prng_bytes()
|
D | shash.c | 104 u8 *buf = PTR_ALIGN(&ubuf[0], alignmask + 1); in shash_update_unaligned() local 107 if (WARN_ON(buf + unaligned_len > ubuf + sizeof(ubuf))) in shash_update_unaligned() 113 memcpy(buf, data, unaligned_len); in shash_update_unaligned() 114 err = shash->update(desc, buf, unaligned_len); in shash_update_unaligned() 115 memset(buf, 0, unaligned_len); in shash_update_unaligned() 146 u8 *buf = PTR_ALIGN(&ubuf[0], alignmask + 1); in shash_final_unaligned() local 149 if (WARN_ON(buf + ds > ubuf + sizeof(ubuf))) in shash_final_unaligned() 152 err = shash->final(desc, buf); in shash_final_unaligned() 156 memcpy(out, buf, ds); in shash_final_unaligned() 159 memset(buf, 0, ds); in shash_final_unaligned()
|
D | poly1305_generic.c | 80 memcpy(dctx->buf + dctx->buflen, src, bytes); in crypto_poly1305_update() 86 poly1305_blocks(dctx, dctx->buf, in crypto_poly1305_update() 100 memcpy(dctx->buf, src, srclen); in crypto_poly1305_update()
|
D | aegis128-neon-inner.c | 245 uint8_t buf[AEGIS_BLOCK_SIZE]; in crypto_aegis128_encrypt_chunk_neon() local 251 in = out = memcpy(buf + AEGIS_BLOCK_SIZE - size, src, size); in crypto_aegis128_encrypt_chunk_neon() 291 uint8_t buf[AEGIS_BLOCK_SIZE]; in crypto_aegis128_decrypt_chunk_neon() local 297 in = out = memcpy(buf + AEGIS_BLOCK_SIZE - size, src, size); in crypto_aegis128_decrypt_chunk_neon()
|
D | aegis128-core.c | 282 union aegis_block buf; in crypto_aegis128_process_ad() local 295 memcpy(buf.bytes + pos, src, fill); in crypto_aegis128_process_ad() 296 crypto_aegis128_update_a(state, &buf, do_simd); in crypto_aegis128_process_ad() 307 memcpy(buf.bytes + pos, src, left); in crypto_aegis128_process_ad() 317 memset(buf.bytes + pos, 0, AEGIS_BLOCK_SIZE - pos); in crypto_aegis128_process_ad() 318 crypto_aegis128_update_a(state, &buf, do_simd); in crypto_aegis128_process_ad()
|
D | ghash-generic.c | 135 u8 *buf = dctx->buffer; in ghash_final() local 138 memcpy(dst, buf, GHASH_BLOCK_SIZE); in ghash_final()
|
D | testmgr.c | 161 static void hexdump(unsigned char *buf, unsigned int len) in hexdump() argument 165 buf, len, false); in hexdump() 168 static int __testmgr_alloc_buf(char *buf[XBUFSIZE], int order) in __testmgr_alloc_buf() 173 buf[i] = (char *)__get_free_pages(GFP_KERNEL, order); in __testmgr_alloc_buf() 174 if (!buf[i]) in __testmgr_alloc_buf() 182 free_pages((unsigned long)buf[i], order); in __testmgr_alloc_buf() 187 static int testmgr_alloc_buf(char *buf[XBUFSIZE]) in testmgr_alloc_buf() 189 return __testmgr_alloc_buf(buf, 0); in testmgr_alloc_buf() 192 static void __testmgr_free_buf(char *buf[XBUFSIZE], int order) in __testmgr_free_buf() 197 free_pages((unsigned long)buf[i], order); in __testmgr_free_buf() [all …]
|
D | dh.c | 75 static int dh_set_secret(struct crypto_kpp *tfm, const void *buf, in dh_set_secret() argument 84 if (crypto_dh_decode_key(buf, len, ¶ms) < 0) in dh_set_secret()
|
D | streebog_generic.c | 989 struct streebog_uint512 buf = { { 0 } }; in streebog_stage3() local 991 buf.qword[0] = cpu_to_le64(ctx->fillsize << 3); in streebog_stage3() 995 streebog_add512(&ctx->N, &buf, &ctx->N); in streebog_stage3()
|
D | rsa-pkcs1pad.c | 162 static void pkcs1pad_sg_set_buf(struct scatterlist *sg, void *buf, size_t len, in pkcs1pad_sg_set_buf() argument 168 sg_set_buf(sg, buf, len); in pkcs1pad_sg_set_buf()
|
D | gcm.c | 78 u8 buf[16]; member 1142 sg_init_one(&gcm_zeroes->sg, gcm_zeroes->buf, sizeof(gcm_zeroes->buf)); in crypto_gcm_module_init()
|
D | tcrypt.c | 86 static int testmgr_alloc_buf(char *buf[XBUFSIZE]) in testmgr_alloc_buf() 91 buf[i] = (void *)__get_free_page(GFP_KERNEL); in testmgr_alloc_buf() 92 if (!buf[i]) in testmgr_alloc_buf() 100 free_page((unsigned long)buf[i]); in testmgr_alloc_buf() 105 static void testmgr_free_buf(char *buf[XBUFSIZE]) in testmgr_free_buf() 110 free_page((unsigned long)buf[i]); in testmgr_free_buf()
|
/crypto/asymmetric_keys/ |
D | public_key.c | 385 char *buf, *ptr; in public_key_verify_signature() local 427 buf = kmalloc(buf_len, GFP_KERNEL); in public_key_verify_signature() 428 if (!buf) in public_key_verify_signature() 431 memcpy(buf, pkey->key, pkey->keylen); in public_key_verify_signature() 432 ptr = buf + pkey->keylen; in public_key_verify_signature() 438 ret = crypto_akcipher_set_priv_key(tfm, buf, pkey->keylen); in public_key_verify_signature() 440 ret = crypto_akcipher_set_pub_key(tfm, buf, pkey->keylen); in public_key_verify_signature() 450 memcpy(buf, sig->s, sig->s_size); in public_key_verify_signature() 451 memcpy(buf + sig->s_size, sig->digest, sig->digest_size); in public_key_verify_signature() 453 sg_init_one(&src_sg, buf, sig->s_size + sig->digest_size); in public_key_verify_signature() [all …]
|
D | asym_tpm.c | 318 static inline uint8_t *encode_tag_length(uint8_t *buf, uint8_t tag, in encode_tag_length() argument 321 *buf++ = tag; in encode_tag_length() 324 buf[0] = len; in encode_tag_length() 325 return buf + 1; in encode_tag_length() 329 buf[0] = 0x81; in encode_tag_length() 330 buf[1] = len; in encode_tag_length() 331 return buf + 2; in encode_tag_length() 334 buf[0] = 0x82; in encode_tag_length() 335 put_unaligned_be16(len, buf + 1); in encode_tag_length() 336 return buf + 3; in encode_tag_length() [all …]
|
D | pkcs7_verify.c | 125 int pkcs7_get_digest(struct pkcs7_message *pkcs7, const u8 **buf, u32 *len, in pkcs7_get_digest() argument 141 *buf = sinfo->sig->digest; in pkcs7_get_digest()
|