Lines Matching defs:keylen
1767 unsigned int keylen)
1781 unsigned int keylen)
1795 unsigned int keylen)
1801 keylen = keylen / 2;
1803 switch (keylen) {
1822 unsigned int keylen)
1830 flow_log("skcipher_setkey() keylen: %d\n", keylen);
1831 flow_dump(" key: ", key, keylen);
1835 err = des_setkey(cipher, key, keylen);
1838 err = threedes_setkey(cipher, key, keylen);
1841 err = aes_setkey(cipher, key, keylen);
1850 memcpy(ctx->enckey, key, keylen);
1851 ctx->enckeylen = keylen;
1856 unsigned int xts_keylen = keylen / 2;
2255 unsigned int keylen)
2259 flow_log("%s() ahash:%p key:%p keylen:%u\n",
2260 __func__, ahash, key, keylen);
2261 flow_dump(" key: ", key, keylen);
2264 switch (keylen) {
2282 memcpy(ctx->authkey, key, keylen);
2283 ctx->authkeylen = keylen;
2319 unsigned int keylen)
2328 flow_log("%s() ahash:%p key:%p keylen:%u blksz:%u digestsz:%u\n",
2329 __func__, ahash, key, keylen, blocksize, digestsize);
2330 flow_dump(" key: ", key, keylen);
2332 if (keylen > blocksize) {
2335 rc = do_shash("md5", ctx->authkey, key, keylen, NULL,
2339 rc = do_shash("sha1", ctx->authkey, key, keylen, NULL,
2343 rc = do_shash("sha224", ctx->authkey, key, keylen, NULL,
2347 rc = do_shash("sha256", ctx->authkey, key, keylen, NULL,
2351 rc = do_shash("sha384", ctx->authkey, key, keylen, NULL,
2355 rc = do_shash("sha512", ctx->authkey, key, keylen, NULL,
2359 rc = do_shash("sha3-224", ctx->authkey, key, keylen,
2363 rc = do_shash("sha3-256", ctx->authkey, key, keylen,
2367 rc = do_shash("sha3-384", ctx->authkey, key, keylen,
2371 rc = do_shash("sha3-512", ctx->authkey, key, keylen,
2385 flow_log(" keylen > digestsize... hashed\n");
2388 memcpy(ctx->authkey, key, keylen);
2389 ctx->authkeylen = keylen;
2759 const u8 *key, unsigned int keylen)
2767 flow_log("%s() aead:%p key:%p keylen:%u\n", __func__, cipher, key,
2768 keylen);
2769 flow_dump(" key: ", key, keylen);
2771 ret = crypto_authenc_extractkeys(&keys, key, keylen);
2832 ret = crypto_aead_setkey(ctx->fallback_cipher, key, keylen);
2854 const u8 *key, unsigned int keylen)
2862 flow_log("%s() keylen:%u\n", __func__, keylen);
2863 flow_dump(" key: ", key, keylen);
2866 ctx->digestsize = keylen;
2868 ctx->enckeylen = keylen;
2900 keylen + ctx->salt_len);
2928 * @keylen: Length of key plus salt, in bytes
2936 const u8 *key, unsigned int keylen)
2942 if (keylen < GCM_ESP_SALT_SIZE)
2947 memcpy(ctx->salt, key + keylen - GCM_ESP_SALT_SIZE, GCM_ESP_SALT_SIZE);
2948 keylen -= GCM_ESP_SALT_SIZE;
2953 return aead_gcm_ccm_setkey(cipher, key, keylen);
2960 * keylen: Length of key plus salt, in bytes
2968 const u8 *key, unsigned int keylen)
2974 if (keylen < GCM_ESP_SALT_SIZE)
2979 memcpy(ctx->salt, key + keylen - GCM_ESP_SALT_SIZE, GCM_ESP_SALT_SIZE);
2980 keylen -= GCM_ESP_SALT_SIZE;
2986 return aead_gcm_ccm_setkey(cipher, key, keylen);
2993 * @keylen: Length of key plus salt, in bytes
3001 const u8 *key, unsigned int keylen)
3007 if (keylen < CCM_ESP_SALT_SIZE)
3012 memcpy(ctx->salt, key + keylen - CCM_ESP_SALT_SIZE, CCM_ESP_SALT_SIZE);
3013 keylen -= CCM_ESP_SALT_SIZE;
3017 return aead_gcm_ccm_setkey(cipher, key, keylen);