Lines Matching defs:key

143 	/* Allocate key buffer, cache line aligned */
147 dev_err(dev, "Failed allocating key buffer\n");
160 /* (and temporary for user key - up to 256b) */
254 /* Load the AES key */
256 /* We are using for the source/user key the same buffer
257 * as for the output keys, * because after this key loading it
306 /* calc derived HMAC key */
327 /* Prepare ipad key */
387 /* Check cipher key size */
390 dev_dbg(dev, "Invalid cipher(3DES) key size: %u\n",
398 dev_dbg(dev, "Invalid cipher(AES) key size: %u\n",
407 /* This function prepers the user key so it can pass to the hmac processing
408 * (copy to intenral buffer or hash in case of key longer than block
423 u8 *key = NULL;
443 key = kmemdup(authkey, keylen, GFP_KERNEL);
444 if (!key)
447 key_dma_addr = dma_map_single(dev, key, keylen, DMA_TO_DEVICE);
449 dev_err(dev, "Mapping key va=0x%p len=%u for DMA failed\n",
450 key, keylen);
451 kfree_sensitive(key);
480 /* Get hashed key */
536 kfree_sensitive(key);
541 static int cc_aead_setkey(struct crypto_aead *tfm, const u8 *key,
552 dev_dbg(dev, "Setting key in context @%p for %s. key=%p keylen=%u\n",
553 ctx, crypto_tfm_alg_name(crypto_aead_tfm(tfm)), key, keylen);
560 rc = crypto_authenc_extractkeys(&keys, key, keylen);
569 /* the nonce is stored in bytes at end of key */
573 /* Copy nonce from last 4 bytes in CTR key to
578 /* Set CTR key size */
581 } else { /* non-authenc - has just one key */
582 enckey = key;
592 /* STAT_PHASE_1: Copy key to ctx */
594 /* Get key material */
618 break; /* No auth. key setup */
626 if (seq_len > 0) { /* For CCM there is no sequence to setup the key */
638 static int cc_des3_aead_setkey(struct crypto_aead *aead, const u8 *key,
644 err = crypto_authenc_extractkeys(&keys, key, keylen);
649 cc_aead_setkey(aead, key, keylen);
655 static int cc_rfc4309_ccm_setkey(struct crypto_aead *tfm, const u8 *key,
664 memcpy(ctx->ctr_nonce, key + keylen, 3);
666 return cc_aead_setkey(tfm, key, keylen);
944 /* Setup enc. key */
999 /* Loading hash ipad xor key state */
1128 /* Loading hash opad xor key state */
1427 /* load key */
1450 /* load MAC key */
1621 /* load key to AES*/
1699 /* load key to AES*/
1930 * CTR key to first 4 bytes in CTR IV
2107 static int cc_rfc4106_gcm_setkey(struct crypto_aead *tfm, const u8 *key,
2113 dev_dbg(dev, "%s() keylen %d, key %p\n", __func__, keylen, key);
2119 memcpy(ctx->ctr_nonce, key + keylen, 4);
2121 return cc_aead_setkey(tfm, key, keylen);
2124 static int cc_rfc4543_gcm_setkey(struct crypto_aead *tfm, const u8 *key,
2130 dev_dbg(dev, "%s() keylen %d, key %p\n", __func__, keylen, key);
2136 memcpy(ctx->ctr_nonce, key + keylen, 4);
2138 return cc_aead_setkey(tfm, key, keylen);