pub trait Crypt: Debug {
Show 13 methods
// Required methods
fn hash_after_crypt(&self) -> bool;
fn startup_tjs_not_encrypted(&self) -> bool;
fn obfuscated_index(&self) -> bool;
// Provided methods
fn init(&self, archive: &mut Xp3Archive<'_>) -> Result<()> { ... }
fn read_name<'a>(
&self,
reader: &mut Box<dyn Read + 'a>,
) -> Result<(String, u64)> { ... }
fn decrypt<'a>(
&self,
_entry: &Xp3Entry,
_cur_seg: &Segment,
_stream: Box<dyn Read + Send + Sync + 'a>,
) -> Result<Box<dyn ReadDebug + Send + Sync + 'a>> { ... }
fn decrypt_with_seek<'a>(
&self,
_entry: &Xp3Entry,
_cur_seg: &Segment,
_stream: Box<dyn ReadSeek + Send + Sync + 'a>,
) -> Result<Box<dyn ReadSeek + Send + Sync + 'a>> { ... }
fn decrypt_supported(&self) -> bool { ... }
fn decrypt_seek_supported(&self) -> bool { ... }
fn need_filter(&self, _filename: &str, _buf: &[u8], _buf_len: usize) -> bool { ... }
fn filter_seek_supported(&self) -> bool { ... }
fn filter<'a>(
&self,
_entry: Entry<'a>,
) -> Result<Box<dyn ReadDebug + Send + Sync + 'a>> { ... }
fn filter_with_seek<'a>(
&self,
_entry: Entry<'a>,
) -> Result<Box<dyn ReadSeek + Send + Sync + 'a>> { ... }
}Available on crate features
kirikiri and kirikiri-arc only.Required Methods§
Sourcefn hash_after_crypt(&self) -> bool
fn hash_after_crypt(&self) -> bool
whether Adler32 checksum should be calculated after contents have been encrypted.
Sourcefn startup_tjs_not_encrypted(&self) -> bool
fn startup_tjs_not_encrypted(&self) -> bool
whether the startup.tjs script is not encrypted even when the archive is encrypted.
Sourcefn obfuscated_index(&self) -> bool
fn obfuscated_index(&self) -> bool
whether XP3 index is obfuscated:
- duplicate entries
- entries have additional dummy segments
Provided Methods§
Sourcefn init(&self, archive: &mut Xp3Archive<'_>) -> Result<()>
fn init(&self, archive: &mut Xp3Archive<'_>) -> Result<()>
Initializes the cryptographic context for the archive.
Sourcefn read_name<'a>(
&self,
reader: &mut Box<dyn Read + 'a>,
) -> Result<(String, u64)>
fn read_name<'a>( &self, reader: &mut Box<dyn Read + 'a>, ) -> Result<(String, u64)>
Read a entry name from archive index
Sourcefn decrypt<'a>(
&self,
_entry: &Xp3Entry,
_cur_seg: &Segment,
_stream: Box<dyn Read + Send + Sync + 'a>,
) -> Result<Box<dyn ReadDebug + Send + Sync + 'a>>
fn decrypt<'a>( &self, _entry: &Xp3Entry, _cur_seg: &Segment, _stream: Box<dyn Read + Send + Sync + 'a>, ) -> Result<Box<dyn ReadDebug + Send + Sync + 'a>>
Decrypts the given stream of data for the specified entry and segment.
Sourcefn decrypt_with_seek<'a>(
&self,
_entry: &Xp3Entry,
_cur_seg: &Segment,
_stream: Box<dyn ReadSeek + Send + Sync + 'a>,
) -> Result<Box<dyn ReadSeek + Send + Sync + 'a>>
fn decrypt_with_seek<'a>( &self, _entry: &Xp3Entry, _cur_seg: &Segment, _stream: Box<dyn ReadSeek + Send + Sync + 'a>, ) -> Result<Box<dyn ReadSeek + Send + Sync + 'a>>
Decrypts the given stream of data for the specified entry and segment, with seek support.
Sourcefn decrypt_supported(&self) -> bool
fn decrypt_supported(&self) -> bool
Returns true if this crypt support decrypt
Sourcefn decrypt_seek_supported(&self) -> bool
fn decrypt_seek_supported(&self) -> bool
Returns true if this crypt support seek when decrypting
Sourcefn need_filter(&self, _filename: &str, _buf: &[u8], _buf_len: usize) -> bool
fn need_filter(&self, _filename: &str, _buf: &[u8], _buf_len: usize) -> bool
Determine whether the file with the given name and content need to be extra processed after decryption. (e.g. extra decryption by file type)
Sourcefn filter_seek_supported(&self) -> bool
fn filter_seek_supported(&self) -> bool
Returns true if this crypt support seek when filtering