Lines Matching refs:key
57 static int linux_af_alg_hash_vector(const char *alg, const u8 *key, in linux_af_alg_hash_vector() argument
71 if (key && setsockopt(s, SOL_ALG, ALG_SET_KEY, key, key_len) < 0) { in linux_af_alg_hash_vector()
171 int hmac_md5_vector(const u8 *key, size_t key_len, size_t num_elem, in hmac_md5_vector() argument
174 return linux_af_alg_hash_vector("hmac(md5)", key, key_len, num_elem, in hmac_md5_vector()
179 int hmac_md5(const u8 *key, size_t key_len, const u8 *data, size_t data_len, in hmac_md5() argument
182 return hmac_md5_vector(key, key_len, 1, &data, &data_len, mac); in hmac_md5()
186 int hmac_sha1_vector(const u8 *key, size_t key_len, size_t num_elem, in hmac_sha1_vector() argument
189 return linux_af_alg_hash_vector("hmac(sha1)", key, key_len, num_elem, in hmac_sha1_vector()
194 int hmac_sha1(const u8 *key, size_t key_len, const u8 *data, size_t data_len, in hmac_sha1() argument
197 return hmac_sha1_vector(key, key_len, 1, &data, &data_len, mac); in hmac_sha1()
201 int hmac_sha256_vector(const u8 *key, size_t key_len, size_t num_elem, in hmac_sha256_vector() argument
204 return linux_af_alg_hash_vector("hmac(sha256)", key, key_len, num_elem, in hmac_sha256_vector()
209 int hmac_sha256(const u8 *key, size_t key_len, const u8 *data, in hmac_sha256() argument
212 return hmac_sha256_vector(key, key_len, 1, &data, &data_len, mac); in hmac_sha256()
216 int hmac_sha384_vector(const u8 *key, size_t key_len, size_t num_elem, in hmac_sha384_vector() argument
219 return linux_af_alg_hash_vector("hmac(sha384)", key, key_len, num_elem, in hmac_sha384_vector()
224 int hmac_sha384(const u8 *key, size_t key_len, const u8 *data, in hmac_sha384() argument
227 return hmac_sha384_vector(key, key_len, 1, &data, &data_len, mac); in hmac_sha384()
239 struct crypto_hash * crypto_hash_init(enum crypto_hash_alg alg, const u8 *key, in crypto_hash_init() argument
293 if (key && key_len && in crypto_hash_init()
294 setsockopt(ctx->s, SOL_ALG, ALG_SET_KEY, key, key_len) < 0) { in crypto_hash_init()
415 linux_af_alg_skcipher(const char *alg, const u8 *key, size_t key_len) in linux_af_alg_skcipher() argument
428 if (setsockopt(skcipher->s, SOL_ALG, ALG_SET_KEY, key, key_len) < 0) { in linux_af_alg_skcipher()
497 void * aes_encrypt_init(const u8 *key, size_t len) in aes_encrypt_init() argument
499 return linux_af_alg_skcipher("ecb(aes)", key, len); in aes_encrypt_init()
517 void * aes_decrypt_init(const u8 *key, size_t len) in aes_decrypt_init() argument
519 return linux_af_alg_skcipher("ecb(aes)", key, len); in aes_decrypt_init()
537 int rc4_skip(const u8 *key, size_t keylen, size_t skip, in rc4_skip() argument
552 skcipher = linux_af_alg_skcipher("ecb(arc4)", key, keylen); in rc4_skip()
607 int des_encrypt(const u8 *clear, const u8 *key, u8 *cypher) in des_encrypt() argument
623 tmp = key[i]; in des_encrypt()
675 static int aes_128_cbc_oper(const u8 *key, int enc, const u8 *iv, in aes_128_cbc_oper() argument
688 skcipher = linux_af_alg_skcipher("cbc(aes)", key, 16); in aes_128_cbc_oper()
745 int aes_128_cbc_encrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len) in aes_128_cbc_encrypt() argument
747 return aes_128_cbc_oper(key, 1, iv, data, data_len); in aes_128_cbc_encrypt()
751 int aes_128_cbc_decrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len) in aes_128_cbc_decrypt() argument
753 return aes_128_cbc_oper(key, 0, iv, data, data_len); in aes_128_cbc_decrypt()
757 int omac1_aes_vector(const u8 *key, size_t key_len, size_t num_elem, in omac1_aes_vector() argument
760 return linux_af_alg_hash_vector("cmac(aes)", key, key_len, num_elem, in omac1_aes_vector()
765 int omac1_aes_128_vector(const u8 *key, size_t num_elem, in omac1_aes_128_vector() argument
768 return omac1_aes_vector(key, 16, num_elem, addr, len, mac); in omac1_aes_128_vector()
772 int omac1_aes_128(const u8 *key, const u8 *data, size_t data_len, u8 *mac) in omac1_aes_128() argument
774 return omac1_aes_128_vector(key, 1, &data, &data_len, mac); in omac1_aes_128()
778 int omac1_aes_256(const u8 *key, const u8 *data, size_t data_len, u8 *mac) in omac1_aes_256() argument
780 return omac1_aes_vector(key, 32, 1, &data, &data_len, mac); in omac1_aes_256()
859 const u8 *iv, const u8 *key, in crypto_cipher_init() argument
896 ctx->skcipher = linux_af_alg_skcipher(name, key, key_len); in crypto_cipher_init()