Lines Matching refs:key
38 int des_encrypt(const u8 *clear, const u8 *key, u8 *cypher) in des_encrypt() argument
47 tmp = key[i]; in des_encrypt()
86 void * aes_encrypt_init(const u8 *key, size_t len) in aes_encrypt_init() argument
92 if (aes_setup(key, len, 0, skey) != CRYPT_OK) { in aes_encrypt_init()
115 void * aes_decrypt_init(const u8 *key, size_t len) in aes_decrypt_init() argument
121 if (aes_setup(key, len, 0, skey) != CRYPT_OK) { in aes_decrypt_init()
154 struct crypto_hash * crypto_hash_init(enum crypto_hash_alg alg, const u8 *key, in crypto_hash_init() argument
175 if (hmac_init(&ctx->u.hmac, find_hash("md5"), key, key_len) != in crypto_hash_init()
180 if (hmac_init(&ctx->u.hmac, find_hash("sha1"), key, key_len) != in crypto_hash_init()
294 u8 key[16]; member
302 const u8 *iv, const u8 *key, in crypto_cipher_init() argument
335 if (key_len > sizeof(ctx->u.rc4.key)) { in crypto_cipher_init()
340 os_memcpy(ctx->u.rc4.key, key, key_len); in crypto_cipher_init()
342 res = cbc_start(idx, iv, key, key_len, 0, &ctx->u.cbc); in crypto_cipher_init()
362 rc4_skip(ctx->u.rc4.key, ctx->u.rc4.keylen, in crypto_cipher_encrypt()
386 rc4_skip(ctx->u.rc4.key, ctx->u.rc4.keylen, in crypto_cipher_decrypt()
420 struct crypto_public_key * crypto_public_key_import(const u8 *key, size_t len) in crypto_public_key_import() argument
429 res = rsa_import(key, len, &pk->rsa); in crypto_public_key_import()
450 struct crypto_private_key * crypto_private_key_import(const u8 *key, in crypto_private_key_import() argument
461 res = rsa_import(key, len, &pk->rsa); in crypto_private_key_import()
553 static int crypto_rsa_encrypt_pkcs1(int block_type, rsa_key *key, int key_type, in crypto_rsa_encrypt_pkcs1() argument
560 modlen = mp_unsigned_bin_size(key->N); in crypto_rsa_encrypt_pkcs1()
567 res = rsa_exptmod(out, modlen, out, &len, key_type, key); in crypto_rsa_encrypt_pkcs1()
579 int crypto_public_key_encrypt_pkcs1_v15(struct crypto_public_key *key, in crypto_public_key_encrypt_pkcs1_v15() argument
583 return crypto_rsa_encrypt_pkcs1(2, &key->rsa, PK_PUBLIC, in, inlen, in crypto_public_key_encrypt_pkcs1_v15()
588 int crypto_private_key_sign_pkcs1(struct crypto_private_key *key, in crypto_private_key_sign_pkcs1() argument
592 return crypto_rsa_encrypt_pkcs1(1, &key->rsa, PK_PRIVATE, in, inlen, in crypto_private_key_sign_pkcs1()
597 void crypto_public_key_free(struct crypto_public_key *key) in crypto_public_key_free() argument
599 if (key) { in crypto_public_key_free()
600 rsa_free(&key->rsa); in crypto_public_key_free()
601 os_free(key); in crypto_public_key_free()
606 void crypto_private_key_free(struct crypto_private_key *key) in crypto_private_key_free() argument
608 if (key) { in crypto_private_key_free()
609 rsa_free(&key->rsa); in crypto_private_key_free()
610 os_free(key); in crypto_private_key_free()
615 int crypto_public_key_decrypt_pkcs1(struct crypto_public_key *key, in crypto_public_key_decrypt_pkcs1() argument
625 &key->rsa); in crypto_public_key_decrypt_pkcs1()