| 1146 | } |
| 1147 | |
| 1148 | void FSCrypt::prepare_data_read(const FSCryptContextRef& ctx, |
| 1149 | FSCryptKeyValidatorRef *kv, |
| 1150 | uint64_t off, |
| 1151 | uint64_t len, |
| 1152 | uint64_t file_raw_size, |
| 1153 | uint64_t *read_start, |
| 1154 | uint64_t *read_len, |
| 1155 | FSCryptFDataDencRef *denc) |
| 1156 | { |
| 1157 | *denc = get_fdata_denc(ctx, kv); |
| 1158 | |
| 1159 | auto& fscrypt_denc = *denc; |
| 1160 | |
| 1161 | *read_start = (!fscrypt_denc ? off : fscrypt_block_start(off)); |
| 1162 | uint64_t end = off + len; |
| 1163 | if (fscrypt_denc) { |
| 1164 | end = fscrypt_align_ofs(end); |
| 1165 | } |
| 1166 | *read_len = end - *read_start; |
| 1167 | } |
| 1168 | #endif |
no test coverage detected