Lines Matching refs:block_size
29 u32 block_size, const u8 *salt, u32 salt_size) in hash_one_block() argument
34 memset(&cur->data[cur->filled], 0, block_size - cur->filled); in hash_one_block()
38 libfsverity_hash_update(hash, cur->data, block_size); in hash_one_block()
45 static bool block_is_full(const struct block_buffer *block, u32 block_size, in block_is_full() argument
49 return block->filled + hash->alg->digest_size > block_size; in block_is_full()
68 u32 block_size, u64 *level_offset) in report_merkle_tree_block() argument
73 block_size, in report_merkle_tree_block()
74 *level_offset * block_size); in report_merkle_tree_block()
105 u32 block_size, const u8 *salt, u32 salt_size, in compute_root_hash() argument
109 const u32 hashes_per_block = block_size / hash->alg->digest_size; in compute_root_hash()
110 const u32 padded_salt_size = roundup(salt_size, hash->alg->block_size); in compute_root_hash()
135 blocks = DIV_ROUND_UP(file_size, block_size); in compute_root_hash()
164 err = report_merkle_tree_size(metadata_cbs, offset * block_size); in compute_root_hash()
174 buffers[level].data = libfsverity_zalloc(block_size); in compute_root_hash()
183 for (offset = 0; offset < file_size; offset += block_size) { in compute_root_hash()
184 buffers[-1].filled = min(block_size, file_size - offset); in compute_root_hash()
192 hash_one_block(hash, &buffers[-1], block_size, in compute_root_hash()
195 if (!block_is_full(&buffers[level], block_size, hash)) in compute_root_hash()
197 hash_one_block(hash, &buffers[level], block_size, in compute_root_hash()
201 block_size, in compute_root_hash()
210 hash_one_block(hash, &buffers[level], block_size, in compute_root_hash()
214 block_size, in compute_root_hash()
240 u32 block_size; in libfsverity_compute_digest() local
258 block_size = params->block_size ?: FS_VERITY_BLOCK_SIZE_DEFAULT; in libfsverity_compute_digest()
260 if (!is_power_of_2(block_size)) { in libfsverity_compute_digest()
262 block_size); in libfsverity_compute_digest()
288 if (block_size < 2 * hash_alg->digest_size) { in libfsverity_compute_digest()
290 block_size, hash_alg->name); in libfsverity_compute_digest()
301 desc.log_blocksize = ilog2(block_size); in libfsverity_compute_digest()
309 block_size, params->salt, params->salt_size, in libfsverity_compute_digest()