/crypto/ |
D | cipher.c | 21 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()
|
D | ecdsa.c | 38 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()
|
D | blowfish_common.c | 344 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()
|
D | aead.c | 23 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()
|
D | hmac.c | 41 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()
|
D | des_generic.c | 20 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()
|
D | shash.c | 24 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()
|
D | rsa.c | 157 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()
|
D | ahash.c | 138 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()
|
D | authenc.c | 47 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()
|
D | ctr.c | 170 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()
|
D | crypto_null.c | 60 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
|
D | xts.c | 42 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()
|
D | skcipher.c | 574 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()
|
D | xxhash_generic.c | 21 unsigned int keylen) in xxhash64_setkey() argument 25 if (keylen != sizeof(tctx->seed)) in xxhash64_setkey()
|
D | crc32_generic.c | 37 unsigned int keylen) in crc32_setkey() argument 41 if (keylen != sizeof(u32)) in crc32_setkey()
|
D | ccm.c | 88 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()
|
D | gcm.c | 93 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 …]
|
D | crc32c_generic.c | 73 unsigned int keylen) in chksum_setkey() argument 77 if (keylen != sizeof(mctx->key)) in chksum_setkey()
|
D | essiv.c | 67 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()
|
D | ghash-generic.c | 56 const u8 *key, unsigned int keylen) in ghash_setkey() argument 61 if (keylen != GHASH_BLOCK_SIZE) in ghash_setkey()
|
D | michael_mic.c | 130 unsigned int keylen) in michael_setkey() argument 134 if (keylen != 8) in michael_setkey()
|
D | ecrdsa.c | 192 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()
|
D | geniv.c | 20 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/ |
D | public_key.c | 170 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 …]
|