Lines Matching refs:ecc
102 check(f->ecc.rsn > 0 && f->ecc.rsn < FEC_RSM); in parse_ecc_header()
138 if (f->ecc.roots != (int)header.roots) { in parse_ecc_header()
139 error("unexpected number of roots: %d vs %u", f->ecc.roots, in parse_ecc_header()
157 f->ecc.blocks = fec_div_round_up(f->data_size, FEC_BLOCKSIZE); in parse_ecc_header()
158 f->ecc.rounds = fec_div_round_up(f->ecc.blocks, f->ecc.rsn); in parse_ecc_header()
161 (uint32_t)f->ecc.rounds * f->ecc.roots * FEC_BLOCKSIZE) { in parse_ecc_header()
166 f->ecc.size = header.fec_size; in parse_ecc_header()
167 f->ecc.start = header.inp_size; in parse_ecc_header()
177 while (n < f->ecc.size) { in parse_ecc_header()
178 if (len > f->ecc.size - n) { in parse_ecc_header()
179 len = f->ecc.size - n; in parse_ecc_header()
182 if (!raw_pread(f, buf, len, f->ecc.start + n)) { in parse_ecc_header()
194 f->ecc.valid = !memcmp(hash, header.hash, SHA256_DIGEST_LENGTH); in parse_ecc_header()
196 if (!f->ecc.valid) { in parse_ecc_header()
361 f->ecc.start); in load_ecc()
410 memset(&f->ecc, 0, sizeof(f->ecc)); in reset_handle()
480 if (!f->ecc.start) { in fec_ecc_get_metadata()
485 check(f->ecc.start >= f->data_size); in fec_ecc_get_metadata()
486 check(f->ecc.start < f->size); in fec_ecc_get_metadata()
487 check(f->ecc.start % FEC_BLOCKSIZE == 0) in fec_ecc_get_metadata()
489 data->valid = f->ecc.valid; in fec_ecc_get_metadata()
490 data->roots = f->ecc.roots; in fec_ecc_get_metadata()
491 data->blocks = f->ecc.blocks; in fec_ecc_get_metadata()
492 data->rounds = f->ecc.rounds; in fec_ecc_get_metadata()
493 data->start = f->ecc.start; in fec_ecc_get_metadata()
543 f->ecc.roots = roots; in fec_open()
544 f->ecc.rsn = FEC_RSM - roots; in fec_open()