Home
last modified time | relevance | path

Searched refs:keylen (Results 1 – 25 of 51) 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()
37 memset(alignbuffer, 0, keylen); in setkey_unaligned()
44 const u8 *key, unsigned int keylen) in crypto_cipher_setkey() argument
49 if (keylen < cia->cia_min_keysize || keylen > cia->cia_max_keysize) in crypto_cipher_setkey()
53 return setkey_unaligned(tfm, key, keylen); in crypto_cipher_setkey()
55 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()
Dblowfish_common.c344 int blowfish_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) in blowfish_setkey() argument
364 ((u32)key[(j + 1) % keylen] << 16) | in blowfish_setkey()
365 ((u32)key[(j + 2) % keylen] << 8) | in blowfish_setkey()
366 ((u32)key[(j + 3) % keylen])); in blowfish_setkey()
369 j = (j + 4) % keylen; in blowfish_setkey()
Daead.c23 unsigned int keylen) in setkey_unaligned() argument
30 absize = keylen + alignmask; in setkey_unaligned()
36 memcpy(alignbuffer, key, keylen); in setkey_unaligned()
37 ret = crypto_aead_alg(tfm)->setkey(tfm, alignbuffer, keylen); in setkey_unaligned()
38 memset(alignbuffer, 0, keylen); in setkey_unaligned()
44 const u8 *key, unsigned int keylen) in crypto_aead_setkey() argument
50 err = setkey_unaligned(tfm, key, keylen); in crypto_aead_setkey()
52 err = crypto_aead_alg(tfm)->setkey(tfm, key, keylen); in crypto_aead_setkey()
Dhmac.c41 const u8 *inkey, unsigned int keylen) in hmac_setkey() argument
56 if (keylen > bs) { in hmac_setkey()
59 err = crypto_shash_digest(shash, inkey, keylen, ipad); in hmac_setkey()
63 keylen = ds; in hmac_setkey()
65 memcpy(ipad, inkey, keylen); in hmac_setkey()
67 memset(ipad + keylen, 0, bs - keylen); in hmac_setkey()
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()
Dshash.c24 unsigned int keylen) in shash_no_setkey() argument
43 unsigned int keylen) in shash_setkey_unaligned() argument
51 absize = keylen + (alignmask & ~(crypto_tfm_ctx_alignment() - 1)); in shash_setkey_unaligned()
57 memcpy(alignbuffer, key, keylen); in shash_setkey_unaligned()
58 err = shash->setkey(tfm, alignbuffer, keylen); in shash_setkey_unaligned()
70 unsigned int keylen) in crypto_shash_setkey() argument
77 err = shash_setkey_unaligned(tfm, key, keylen); in crypto_shash_setkey()
79 err = shash->setkey(tfm, key, keylen); in crypto_shash_setkey()
250 unsigned int keylen) in shash_async_setkey() argument
254 return crypto_shash_setkey(*ctx, key, keylen); in shash_async_setkey()
Drsa.c157 unsigned int keylen) in rsa_set_pub_key() argument
166 ret = rsa_parse_pub_key(&raw_key, key, keylen); in rsa_set_pub_key()
191 unsigned int keylen) in rsa_set_priv_key() argument
200 ret = rsa_parse_priv_key(&raw_key, key, keylen); in rsa_set_priv_key()
Dahash.c138 unsigned int keylen) in ahash_setkey_unaligned() argument
145 absize = keylen + alignmask; in ahash_setkey_unaligned()
151 memcpy(alignbuffer, key, keylen); in ahash_setkey_unaligned()
152 ret = tfm->setkey(tfm, alignbuffer, keylen); in ahash_setkey_unaligned()
158 unsigned int keylen) in ahash_nosetkey() argument
173 unsigned int keylen) in crypto_ahash_setkey() argument
179 err = ahash_setkey_unaligned(tfm, key, keylen); in crypto_ahash_setkey()
181 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()
Dskcipher.c574 const u8 *key, unsigned int keylen) in skcipher_setkey_unaligned() argument
582 absize = keylen + alignmask; in skcipher_setkey_unaligned()
588 memcpy(alignbuffer, key, keylen); in skcipher_setkey_unaligned()
589 ret = cipher->setkey(tfm, alignbuffer, keylen); in skcipher_setkey_unaligned()
595 unsigned int keylen) in crypto_skcipher_setkey() argument
601 if (keylen < cipher->min_keysize || keylen > cipher->max_keysize) in crypto_skcipher_setkey()
605 err = skcipher_setkey_unaligned(tfm, key, keylen); in crypto_skcipher_setkey()
607 err = cipher->setkey(tfm, key, keylen); in crypto_skcipher_setkey()
875 unsigned int keylen) in skcipher_setkey_simple() argument
882 return crypto_cipher_setkey(cipher, key, keylen); in skcipher_setkey_simple()
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()
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()
570 unsigned int keylen) in crypto_rfc4309_setkey() argument
575 if (keylen < 3) in crypto_rfc4309_setkey()
578 keylen -= 3; in crypto_rfc4309_setkey()
579 memcpy(ctx->nonce, key + keylen, 3); in crypto_rfc4309_setkey()
584 return crypto_aead_setkey(child, key, keylen); in crypto_rfc4309_setkey()
779 const u8 *inkey, unsigned int keylen) in crypto_cbcmac_digest_setkey() argument
783 return crypto_cipher_setkey(ctx->child, inkey, keylen); in crypto_cbcmac_digest_setkey()
Dgcm.c93 unsigned int keylen) in crypto_gcm_setkey() argument
112 err = crypto_skcipher_setkey(ctr, key, keylen); in crypto_gcm_setkey()
692 unsigned int keylen) in crypto_rfc4106_setkey() argument
697 if (keylen < 4) in crypto_rfc4106_setkey()
700 keylen -= 4; in crypto_rfc4106_setkey()
701 memcpy(ctx->nonce, key + keylen, 4); in crypto_rfc4106_setkey()
706 return crypto_aead_setkey(child, key, keylen); in crypto_rfc4106_setkey()
900 unsigned int keylen) in crypto_rfc4543_setkey() argument
905 if (keylen < 4) in crypto_rfc4543_setkey()
908 keylen -= 4; in crypto_rfc4543_setkey()
[all …]
Dcrc32c_generic.c73 unsigned int keylen) in chksum_setkey() argument
77 if (keylen != sizeof(mctx->key)) in chksum_setkey()
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()
Dmichael_mic.c130 unsigned int keylen) in michael_setkey() argument
134 if (keylen != 8) in michael_setkey()
Decrdsa.c192 unsigned int keylen) in ecrdsa_set_pub_key() argument
200 err = asn1_ber_decoder(&ecrdsa_pub_key_decoder, ctx, key, keylen); in ecrdsa_set_pub_key()
206 ecrdsa_unpack_u32(&algo, (u8 *)key + keylen)); in ecrdsa_set_pub_key()
Dgeniv.c20 const u8 *key, unsigned int keylen) in aead_geniv_setkey() argument
24 return crypto_aead_setkey(ctx->child, key, keylen); in aead_geniv_setkey()
/crypto/asymmetric_keys/
Dpublic_key.c170 key = kmalloc(pkey->keylen + sizeof(u32) * 2 + pkey->paramlen, in software_key_query()
174 memcpy(key, pkey->key, pkey->keylen); in software_key_query()
175 ptr = key + pkey->keylen; in software_key_query()
181 ret = crypto_akcipher_set_priv_key(tfm, key, pkey->keylen); in software_key_query()
183 ret = crypto_akcipher_set_pub_key(tfm, key, pkey->keylen); in software_key_query()
259 key = kmalloc(pkey->keylen + sizeof(u32) * 2 + pkey->paramlen, in software_key_eds_op()
264 memcpy(key, pkey->key, pkey->keylen); in software_key_eds_op()
265 ptr = key + pkey->keylen; in software_key_eds_op()
271 ret = crypto_akcipher_set_priv_key(tfm, key, pkey->keylen); in software_key_eds_op()
273 ret = crypto_akcipher_set_pub_key(tfm, key, pkey->keylen); in software_key_eds_op()
[all …]

123