Lines Matching refs:tfm

56 #define get_driver_name(tfm_type, tfm) crypto_tfm_alg_driver_name(tfm_type ## _tfm(tfm))  argument
307 struct crypto_aead *tfm; in test_aead_speed() local
349 tfm = crypto_alloc_aead(algo, 0, 0); in test_aead_speed()
351 if (IS_ERR(tfm)) { in test_aead_speed()
353 PTR_ERR(tfm)); in test_aead_speed()
359 get_driver_name(crypto_aead, tfm), e); in test_aead_speed()
361 req = aead_request_alloc(tfm, GFP_KERNEL); in test_aead_speed()
392 ret = crypto_aead_setkey(tfm, key, *keysize); in test_aead_speed()
393 ret = crypto_aead_setauthsize(tfm, authsize); in test_aead_speed()
395 iv_len = crypto_aead_ivsize(tfm); in test_aead_speed()
399 crypto_aead_clear_flags(tfm, ~0); in test_aead_speed()
408 crypto_aead_get_flags(tfm)); in test_aead_speed()
443 crypto_free_aead(tfm); in test_aead_speed()
464 struct crypto_blkcipher *tfm; in test_cipher_speed() local
474 tfm = crypto_alloc_blkcipher(algo, 0, CRYPTO_ALG_ASYNC); in test_cipher_speed()
476 if (IS_ERR(tfm)) { in test_cipher_speed()
478 PTR_ERR(tfm)); in test_cipher_speed()
481 desc.tfm = tfm; in test_cipher_speed()
485 get_driver_name(crypto_blkcipher, tfm), e); in test_cipher_speed()
515 ret = crypto_blkcipher_setkey(tfm, key, *keysize); in test_cipher_speed()
518 crypto_blkcipher_get_flags(tfm)); in test_cipher_speed()
530 iv_len = crypto_blkcipher_ivsize(tfm); in test_cipher_speed()
533 crypto_blkcipher_set_iv(tfm, iv, iv_len); in test_cipher_speed()
554 crypto_free_blkcipher(tfm); in test_cipher_speed()
730 struct crypto_hash *tfm; in test_hash_speed() local
736 tfm = crypto_alloc_hash(algo, 0, CRYPTO_ALG_ASYNC); in test_hash_speed()
738 if (IS_ERR(tfm)) { in test_hash_speed()
740 PTR_ERR(tfm)); in test_hash_speed()
745 get_driver_name(crypto_hash, tfm)); in test_hash_speed()
747 desc.tfm = tfm; in test_hash_speed()
750 if (crypto_hash_digestsize(tfm) > sizeof(output)) { in test_hash_speed()
752 crypto_hash_digestsize(tfm), sizeof(output)); in test_hash_speed()
766 crypto_hash_setkey(tfm, tvmem[0], speed[i].klen); in test_hash_speed()
786 crypto_free_hash(tfm); in test_hash_speed()
954 struct crypto_ahash *tfm; in test_ahash_speed() local
958 tfm = crypto_alloc_ahash(algo, 0, 0); in test_ahash_speed()
959 if (IS_ERR(tfm)) { in test_ahash_speed()
961 algo, PTR_ERR(tfm)); in test_ahash_speed()
966 get_driver_name(crypto_ahash, tfm)); in test_ahash_speed()
968 if (crypto_ahash_digestsize(tfm) > MAX_DIGEST_SIZE) { in test_ahash_speed()
969 pr_err("digestsize(%u) > %d\n", crypto_ahash_digestsize(tfm), in test_ahash_speed()
975 req = ahash_request_alloc(tfm, GFP_KERNEL); in test_ahash_speed()
1021 crypto_free_ahash(tfm); in test_ahash_speed()
1118 struct crypto_ablkcipher *tfm; in test_acipher_speed() local
1129 tfm = crypto_alloc_ablkcipher(algo, 0, 0); in test_acipher_speed()
1131 if (IS_ERR(tfm)) { in test_acipher_speed()
1133 PTR_ERR(tfm)); in test_acipher_speed()
1138 get_driver_name(crypto_ablkcipher, tfm), e); in test_acipher_speed()
1140 req = ablkcipher_request_alloc(tfm, GFP_KERNEL); in test_acipher_speed()
1178 crypto_ablkcipher_clear_flags(tfm, ~0); in test_acipher_speed()
1180 ret = crypto_ablkcipher_setkey(tfm, key, *keysize); in test_acipher_speed()
1183 crypto_ablkcipher_get_flags(tfm)); in test_acipher_speed()
1207 iv_len = crypto_ablkcipher_ivsize(tfm); in test_acipher_speed()
1222 crypto_ablkcipher_get_flags(tfm)); in test_acipher_speed()
1234 crypto_free_ablkcipher(tfm); in test_acipher_speed()