Home
last modified time | relevance | path

Searched refs:FEC_BLOCKSIZE (Results 1 – 10 of 10) sorted by relevance

/system/extras/libfec/
Dfec_verity.cpp98 uint64_t hashes = file_size / FEC_BLOCKSIZE; in verity_get_size()
105 hashes = fec_div_round_up(hashes * SHA256_DIGEST_LENGTH, FEC_BLOCKSIZE); in verity_get_size()
115 return total * FEC_BLOCKSIZE; in verity_get_size()
131 SHA256_Update(&ctx, block, FEC_BLOCKSIZE); in verity_hash()
173 if (fec_pread(f, data, FEC_BLOCKSIZE, data_offset) != FEC_BLOCKSIZE) { in ecc_read_hashes()
187 uint8_t data[FEC_BLOCKSIZE]; in verify_tree()
198 verity_get_size(v->data_blocks * FEC_BLOCKSIZE, &levels, NULL); in verify_tree()
204 uint64_t data_offset = hash_offset + FEC_BLOCKSIZE; in verify_tree()
209 if (!raw_pread(f, data, FEC_BLOCKSIZE, hash_offset) || in verify_tree()
217 !raw_pwrite(f, data, FEC_BLOCKSIZE, hash_offset)) { in verify_tree()
[all …]
Dfec_read.cpp78 uint64_t n = offset / FEC_BLOCKSIZE; in is_erasure()
93 uint64_t hash_offset = (offset / FEC_BLOCKSIZE) * SHA256_DIGEST_LENGTH; in is_zero()
96 v->hash_data_blocks * FEC_BLOCKSIZE - SHA256_DIGEST_LENGTH)) { in is_zero()
108 check(offset % FEC_BLOCKSIZE == 0); in __ecc_read()
113 uint64_t rsb = offset - (offset / (e->rounds * FEC_BLOCKSIZE)) * in __ecc_read()
114 e->rounds * FEC_BLOCKSIZE; in __ecc_read()
132 uint8_t bbuf[FEC_BLOCKSIZE] = {0}; in __ecc_read()
136 if (!raw_pread(f, bbuf, FEC_BLOCKSIZE, interleaved)) { in __ecc_read()
149 for (int j = 0; j < FEC_BLOCKSIZE; ++j) { in __ecc_read()
159 for (int i = 0; i < FEC_BLOCKSIZE; ++i) { in __ecc_read()
[all …]
Dfec_open.cpp50 if (file_size % FEC_BLOCKSIZE) { in find_offset()
52 error("file size not multiple of " stringify(FEC_BLOCKSIZE)); in find_offset()
62 mi = ((hi + lo) / (2 * FEC_BLOCKSIZE)) * FEC_BLOCKSIZE; in find_offset()
66 lo = mi + FEC_BLOCKSIZE; in find_offset()
121 offset -= offset % FEC_BLOCKSIZE; in parse_ecc_header()
144 header.fec_size % FEC_BLOCKSIZE) { in parse_ecc_header()
157 f->ecc.blocks = fec_div_round_up(f->data_size, FEC_BLOCKSIZE); in parse_ecc_header()
161 (uint32_t)f->ecc.rounds * f->ecc.roots * FEC_BLOCKSIZE) { in parse_ecc_header()
173 uint8_t buf[FEC_BLOCKSIZE]; in parse_ecc_header()
175 uint32_t len = FEC_BLOCKSIZE; in parse_ecc_header()
[all …]
Dfec_process.cpp62 uint64_t start = (offset / FEC_BLOCKSIZE) * FEC_BLOCKSIZE; in process()
63 size_t blocks = fec_div_round_up(count, FEC_BLOCKSIZE); in process()
69 size_t count_per_thread = fec_div_round_up(blocks, threads) * FEC_BLOCKSIZE; in process()
Dfec_private.h47 #define VERITY_METADATA_SIZE (8 * FEC_BLOCKSIZE)
/system/extras/libfec/include/fec/
Decc.h53 return (offset / rsn) + (offset % rsn) * rounds * FEC_BLOCKSIZE; in fec_ecc_interleave()
59 return fec_div_round_up(fec_div_round_up(file_size, FEC_BLOCKSIZE), in fec_ecc_get_size()
61 * roots * FEC_BLOCKSIZE in fec_ecc_get_size()
62 + FEC_BLOCKSIZE; in fec_ecc_get_size()
Dio.h37 #define FEC_BLOCKSIZE 4096 macro
/system/extras/verity/fec/
Dimage.cpp62 munmap(ctx->fec_mmap_addr, FEC_BLOCKSIZE + ctx->fec_size); in mmap_image_free()
122 } else if (size % FEC_BLOCKSIZE) { in calculate_rounds()
124 size, FEC_BLOCKSIZE); in calculate_rounds()
128 ctx->blocks = fec_div_round_up(ctx->inp_size, FEC_BLOCKSIZE); in calculate_rounds()
193 assert(len % FEC_BLOCKSIZE == 0); in process_chunk()
349 assert(sizeof(fec_header) <= FEC_BLOCKSIZE); in mmap_image_ecc_new()
350 size_t fec_size = FEC_BLOCKSIZE + ctx->fec_size; in mmap_image_ecc_new()
391 ctx->fec_size = ctx->rounds * ctx->roots * FEC_BLOCKSIZE; in image_ecc_new()
411 if (lseek64(fd, -FEC_BLOCKSIZE, SEEK_END) < 0) { in image_ecc_load()
416 assert(sizeof(fec_header) <= FEC_BLOCKSIZE); in image_ecc_load()
[all …]
/system/extras/libfec/test/
Dtest_read.cpp24 const unsigned bufsize = 2 * 1024 * FEC_BLOCKSIZE;
/system/core/fs_mgr/
Dfs_mgr_verity.cpp258 params->ecc.start / FEC_BLOCKSIZE, params->ecc.blocks, params->ecc.roots); in format_verity_table()
263 params->ecc.start / FEC_BLOCKSIZE, params->ecc.blocks, params->ecc.roots); in format_verity_table()