• Home
  • Raw
  • Download

Lines Matching refs:params

28 int fsverity_init_merkle_tree_params(struct merkle_tree_params *params,  in fsverity_init_merkle_tree_params()  argument
40 memset(params, 0, sizeof(*params)); in fsverity_init_merkle_tree_params()
45 params->hash_alg = hash_alg; in fsverity_init_merkle_tree_params()
46 params->digest_size = hash_alg->digest_size; in fsverity_init_merkle_tree_params()
48 params->hashstate = fsverity_prepare_hash_state(hash_alg, salt, in fsverity_init_merkle_tree_params()
50 if (IS_ERR(params->hashstate)) { in fsverity_init_merkle_tree_params()
51 err = PTR_ERR(params->hashstate); in fsverity_init_merkle_tree_params()
52 params->hashstate = NULL; in fsverity_init_merkle_tree_params()
63 params->log_blocksize = log_blocksize; in fsverity_init_merkle_tree_params()
64 params->block_size = 1 << log_blocksize; in fsverity_init_merkle_tree_params()
66 if (WARN_ON(!is_power_of_2(params->digest_size))) { in fsverity_init_merkle_tree_params()
70 if (params->block_size < 2 * params->digest_size) { in fsverity_init_merkle_tree_params()
73 params->block_size, hash_alg->name); in fsverity_init_merkle_tree_params()
77 params->log_arity = params->log_blocksize - ilog2(params->digest_size); in fsverity_init_merkle_tree_params()
78 params->hashes_per_block = 1 << params->log_arity; in fsverity_init_merkle_tree_params()
81 hash_alg->name, params->block_size, params->hashes_per_block, in fsverity_init_merkle_tree_params()
92 blocks = (inode->i_size + params->block_size - 1) >> log_blocksize; in fsverity_init_merkle_tree_params()
95 if (params->num_levels >= FS_VERITY_MAX_LEVELS) { in fsverity_init_merkle_tree_params()
100 blocks = (blocks + params->hashes_per_block - 1) >> in fsverity_init_merkle_tree_params()
101 params->log_arity; in fsverity_init_merkle_tree_params()
103 params->level_start[params->num_levels++] = blocks; in fsverity_init_merkle_tree_params()
108 for (level = (int)params->num_levels - 1; level >= 0; level--) { in fsverity_init_merkle_tree_params()
109 blocks = params->level_start[level]; in fsverity_init_merkle_tree_params()
110 params->level_start[level] = offset; in fsverity_init_merkle_tree_params()
116 params->tree_size = offset << log_blocksize; in fsverity_init_merkle_tree_params()
120 kfree(params->hashstate); in fsverity_init_merkle_tree_params()
121 memset(params, 0, sizeof(*params)); in fsverity_init_merkle_tree_params()