Home
last modified time | relevance | path

Searched refs:keylen (Results 1 – 25 of 54) sorted by relevance

123

/crypto/
Dcipher.c21 unsigned int keylen) in setkey_unaligned() argument
29 absize = keylen + alignmask; in setkey_unaligned()
35 memcpy(alignbuffer, key, keylen); in setkey_unaligned()
36 ret = cia->cia_setkey(crypto_cipher_tfm(tfm), alignbuffer, keylen); in setkey_unaligned()
43 const u8 *key, unsigned int keylen) in crypto_cipher_setkey() argument
48 if (keylen < cia->cia_min_keysize || keylen > cia->cia_max_keysize) in crypto_cipher_setkey()
52 return setkey_unaligned(tfm, key, keylen); in crypto_cipher_setkey()
54 return cia->cia_setkey(crypto_cipher_tfm(tfm), key, keylen); in crypto_cipher_setkey()
Decdsa.c38 size_t keylen = ndigits * sizeof(u64); in ecdsa_get_signature_rs() local
39 ssize_t diff = vlen - keylen; in ecdsa_get_signature_rs()
61 if (-diff >= keylen) in ecdsa_get_signature_rs()
141 size_t keylen = ctx->curve->g.ndigits * sizeof(u64); in ecdsa_verify() local
168 diff = keylen - req->dst_len; in ecdsa_verify()
175 memcpy(&rawhash, buffer + req->src_len, keylen); in ecdsa_verify()
222 static int ecdsa_set_pub_key(struct crypto_akcipher *tfm, const void *key, unsigned int keylen) in ecdsa_set_pub_key() argument
234 if (keylen < 1 || (((keylen - 1) >> 1) % sizeof(u64)) != 0) in ecdsa_set_pub_key()
240 keylen--; in ecdsa_set_pub_key()
241 ndigits = (keylen >> 1) / sizeof(u64); in ecdsa_set_pub_key()
Dhmac.c42 const u8 *inkey, unsigned int keylen) in hmac_setkey() argument
55 if (fips_enabled && (keylen < 112 / 8)) in hmac_setkey()
60 if (keylen > bs) { in hmac_setkey()
63 err = crypto_shash_digest(shash, inkey, keylen, ipad); in hmac_setkey()
67 keylen = ds; in hmac_setkey()
69 memcpy(ipad, inkey, keylen); in hmac_setkey()
71 memset(ipad + keylen, 0, bs - keylen); in hmac_setkey()
Dblowfish_common.c345 int blowfish_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) in blowfish_setkey() argument
365 ((u32)key[(j + 1) % keylen] << 16) | in blowfish_setkey()
366 ((u32)key[(j + 2) % keylen] << 8) | in blowfish_setkey()
367 ((u32)key[(j + 3) % keylen])); in blowfish_setkey()
370 j = (j + 4) % keylen; in blowfish_setkey()
Dkdf_sp800108.c78 const u8 *key, size_t keylen, in crypto_kdf108_setkey() argument
88 if (ds > keylen) in crypto_kdf108_setkey()
92 return crypto_shash_setkey(kmd, key, keylen); in crypto_kdf108_setkey()
106 .keylen = 32,
Ddes_generic.c20 unsigned int keylen) in des_setkey() argument
25 err = des_expand_key(dctx, key, keylen); in des_setkey()
52 unsigned int keylen) in des3_ede_setkey() argument
57 err = des3_ede_expand_key(dctx, key, keylen); in des3_ede_setkey()
Dsig.c134 const void *key, unsigned int keylen) in crypto_sig_set_pubkey() argument
138 return crypto_akcipher_set_pub_key(*ctx, key, keylen); in crypto_sig_set_pubkey()
143 const void *key, unsigned int keylen) in crypto_sig_set_privkey() argument
147 return crypto_akcipher_set_priv_key(*ctx, key, keylen); in crypto_sig_set_privkey()
Daead.c33 unsigned int keylen) in setkey_unaligned() argument
40 absize = keylen + alignmask; in setkey_unaligned()
46 memcpy(alignbuffer, key, keylen); in setkey_unaligned()
47 ret = crypto_aead_alg(tfm)->setkey(tfm, alignbuffer, keylen); in setkey_unaligned()
53 const u8 *key, unsigned int keylen) in crypto_aead_setkey() argument
59 err = setkey_unaligned(tfm, key, keylen); in crypto_aead_setkey()
61 err = crypto_aead_alg(tfm)->setkey(tfm, key, keylen); in crypto_aead_setkey()
Dsm2.c67 const void *key, unsigned int keylen);
269 const void *key, unsigned int keylen, void *dgst) in sm2_compute_z_digest() argument
285 err = __sm2_set_pub_key(ec, key, keylen); in sm2_compute_z_digest()
421 const void *key, unsigned int keylen) in sm2_set_pub_key() argument
425 return __sm2_set_pub_key(ec, key, keylen); in sm2_set_pub_key()
430 const void *key, unsigned int keylen) in __sm2_set_pub_key() argument
436 a = mpi_read_raw_data(key, keylen); in __sm2_set_pub_key()
Dshash.c35 unsigned int keylen) in shash_no_setkey() argument
42 unsigned int keylen) in shash_setkey_unaligned() argument
50 absize = keylen + (alignmask & ~(crypto_tfm_ctx_alignment() - 1)); in shash_setkey_unaligned()
56 memcpy(alignbuffer, key, keylen); in shash_setkey_unaligned()
57 err = shash->setkey(tfm, alignbuffer, keylen); in shash_setkey_unaligned()
69 unsigned int keylen) in crypto_shash_setkey() argument
76 err = shash_setkey_unaligned(tfm, key, keylen); in crypto_shash_setkey()
78 err = shash->setkey(tfm, key, keylen); in crypto_shash_setkey()
329 unsigned int keylen) in shash_async_setkey() argument
333 return crypto_shash_setkey(*ctx, key, keylen); in shash_async_setkey()
Dahash.c131 unsigned int keylen) in ahash_setkey_unaligned() argument
138 absize = keylen + alignmask; in ahash_setkey_unaligned()
144 memcpy(alignbuffer, key, keylen); in ahash_setkey_unaligned()
145 ret = tfm->setkey(tfm, alignbuffer, keylen); in ahash_setkey_unaligned()
151 unsigned int keylen) in ahash_nosetkey() argument
166 unsigned int keylen) in crypto_ahash_setkey() argument
172 err = ahash_setkey_unaligned(tfm, key, keylen); in crypto_ahash_setkey()
174 err = tfm->setkey(tfm, key, keylen); in crypto_ahash_setkey()
Dauthenc.c47 unsigned int keylen) in crypto_authenc_extractkeys() argument
52 if (!RTA_OK(rta, keylen)) in crypto_authenc_extractkeys()
71 keylen -= rta->rta_len; in crypto_authenc_extractkeys()
73 if (keylen < keys->enckeylen) in crypto_authenc_extractkeys()
76 keys->authkeylen = keylen - keys->enckeylen; in crypto_authenc_extractkeys()
85 unsigned int keylen) in crypto_authenc_setkey() argument
93 if (crypto_authenc_extractkeys(&keys, key, keylen) != 0) in crypto_authenc_setkey()
Dctr.c170 const u8 *key, unsigned int keylen) in crypto_rfc3686_setkey() argument
176 if (keylen < CTR_RFC3686_NONCE_SIZE) in crypto_rfc3686_setkey()
179 memcpy(ctx->nonce, key + (keylen - CTR_RFC3686_NONCE_SIZE), in crypto_rfc3686_setkey()
182 keylen -= CTR_RFC3686_NONCE_SIZE; in crypto_rfc3686_setkey()
187 return crypto_skcipher_setkey(child, key, keylen); in crypto_rfc3686_setkey()
Dcrypto_null.c60 unsigned int keylen) in null_hash_setkey() argument
64 unsigned int keylen) in null_skcipher_setkey() argument
68 unsigned int keylen) in null_setkey() argument
Dxts.c42 unsigned int keylen) in xts_setkey() argument
49 err = xts_verify_key(parent, key, keylen); in xts_setkey()
53 keylen /= 2; in xts_setkey()
64 err = crypto_cipher_setkey(tweak, key + keylen, keylen); in xts_setkey()
73 return crypto_skcipher_setkey(child, key, keylen); in xts_setkey()
Dxxhash_generic.c21 unsigned int keylen) in xxhash64_setkey() argument
25 if (keylen != sizeof(tctx->seed)) in xxhash64_setkey()
Dcrc32_generic.c37 unsigned int keylen) in crc32_setkey() argument
41 if (keylen != sizeof(u32)) in crc32_setkey()
Dskcipher.c592 const u8 *key, unsigned int keylen) in skcipher_setkey_unaligned() argument
600 absize = keylen + alignmask; in skcipher_setkey_unaligned()
606 memcpy(alignbuffer, key, keylen); in skcipher_setkey_unaligned()
607 ret = cipher->setkey(tfm, alignbuffer, keylen); in skcipher_setkey_unaligned()
613 unsigned int keylen) in crypto_skcipher_setkey() argument
619 if (keylen < cipher->min_keysize || keylen > cipher->max_keysize) in crypto_skcipher_setkey()
623 err = skcipher_setkey_unaligned(tfm, key, keylen); in crypto_skcipher_setkey()
625 err = cipher->setkey(tfm, key, keylen); in crypto_skcipher_setkey()
926 unsigned int keylen) in skcipher_setkey_simple() argument
933 return crypto_cipher_setkey(cipher, key, keylen); in skcipher_setkey_simple()
Drsa.c237 unsigned int keylen) in rsa_set_pub_key() argument
246 ret = rsa_parse_pub_key(&raw_key, key, keylen); in rsa_set_pub_key()
276 unsigned int keylen) in rsa_set_priv_key() argument
285 ret = rsa_parse_priv_key(&raw_key, key, keylen); in rsa_set_priv_key()
Dccm.c88 unsigned int keylen) in crypto_ccm_setkey() argument
98 err = crypto_skcipher_setkey(ctr, key, keylen); in crypto_ccm_setkey()
105 return crypto_ahash_setkey(mac, key, keylen); in crypto_ccm_setkey()
569 unsigned int keylen) in crypto_rfc4309_setkey() argument
574 if (keylen < 3) in crypto_rfc4309_setkey()
577 keylen -= 3; in crypto_rfc4309_setkey()
578 memcpy(ctx->nonce, key + keylen, 3); in crypto_rfc4309_setkey()
583 return crypto_aead_setkey(child, key, keylen); in crypto_rfc4309_setkey()
778 const u8 *inkey, unsigned int keylen) in crypto_cbcmac_digest_setkey() argument
782 return crypto_cipher_setkey(ctx->child, inkey, keylen); in crypto_cbcmac_digest_setkey()
Dcrc32c_generic.c73 unsigned int keylen) in chksum_setkey() argument
77 if (keylen != sizeof(mctx->key)) in chksum_setkey()
Dgcm.c93 unsigned int keylen) in crypto_gcm_setkey() argument
112 err = crypto_skcipher_setkey(ctr, key, keylen); in crypto_gcm_setkey()
690 unsigned int keylen) in crypto_rfc4106_setkey() argument
695 if (keylen < 4) in crypto_rfc4106_setkey()
698 keylen -= 4; in crypto_rfc4106_setkey()
699 memcpy(ctx->nonce, key + keylen, 4); in crypto_rfc4106_setkey()
704 return crypto_aead_setkey(child, key, keylen); in crypto_rfc4106_setkey()
898 unsigned int keylen) in crypto_rfc4543_setkey() argument
903 if (keylen < 4) in crypto_rfc4543_setkey()
906 keylen -= 4; in crypto_rfc4543_setkey()
[all …]
Dessiv.c67 const u8 *key, unsigned int keylen) in essiv_skcipher_setkey() argument
77 err = crypto_skcipher_setkey(tctx->u.skcipher, key, keylen); in essiv_skcipher_setkey()
81 err = crypto_shash_tfm_digest(tctx->hash, key, keylen, salt); in essiv_skcipher_setkey()
94 unsigned int keylen) in essiv_aead_setkey() argument
105 err = crypto_aead_setkey(tctx->u.aead, key, keylen); in essiv_aead_setkey()
109 if (crypto_authenc_extractkeys(&keys, key, keylen) != 0) in essiv_aead_setkey()
Dghash-generic.c56 const u8 *key, unsigned int keylen) in ghash_setkey() argument
61 if (keylen != GHASH_BLOCK_SIZE) in ghash_setkey()
/crypto/asymmetric_keys/
Dpublic_key.c174 key = kmalloc(pkey->keylen + sizeof(u32) * 2 + pkey->paramlen, in software_key_query()
179 memcpy(key, pkey->key, pkey->keylen); in software_key_query()
180 ptr = key + pkey->keylen; in software_key_query()
193 ret = crypto_sig_set_privkey(sig, key, pkey->keylen); in software_key_query()
195 ret = crypto_sig_set_pubkey(sig, key, pkey->keylen); in software_key_query()
218 ret = crypto_akcipher_set_priv_key(tfm, key, pkey->keylen); in software_key_query()
220 ret = crypto_akcipher_set_pub_key(tfm, key, pkey->keylen); in software_key_query()
293 key = kmalloc(pkey->keylen + sizeof(u32) * 2 + pkey->paramlen, in software_key_eds_op()
298 memcpy(key, pkey->key, pkey->keylen); in software_key_eds_op()
299 ptr = key + pkey->keylen; in software_key_eds_op()
[all …]

123