mirror of
https://git.um-react.app/um/lib_um_crypto_rust.git
synced 2026-03-08 04:29:54 +00:00
[kgm] feat #2: basic kgm support
This commit is contained in:
21
um_crypto/kgm/src/lib.rs
Normal file
21
um_crypto/kgm/src/lib.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
pub mod header;
|
||||
pub mod v2;
|
||||
mod v3;
|
||||
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum KugouError {
|
||||
#[error("Header too small, need at least {0} bytes.")]
|
||||
HeaderTooSmall(usize),
|
||||
|
||||
#[error("Unsupported key slot: {0}")]
|
||||
UnsupportedKeySlot(u32),
|
||||
|
||||
#[error("Unsupported cipher version: {0}")]
|
||||
UnsupportedCipherVersion(u32),
|
||||
}
|
||||
|
||||
pub trait Decipher {
|
||||
fn decrypt(&self, buffer: &mut [u8], offset: usize);
|
||||
}
|
||||
Reference in New Issue
Block a user