Home
last modified time | relevance | path

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

/system/extras/libfec/
Dfec_verity.cpp104 uint64_t hashes = file_size / FEC_BLOCKSIZE; in verity_get_size()
111 hashes = fec_div_round_up(hashes * padded_digest_size, FEC_BLOCKSIZE); in verity_get_size()
121 return total * FEC_BLOCKSIZE; in verity_get_size()
132 EVP_DigestUpdate(mdctx, block, FEC_BLOCKSIZE); in get_hash()
195 if (fec_pread(f, data, FEC_BLOCKSIZE, data_offset) != FEC_BLOCKSIZE) { in ecc_read_hashes()
208 uint8_t data[FEC_BLOCKSIZE]; in verify_tree()
213 uint64_t hash_size = verity_get_size(data_blocks * FEC_BLOCKSIZE, &levels, in verify_tree()
220 uint64_t data_offset = hash_offset + FEC_BLOCKSIZE; in verify_tree()
223 if (!raw_pread(f->fd, data, FEC_BLOCKSIZE, hash_offset) || in verify_tree()
232 !raw_pwrite(f->fd, data, FEC_BLOCKSIZE, hash_offset)) { in verify_tree()
[all …]
Dfec_read.cpp80 uint64_t n = offset / FEC_BLOCKSIZE; in is_erasure()
94 uint64_t hash_offset = (offset / FEC_BLOCKSIZE) * SHA256_DIGEST_LENGTH; in is_zero()
110 check(offset % FEC_BLOCKSIZE == 0); in __ecc_read()
115 uint64_t rsb = offset - (offset / (e->rounds * FEC_BLOCKSIZE)) * in __ecc_read()
116 e->rounds * FEC_BLOCKSIZE; in __ecc_read()
134 uint8_t bbuf[FEC_BLOCKSIZE] = {0}; in __ecc_read()
138 if (!raw_pread(f->fd, bbuf, FEC_BLOCKSIZE, interleaved)) { in __ecc_read()
151 for (int j = 0; j < FEC_BLOCKSIZE; ++j) { in __ecc_read()
161 for (int i = 0; i < FEC_BLOCKSIZE; ++i) { in __ecc_read()
204 return FEC_BLOCKSIZE; in __ecc_read()
[all …]
Dfec_open.cpp49 if (file_size % FEC_BLOCKSIZE) { in find_offset()
51 error("file size not multiple of " stringify(FEC_BLOCKSIZE)); in find_offset()
61 mi = ((hi + lo) / (2 * FEC_BLOCKSIZE)) * FEC_BLOCKSIZE; in find_offset()
65 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()
150 f->ecc.blocks = fec_div_round_up(f->data_size, FEC_BLOCKSIZE); in parse_ecc_header()
154 (uint32_t)f->ecc.rounds * f->ecc.roots * FEC_BLOCKSIZE) { in parse_ecc_header()
166 uint8_t buf[FEC_BLOCKSIZE]; in parse_ecc_header()
168 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()
65 size_t count_per_thread = fec_div_round_up(blocks, threads) * FEC_BLOCKSIZE; in process()
Davb_utils.cpp128 f->ecc.blocks = fec_div_round_up(f->data_size, FEC_BLOCKSIZE); in parse_avb_image()
148 hashtree_descriptor.tree_offset / FEC_BLOCKSIZE, salt, in parse_avb_image()
Dfec_private.h48 #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.h38 #define FEC_BLOCKSIZE 4096 macro
/system/extras/verity/fec/
Dimage.cpp70 } else if (size % FEC_BLOCKSIZE) { in calculate_rounds()
72 size, FEC_BLOCKSIZE); in calculate_rounds()
76 ctx->blocks = fec_div_round_up(ctx->inp_size, FEC_BLOCKSIZE); in calculate_rounds()
138 assert(ctx->pos % FEC_BLOCKSIZE == 0); in file_image_load()
197 ctx->fec_size = ctx->rounds * ctx->roots * FEC_BLOCKSIZE; in image_ecc_new()
221 if (lseek64(fd, -FEC_BLOCKSIZE, SEEK_END) < 0) { in image_ecc_load()
226 assert(sizeof(fec_header) <= FEC_BLOCKSIZE); in image_ecc_load()
228 uint8_t header[FEC_BLOCKSIZE]; in image_ecc_load()
254 if (p->fec_size % p->roots || p->fec_size % FEC_BLOCKSIZE) { in image_ecc_load()
294 assert(2 * sizeof(fec_header) <= FEC_BLOCKSIZE); in image_ecc_save()
[all …]
Dmain.cpp350 if (ctx.padding % FEC_BLOCKSIZE) { in main()
351 FATAL("padding must be multiple of %u\n", FEC_BLOCKSIZE); in main()
/system/extras/libfec/test/
Dtest_read.cpp24 const unsigned bufsize = 2 * 1024 * FEC_BLOCKSIZE;
Dfec_unittest.cpp154 verity_get_size(handle->hashtree().data_blocks * FEC_BLOCKSIZE, nullptr, in TEST_F()
242 verity_get_size(handle->hashtree().data_blocks * FEC_BLOCKSIZE, nullptr, in TEST_F()
/system/update_engine/payload_generator/
Dpayload_generation_config_android.cc157 if (part.verity.IsEmpty() && part.size > FEC_BLOCKSIZE) { in LoadVerityConfig()
160 part.size - FEC_BLOCKSIZE, in LoadVerityConfig()
212 TEST_AND_RETURN_FALSE(block_size == FEC_BLOCKSIZE); in LoadVerityConfig()
/system/core/fs_mgr/
Dfs_mgr_verity.cpp214 params->ecc.start / FEC_BLOCKSIZE, params->ecc.blocks, params->ecc.roots); in format_verity_table()
219 params->ecc.start / FEC_BLOCKSIZE, params->ecc.blocks, params->ecc.roots); in format_verity_table()