| 1 | use crate::protocol::ErrorCode; |
| 2 | use std::io::Read; |
| 3 | use zeroize::Zeroize; |
| 4 | // 최근 8 MiB만 메모리에 두고 더 먼 사전 참조는 임시 파일에서 읽음. |
| 5 | struct History<'a> { |
| 6 | file: &'a mut std::fs::File, |
| 7 | base: u64, |
| 8 | len: u64, |
| 9 | cache: zeroize::Zeroizing<Vec<u8>>, |
| 10 | pending: zeroize::Zeroizing<Vec<u8>>, |
| 11 | } |
| 12 | impl<'a> History<'a> { |
| 13 | fn new(file: &'a mut std::fs::File, dictionary: usize) -> Result<Self> { |
| 14 | use std::io::Seek; |
| 15 | let base = file.stream_position().map_err(crate::space::io_error)?; |
| 16 | Ok(Self { |
| 17 | file, |
| 18 | base, |
| 19 | len: 0, |
| 20 | cache: zeroize::Zeroizing::new(vec![0; dictionary.min(8 * 1024 * 1024)]), |
| 21 | pending: zeroize::Zeroizing::new(Vec::with_capacity(65536)), |
| 22 | }) |
| 23 | } |
| 24 | fn len(&self) -> u64 { |
| 25 | self.len |
| 26 | } |
| 27 | fn flush(&mut self) -> Result<()> { |
| 28 | use std::io::Write; |
| 29 | crate::space::ensure(self.file, self.pending.len() as u64)?; |
| 30 | self.file |
| 31 | .write_all(&self.pending) |
| 32 | .map_err(crate::space::io_error)?; |
| 33 | self.pending.as_mut_slice().zeroize(); |
| 34 | self.pending.clear(); |
| 35 | Ok(()) |
| 36 | } |
| 37 | fn extend(&mut self, mut bytes: &[u8]) -> Result<()> { |
| 38 | while !bytes.is_empty() { |
| 39 | let at = (self.len % self.cache.len() as u64) as usize; |
| 40 | let n = bytes |
| 41 | .len() |
| 42 | .min(self.cache.len() - at) |
| 43 | .min(65536 - self.pending.len()); |
| 44 | self.cache[at..at + n].copy_from_slice(&bytes[..n]); |
| 45 | self.pending.extend_from_slice(&bytes[..n]); |
| 46 | self.len = self.len.checked_add(n as u64).ok_or(ErrorCode::Limit)?; |
| 47 | bytes = &bytes[n..]; |
| 48 | if self.pending.len() == 65536 { |
| 49 | self.flush()?; |
| 50 | } |
| 51 | } |
| 52 | Ok(()) |
| 53 | } |
| 54 | fn push(&mut self, byte: u8) -> Result<()> { |
| 55 | self.extend(&[byte]) |
| 56 | } |
| 57 | fn read_back(&mut self, distance: usize, bytes: &mut [u8]) -> Result<()> { |
| 58 | use std::io::{Read, Seek, SeekFrom}; |
| 59 | if distance as u64 > self.len || bytes.len() > distance { |
| 60 | return Err(ErrorCode::Integrity); |
| 61 | } |
| 62 | if distance <= self.cache.len() { |
| 63 | let at = ((self.len - distance as u64) % self.cache.len() as u64) as usize; |
| 64 | let n = bytes.len().min(self.cache.len() - at); |
| 65 | bytes[..n].copy_from_slice(&self.cache[at..at + n]); |
| 66 | let rest = bytes.len() - n; |
| 67 | bytes[n..].copy_from_slice(&self.cache[..rest]); |
| 68 | } else { |
| 69 | self.flush()?; |
| 70 | self.file |
| 71 | .seek(SeekFrom::Start(self.base + self.len - distance as u64)) |
| 72 | .map_err(crate::space::io_error)?; |
| 73 | self.file |
| 74 | .read_exact(bytes) |
| 75 | .map_err(crate::space::io_error)?; |
| 76 | self.file |
| 77 | .seek(SeekFrom::Start(self.base + self.len)) |
| 78 | .map_err(crate::space::io_error)?; |
| 79 | } |
| 80 | Ok(()) |
| 81 | } |
| 82 | fn previous(&mut self, history: u64, distance: u32, dictionary: usize) -> Result<u8> { |
| 83 | let distance = distance as usize + 1; |
| 84 | if distance > dictionary || distance as u64 > self.len - history { |
| 85 | return Err(ErrorCode::Integrity); |
| 86 | } |
| 87 | let mut value = [0]; |
| 88 | self.read_back(distance, &mut value)?; |
| 89 | Ok(value[0]) |
| 90 | } |
| 91 | fn copy( |
| 92 | &mut self, |
| 93 | history: u64, |
| 94 | distance: u32, |
| 95 | dictionary: usize, |
| 96 | length: usize, |
| 97 | ) -> Result<()> { |
| 98 | let distance = distance as usize + 1; |
| 99 | if distance > dictionary || distance as u64 > self.len - history { |
| 100 | return Err(ErrorCode::Integrity); |
| 101 | } |
| 102 | let mut buffer = zeroize::Zeroizing::new([0; 273]); |
| 103 | if distance == 1 { |
| 104 | let byte = self.previous(history, 0, dictionary)?; |
| 105 | buffer[..length].fill(byte); |
| 106 | return self.extend(&buffer[..length]); |
| 107 | } |
| 108 | let mut remaining = length; |
| 109 | while remaining != 0 { |
| 110 | let n = remaining.min(distance).min(buffer.len()); |
| 111 | self.read_back(distance, &mut buffer[..n])?; |
| 112 | self.extend(&buffer[..n])?; |
| 113 | remaining -= n; |
| 114 | } |
| 115 | Ok(()) |
| 116 | } |
| 117 | } |
| 118 | type Result<T> = std::result::Result<T, ErrorCode>; |
| 119 | const MAX_DICT: usize = 64 * 1024 * 1024; |
| 120 | struct Range<'a> { |
| 121 | input: &'a mut dyn Read, |
| 122 | at: u64, |
| 123 | length: u64, |
| 124 | range: u32, |
| 125 | code: u32, |
| 126 | } |
| 127 | impl<'a> Range<'a> { |
| 128 | fn new(input: &'a mut dyn Read, length: u64) -> Result<Self> { |
| 129 | let mut prefix = [0; 5]; |
| 130 | input |
| 131 | .read_exact(&mut prefix) |
| 132 | .map_err(|_| ErrorCode::Integrity)?; |
| 133 | if length < 5 || prefix[0] != 0 { |
| 134 | return Err(ErrorCode::Integrity); |
| 135 | } |
| 136 | Ok(Self { |
| 137 | input, |
| 138 | at: 5, |
| 139 | length, |
| 140 | range: u32::MAX, |
| 141 | code: u32::from_be_bytes(prefix[1..5].try_into().unwrap()), |
| 142 | }) |
| 143 | } |
| 144 | fn normalize(&mut self) -> Result<()> { |
| 145 | if self.range < 1 << 24 { |
| 146 | self.range <<= 8; |
| 147 | if self.at >= self.length { |
| 148 | return Err(ErrorCode::Integrity); |
| 149 | } |
| 150 | let mut byte = [0]; |
| 151 | self.input |
| 152 | .read_exact(&mut byte) |
| 153 | .map_err(|_| ErrorCode::Integrity)?; |
| 154 | self.code = (self.code << 8) | byte[0] as u32; |
| 155 | self.at += 1; |
| 156 | } |
| 157 | Ok(()) |
| 158 | } |
| 159 | fn bit(&mut self, probability: &mut u16) -> Result<usize> { |
| 160 | let bound = (self.range >> 11) * *probability as u32; |
| 161 | let bit = if self.code < bound { |
| 162 | self.range = bound; |
| 163 | *probability += (2048 - *probability) >> 5; |
| 164 | 0 |
| 165 | } else { |
| 166 | self.range -= bound; |
| 167 | self.code -= bound; |
| 168 | *probability -= *probability >> 5; |
| 169 | 1 |
| 170 | }; |
| 171 | self.normalize()?; |
| 172 | Ok(bit) |
| 173 | } |
| 174 | fn direct(&mut self, count: usize) -> Result<u32> { |
| 175 | let mut value = 0; |
| 176 | for _ in 0..count { |
| 177 | self.range >>= 1; |
| 178 | let bit = u32::from(self.code >= self.range); |
| 179 | if bit != 0 { |
| 180 | self.code -= self.range; |
| 181 | } |
| 182 | value = (value << 1) | bit; |
| 183 | self.normalize()?; |
| 184 | } |
| 185 | Ok(value) |
| 186 | } |
| 187 | fn tree(&mut self, p: &mut [u16], bits: usize) -> Result<usize> { |
| 188 | let mut symbol = 1; |
| 189 | for _ in 0..bits { |
| 190 | symbol = (symbol << 1) | self.bit(&mut p[symbol])?; |
| 191 | } |
| 192 | Ok(symbol - (1 << bits)) |
| 193 | } |
| 194 | fn reverse(&mut self, p: &mut [u16], base: isize, bits: usize) -> Result<u32> { |
| 195 | let mut symbol = 1; |
| 196 | let mut value = 0; |
| 197 | for i in 0..bits { |
| 198 | let index = |
| 199 | usize::try_from(base + symbol as isize).map_err(|_| ErrorCode::Integrity)?; |
| 200 | let bit = self.bit(p.get_mut(index).ok_or(ErrorCode::Integrity)?)?; |
| 201 | symbol = (symbol << 1) | bit; |
| 202 | value |= (bit as u32) << i; |
| 203 | } |
| 204 | Ok(value) |
| 205 | } |
| 206 | fn finished(&self) -> bool { |
| 207 | self.code == 0 && self.at == self.length |
| 208 | } |
| 209 | } |
| 210 | struct Length { |
| 211 | choice: [u16; 2], |
| 212 | low: [[u16; 8]; 16], |
| 213 | middle: [[u16; 8]; 16], |
| 214 | high: [u16; 256], |
| 215 | } |
| 216 | impl Length { |
| 217 | fn new() -> Self { |
| 218 | Self { |
| 219 | choice: [1024; 2], |
| 220 | low: [[1024; 8]; 16], |
| 221 | middle: [[1024; 8]; 16], |
| 222 | high: [1024; 256], |
| 223 | } |
| 224 | } |
| 225 | fn read(&mut self, r: &mut Range<'_>, position: usize) -> Result<usize> { |
| 226 | if r.bit(&mut self.choice[0])? == 0 { |
| 227 | r.tree(&mut self.low[position], 3) |
| 228 | } else if r.bit(&mut self.choice[1])? == 0 { |
| 229 | Ok(8 + r.tree(&mut self.middle[position], 3)?) |
| 230 | } else { |
| 231 | Ok(16 + r.tree(&mut self.high, 8)?) |
| 232 | } |
| 233 | } |
| 234 | } |
| 235 | struct Model { |
| 236 | lc: usize, |
| 237 | lp: usize, |
| 238 | pb: usize, |
| 239 | state: usize, |
| 240 | reps: [u32; 4], |
| 241 | literal: Vec<u16>, |
| 242 | matches: [[u16; 16]; 12], |
| 243 | rep: [u16; 12], |
| 244 | g0: [u16; 12], |
| 245 | g1: [u16; 12], |
| 246 | g2: [u16; 12], |
| 247 | short: [[u16; 16]; 12], |
| 248 | slots: [[u16; 64]; 4], |
| 249 | special: [u16; 114], |
| 250 | align: [u16; 16], |
| 251 | length: Length, |
| 252 | rep_length: Length, |
| 253 | } |
| 254 | impl Model { |
| 255 | fn new(property: u8) -> Result<Self> { |
| 256 | if property >= 225 { |
| 257 | return Err(ErrorCode::Integrity); |
| 258 | } |
| 259 | let lc = property as usize % 9; |
| 260 | let lp = (property as usize / 9) % 5; |
| 261 | let pb = property as usize / 45; |
| 262 | if lc + lp > 4 { |
| 263 | return Err(ErrorCode::UnsupportedFeature); |
| 264 | } |
| 265 | Ok(Self { |
| 266 | lc, |
| 267 | lp, |
| 268 | pb, |
| 269 | state: 0, |
| 270 | reps: [0; 4], |
| 271 | literal: vec![1024; 0x300 << (lc + lp)], |
| 272 | matches: [[1024; 16]; 12], |
| 273 | rep: [1024; 12], |
| 274 | g0: [1024; 12], |
| 275 | g1: [1024; 12], |
| 276 | g2: [1024; 12], |
| 277 | short: [[1024; 16]; 12], |
| 278 | slots: [[1024; 64]; 4], |
| 279 | special: [1024; 114], |
| 280 | align: [1024; 16], |
| 281 | length: Length::new(), |
| 282 | rep_length: Length::new(), |
| 283 | }) |
| 284 | } |
| 285 | fn reset(&mut self) -> Result<()> { |
| 286 | *self = Self::new(((self.pb * 5 + self.lp) * 9 + self.lc) as u8)?; |
| 287 | Ok(()) |
| 288 | } |
| 289 | fn symbol( |
| 290 | &mut self, |
| 291 | r: &mut Range<'_>, |
| 292 | out: &mut History<'_>, |
| 293 | history: u64, |
| 294 | dictionary: usize, |
| 295 | target: u64, |
| 296 | ) -> Result<bool> { |
| 297 | let pos = out.len() - history; |
| 298 | let position = pos as usize & ((1 << self.pb) - 1); |
| 299 | let state = self.state; |
| 300 | if r.bit(&mut self.matches[state][position])? == 0 { |
| 301 | if out.len() >= target { |
| 302 | return Err(ErrorCode::Integrity); |
| 303 | } |
| 304 | let previous = if pos == 0 { |
| 305 | 0 |
| 306 | } else { |
| 307 | out.previous(history, 0, dictionary)? |
| 308 | }; |
| 309 | let context = (((pos as usize) & ((1 << self.lp) - 1)) << self.lc) |
| 310 | + (previous as usize >> (8 - self.lc)); |
| 311 | let p = &mut self.literal[context * 0x300..(context + 1) * 0x300]; |
| 312 | let mut symbol = 1; |
| 313 | if state >= 7 { |
| 314 | let mut matched = out.previous(history, self.reps[0], dictionary)?; |
| 315 | while symbol < 256 { |
| 316 | let m = (matched >> 7) as usize; |
| 317 | matched <<= 1; |
| 318 | let bit = r.bit(&mut p[((1 + m) << 8) + symbol])?; |
| 319 | symbol = (symbol << 1) | bit; |
| 320 | if bit != m { |
| 321 | break; |
| 322 | } |
| 323 | } |
| 324 | } |
| 325 | while symbol < 256 { |
| 326 | symbol = (symbol << 1) | r.bit(&mut p[symbol])?; |
| 327 | } |
| 328 | out.push(symbol as u8)?; |
| 329 | self.state = if state < 4 { |
| 330 | 0 |
| 331 | } else if state < 10 { |
| 332 | state - 3 |
| 333 | } else { |
| 334 | state - 6 |
| 335 | }; |
| 336 | return Ok(false); |
| 337 | } |
| 338 | let length; |
| 339 | if r.bit(&mut self.rep[state])? != 0 { |
| 340 | if r.bit(&mut self.g0[state])? == 0 { |
| 341 | if r.bit(&mut self.short[state][position])? == 0 { |
| 342 | self.state = if state < 7 { 9 } else { 11 }; |
| 343 | if out.len() >= target { |
| 344 | return Err(ErrorCode::Integrity); |
| 345 | } |
| 346 | let byte = out.previous(history, self.reps[0], dictionary)?; |
| 347 | out.push(byte)?; |
| 348 | return Ok(false); |
| 349 | } |
| 350 | } else { |
| 351 | let index = if r.bit(&mut self.g1[state])? == 0 { |
| 352 | 1 |
| 353 | } else if r.bit(&mut self.g2[state])? == 0 { |
| 354 | 2 |
| 355 | } else { |
| 356 | 3 |
| 357 | }; |
| 358 | let distance = self.reps[index]; |
| 359 | for i in (1..=index).rev() { |
| 360 | self.reps[i] = self.reps[i - 1]; |
| 361 | } |
| 362 | self.reps[0] = distance; |
| 363 | } |
| 364 | length = self.rep_length.read(r, position)? + 2; |
| 365 | self.state = if state < 7 { 8 } else { 11 }; |
| 366 | } else { |
| 367 | length = self.length.read(r, position)? + 2; |
| 368 | self.state = if state < 7 { 7 } else { 10 }; |
| 369 | let slot = r.tree(&mut self.slots[(length - 2).min(3)], 6)?; |
| 370 | let distance = if slot < 4 { |
| 371 | slot as u32 |
| 372 | } else { |
| 373 | let bits = (slot >> 1) - 1; |
| 374 | let base = ((2 | (slot & 1)) as u32) << bits; |
| 375 | if slot < 14 { |
| 376 | base + r.reverse(&mut self.special, base as isize - slot as isize - 1, bits)? |
| 377 | } else { |
| 378 | base + (r.direct(bits - 4)? << 4) + r.reverse(&mut self.align, 0, 4)? |
| 379 | } |
| 380 | }; |
| 381 | if distance == u32::MAX { |
| 382 | if length != 2 { |
| 383 | return Err(ErrorCode::Integrity); |
| 384 | } |
| 385 | return Ok(true); |
| 386 | } |
| 387 | self.reps.rotate_right(1); |
| 388 | self.reps[0] = distance; |
| 389 | } |
| 390 | if out |
| 391 | .len() |
| 392 | .checked_add(length as u64) |
| 393 | .is_none_or(|n| n > target) |
| 394 | { |
| 395 | return Err(ErrorCode::Integrity); |
| 396 | } |
| 397 | out.copy(history, self.reps[0], dictionary, length)?; |
| 398 | Ok(false) |
| 399 | } |
| 400 | fn decode( |
| 401 | &mut self, |
| 402 | input: &mut dyn Read, |
| 403 | length: u64, |
| 404 | out: &mut History<'_>, |
| 405 | history: u64, |
| 406 | dictionary: usize, |
| 407 | target: u64, |
| 408 | eos: bool, |
| 409 | check: &mut impl crate::resources::Monitor, |
| 410 | ) -> Result<()> { |
| 411 | let mut range = Range::new(input, length)?; |
| 412 | let mut next_check = out.len(); |
| 413 | while out.len() < target { |
| 414 | if out.len() >= next_check { |
| 415 | check.check()?; |
| 416 | if out.len() > next_check.saturating_sub(65536) { |
| 417 | crate::resources::completed(Ok(()), check)?; |
| 418 | } |
| 419 | check.observe( |
| 420 | crate::protocol::ResourceUsage { |
| 421 | actual_bytes: Some( |
| 422 | out.base.checked_add(out.len()).ok_or(ErrorCode::Limit)?, |
| 423 | ), |
| 424 | ..crate::protocol::ResourceUsage::default() |
| 425 | }, |
| 426 | Some(out.file), |
| 427 | )?; |
| 428 | next_check = out.len() + 65536; |
| 429 | } |
| 430 | if self.symbol(&mut range, out, history, dictionary, target)? { |
| 431 | return Err(ErrorCode::Integrity); |
| 432 | } |
| 433 | } |
| 434 | if !range.finished() { |
| 435 | if !eos |
| 436 | || !self.symbol(&mut range, out, history, dictionary, target)? |
| 437 | || !range.finished() |
| 438 | { |
| 439 | return Err(ErrorCode::Integrity); |
| 440 | } |
| 441 | } |
| 442 | Ok(()) |
| 443 | } |
| 444 | } |
| 445 | fn dictionary(size: u64) -> Result<usize> { |
| 446 | if size > MAX_DICT as u64 { |
| 447 | return Err(ErrorCode::Limit); |
| 448 | } |
| 449 | Ok((size as usize).max(4096)) |
| 450 | } |
| 451 | pub(crate) fn decode_stream( |
| 452 | input: &mut impl std::io::Read, |
| 453 | length: u64, |
| 454 | properties: &[u8], |
| 455 | lzma2: bool, |
| 456 | size: u64, |
| 457 | output: &mut std::fs::File, |
| 458 | check: &mut impl crate::resources::Monitor, |
| 459 | ) -> Result<()> { |
| 460 | use std::io::{BufReader, Read}; |
| 461 | crate::space::ensure(output, size)?; |
| 462 | let dict = if !lzma2 { |
| 463 | if properties.len() != 5 { |
| 464 | return Err(ErrorCode::Integrity); |
| 465 | } |
| 466 | dictionary(u32::from_le_bytes(properties[1..5].try_into().unwrap()) as u64)? |
| 467 | } else { |
| 468 | if properties.len() != 1 || properties[0] > 40 { |
| 469 | return Err(ErrorCode::Integrity); |
| 470 | } |
| 471 | let prop = properties[0] as u32; |
| 472 | dictionary(if prop == 40 { |
| 473 | u32::MAX as u64 |
| 474 | } else { |
| 475 | ((2 | (prop & 1)) as u64) << (prop / 2 + 11) |
| 476 | })? |
| 477 | }; |
| 478 | let mut out = History::new(output, dict)?; |
| 479 | let mut reader = BufReader::with_capacity(65536, input.take(length)); |
| 480 | if !lzma2 { |
| 481 | Model::new(properties[0])?.decode( |
| 482 | &mut reader, |
| 483 | length, |
| 484 | &mut out, |
| 485 | 0, |
| 486 | dict, |
| 487 | size, |
| 488 | true, |
| 489 | check, |
| 490 | )?; |
| 491 | return out.flush(); |
| 492 | } |
| 493 | let byte = |r: &mut dyn Read| -> Result<u8> { |
| 494 | let mut b = [0]; |
| 495 | r.read_exact(&mut b).map_err(|_| ErrorCode::Integrity)?; |
| 496 | Ok(b[0]) |
| 497 | }; |
| 498 | let word = |r: &mut dyn Read| -> Result<usize> { |
| 499 | let mut b = [0; 2]; |
| 500 | r.read_exact(&mut b).map_err(|_| ErrorCode::Integrity)?; |
| 501 | Ok(u16::from_be_bytes(b) as usize + 1) |
| 502 | }; |
| 503 | let mut history = 0; |
| 504 | let mut have_dictionary = false; |
| 505 | let mut need_state = true; |
| 506 | let mut model: Option<Model> = None; |
| 507 | loop { |
| 508 | check.check()?; |
| 509 | let control = byte(&mut reader)?; |
| 510 | crate::resources::completed(Ok(()), check)?; |
| 511 | if control == 0 { |
| 512 | let mut extra = [0]; |
| 513 | if reader.read(&mut extra).map_err(crate::space::io_error)? != 0 || out.len() != size { |
| 514 | return Err(ErrorCode::Integrity); |
| 515 | } |
| 516 | return out.flush(); |
| 517 | } |
| 518 | if control == 1 || control >= 0xe0 { |
| 519 | history = out.len(); |
| 520 | have_dictionary = true; |
| 521 | model = None; |
| 522 | } |
| 523 | if !have_dictionary { |
| 524 | return Err(ErrorCode::Integrity); |
| 525 | } |
| 526 | let unpacked = word(&mut reader)?; |
| 527 | if control <= 2 { |
| 528 | let target = out |
| 529 | .len() |
| 530 | .checked_add(unpacked as u64) |
| 531 | .filter(|n| *n <= size) |
| 532 | .ok_or(ErrorCode::Integrity)?; |
| 533 | let mut buffer = zeroize::Zeroizing::new([0; 65536]); |
| 534 | reader |
| 535 | .read_exact(&mut buffer[..unpacked]) |
| 536 | .map_err(|_| ErrorCode::Integrity)?; |
| 537 | out.extend(&buffer[..unpacked])?; |
| 538 | debug_assert_eq!(out.len(), target); |
| 539 | need_state = true; |
| 540 | } else if control >= 0x80 { |
| 541 | let unpacked = unpacked + ((control as usize & 31) << 16); |
| 542 | let packed = word(&mut reader)? as u64; |
| 543 | if control >= 0xc0 { |
| 544 | model = Some(Model::new(byte(&mut reader)?)?); |
| 545 | } |
| 546 | let model = model.as_mut().ok_or(ErrorCode::Integrity)?; |
| 547 | if control >= 0xa0 { |
| 548 | model.reset()?; |
| 549 | } else if need_state { |
| 550 | return Err(ErrorCode::Integrity); |
| 551 | } |
| 552 | let target = out |
| 553 | .len() |
| 554 | .checked_add(unpacked as u64) |
| 555 | .filter(|n| *n <= size) |
| 556 | .ok_or(ErrorCode::Integrity)?; |
| 557 | model.decode( |
| 558 | &mut (&mut reader).take(packed), |
| 559 | packed, |
| 560 | &mut out, |
| 561 | history, |
| 562 | dict, |
| 563 | target, |
| 564 | false, |
| 565 | check, |
| 566 | )?; |
| 567 | need_state = false; |
| 568 | } else { |
| 569 | return Err(ErrorCode::Integrity); |
| 570 | } |
| 571 | } |
| 572 | } |
| 573 | |
| 574 | #[cfg(test)] |
| 575 | #[path = "../../../tests/rust-archive-worker/lzma_streaming.rs"] |
| 576 | mod tests; |