• Home
  • Raw
  • Download

Lines Matching full:hash

13  *	Calculates md5/sha1 file hash, template hash, boot-aggreate hash
26 #include <crypto/hash.h>
76 pr_info("Allocated hash algorithm: %s\n", in ima_init_crypto()
208 struct ima_digest_data *hash, in ima_calc_file_hash_atfm() argument
219 hash->length = crypto_ahash_digestsize(tfm); in ima_calc_file_hash_atfm()
310 ahash_request_set_crypt(req, NULL, hash->digest, 0); in ima_calc_file_hash_atfm()
318 static int ima_calc_file_ahash(struct file *file, struct ima_digest_data *hash) in ima_calc_file_ahash() argument
323 tfm = ima_alloc_atfm(hash->algo); in ima_calc_file_ahash()
327 rc = ima_calc_file_hash_atfm(file, hash, tfm); in ima_calc_file_ahash()
335 struct ima_digest_data *hash, in ima_calc_file_hash_tfm() argument
346 hash->length = crypto_shash_digestsize(tfm); in ima_calc_file_hash_tfm()
380 rc = crypto_shash_final(shash, hash->digest); in ima_calc_file_hash_tfm()
384 static int ima_calc_file_shash(struct file *file, struct ima_digest_data *hash) in ima_calc_file_shash() argument
389 tfm = ima_alloc_tfm(hash->algo); in ima_calc_file_shash()
393 rc = ima_calc_file_hash_tfm(file, hash, tfm); in ima_calc_file_shash()
401 * ima_calc_file_hash - calculate file hash
403 * Asynchronous hash (ahash) allows using HW acceleration for calculating
404 * a hash. ahash performance varies for different data sizes on different
410 * shash for the hash calculation. If ahash fails, it falls back to using
413 int ima_calc_file_hash(struct file *file, struct ima_digest_data *hash) in ima_calc_file_hash() argument
425 hash->length = hash_digest_size[ima_hash_algo]; in ima_calc_file_hash()
426 hash->algo = ima_hash_algo; in ima_calc_file_hash()
453 rc = ima_calc_file_ahash(f, hash); in ima_calc_file_hash()
458 rc = ima_calc_file_shash(f, hash); in ima_calc_file_hash()
468 * Calculate the hash of template data
473 struct ima_digest_data *hash, in ima_calc_field_array_hash_tfm() argument
482 hash->length = crypto_shash_digestsize(tfm); in ima_calc_field_array_hash_tfm()
512 rc = crypto_shash_final(shash, hash->digest); in ima_calc_field_array_hash_tfm()
519 struct ima_digest_data *hash) in ima_calc_field_array_hash() argument
524 tfm = ima_alloc_tfm(hash->algo); in ima_calc_field_array_hash()
529 hash, tfm); in ima_calc_field_array_hash()
537 struct ima_digest_data *hash, in calc_buffer_ahash_atfm() argument
545 hash->length = crypto_ahash_digestsize(tfm); in calc_buffer_ahash_atfm()
568 ahash_request_set_crypt(req, NULL, hash->digest, 0); in calc_buffer_ahash_atfm()
577 struct ima_digest_data *hash) in calc_buffer_ahash() argument
582 tfm = ima_alloc_atfm(hash->algo); in calc_buffer_ahash()
586 rc = calc_buffer_ahash_atfm(buf, len, hash, tfm); in calc_buffer_ahash()
594 struct ima_digest_data *hash, in calc_buffer_shash_tfm() argument
604 hash->length = crypto_shash_digestsize(tfm); in calc_buffer_shash_tfm()
620 rc = crypto_shash_final(shash, hash->digest); in calc_buffer_shash_tfm()
625 struct ima_digest_data *hash) in calc_buffer_shash() argument
630 tfm = ima_alloc_tfm(hash->algo); in calc_buffer_shash()
634 rc = calc_buffer_shash_tfm(buf, len, hash, tfm); in calc_buffer_shash()
641 struct ima_digest_data *hash) in ima_calc_buffer_hash() argument
646 rc = calc_buffer_ahash(buf, len, hash); in ima_calc_buffer_hash()
651 return calc_buffer_shash(buf, len, hash); in ima_calc_buffer_hash()
664 * Calculate the boot aggregate hash
693 int ima_calc_boot_aggregate(struct ima_digest_data *hash) in ima_calc_boot_aggregate() argument
698 tfm = ima_alloc_tfm(hash->algo); in ima_calc_boot_aggregate()
702 hash->length = crypto_shash_digestsize(tfm); in ima_calc_boot_aggregate()
703 rc = ima_calc_boot_aggregate_tfm(hash->digest, tfm); in ima_calc_boot_aggregate()