pub struct HxCrypt {
base: CxEncryption,
key1: IndexKey,
key2: IndexKeys,
filter_key: AtomicU64,
file_mapping: Arc<HashMap<FileHash, String>>,
path_mapping: Arc<HashMap<PathHash, String>>,
info_map: Mutex<HashMap<String, HxEntry>>,
file_hash: FileHashOption,
path_hash: PathHashOption,
dump_file_hash: Option<String>,
filename: String,
}Available on crate features
kirikiri and kirikiri-arc only.Fields§
§base: CxEncryption§key1: IndexKey§key2: IndexKeys§filter_key: AtomicU64§file_mapping: Arc<HashMap<FileHash, String>>§path_mapping: Arc<HashMap<PathHash, String>>§info_map: Mutex<HashMap<String, HxEntry>>§file_hash: FileHashOption§path_hash: PathHashOption§dump_file_hash: Option<String>§filename: StringImplementations§
Source§impl HxCrypt
impl HxCrypt
pub fn new( base: BaseSchema, cx: &CxSchema, index_key1: &IndexKey, index_key2: &IndexKeys, filter_key: u64, random_type: i32, file_list_name: Option<&str>, file_list_path: Option<&str>, filename: &str, config: &ExtraConfig, ) -> Result<Self>
fn new_inner( base: BaseSchema, cx: &CxSchema, index_key1: IndexKey, index_key2: IndexKeys, filter_key: u64, random_type: i32, config: &ExtraConfig, file_mapping: Arc<HashMap<FileHash, String>>, path_mapping: Arc<HashMap<PathHash, String>>, control_block: Vec<u32>, filename: &str, ) -> Result<Self>
fn try_default_name<P: AsRef<Path>>( s: &P, b: &str, ) -> Result<Option<(HashMap<FileHash, String>, HashMap<PathHash, String>)>>
fn read_names( s: &str, basename: &str, ) -> Result<(HashMap<FileHash, String>, HashMap<PathHash, String>)>
fn create_chacha20_crypt( &self, flags: u16, key_index: usize, ) -> Result<ChaCha20Legacy>
fn read_index_stream_internel<T: Read + Seek>( &self, stream: &mut T, flags: u16, key_index: usize, ) -> Result<MemReader>
fn read_index_stream<T: Read + Seek>( &self, stream: T, flags: u16, ) -> Result<MemReader>
fn read_manifest(mainfest_dir: &str) -> Result<CxdecDb>
fn read_index<T: Read + Seek>(&self, stream: T, flags: u16) -> Result<()>
fn get_unicode_name(hash: u32) -> String
fn create_filter_key( &self, entry_key: u64, header_key_seed: u64, ) -> Result<HxFilterKey>
Trait Implementations§
Source§impl AsRef<CxEncryption> for HxCrypt
impl AsRef<CxEncryption> for HxCrypt
Source§fn as_ref(&self) -> &CxEncryption
fn as_ref(&self) -> &CxEncryption
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Crypt for HxCrypt
impl Crypt for HxCrypt
Source§fn hash_after_crypt(&self) -> bool
fn hash_after_crypt(&self) -> bool
whether Adler32 checksum should be calculated after contents have been encrypted.
Source§fn 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.
Source§fn obfuscated_index(&self) -> bool
fn obfuscated_index(&self) -> bool
whether XP3 index is obfuscated: Read more
Source§fn init(&self, archive: &mut Xp3Archive<'_>) -> Result<()>
fn init(&self, archive: &mut Xp3Archive<'_>) -> Result<()>
Initializes the cryptographic context for the archive.
Source§fn decrypt_supported(&self) -> bool
fn decrypt_supported(&self) -> bool
Returns true if this crypt support decrypt
Source§fn decrypt_seek_supported(&self) -> bool
fn decrypt_seek_supported(&self) -> bool
Returns true if this crypt support seek when decrypting
Source§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<'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.
Source§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_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.
Source§fn 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
Source§fn 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)
Source§fn filter_seek_supported(&self) -> bool
fn filter_seek_supported(&self) -> bool
Returns true if this crypt support seek when filtering
Auto Trait Implementations§
impl !Freeze for HxCrypt
impl !RefUnwindSafe for HxCrypt
impl Send for HxCrypt
impl Sync for HxCrypt
impl Unpin for HxCrypt
impl !UnwindSafe for HxCrypt
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more