updates
This commit is contained in:
parent
fc94f655b2
commit
1b802ff33f
15 changed files with 379 additions and 74 deletions
|
|
@ -1,11 +1,12 @@
|
|||
use cfg_if::cfg_if;
|
||||
use rnex_core::prudp::types_flags::TypesFlags;
|
||||
|
||||
mod common_crypto;
|
||||
|
||||
pub trait CryptoInstance: Send + 'static {
|
||||
fn decrypt_incoming(&mut self, data: &mut [u8]);
|
||||
fn encrypt_outgoing(&mut self, data: &mut [u8]);
|
||||
fn generate_signature(&self, data: &[u8]) -> [u8; 4];
|
||||
fn generate_signature(&self, types_flags: TypesFlags, data: &[u8]) -> [u8; 4];
|
||||
fn get_user_id(&self) -> u32;
|
||||
}
|
||||
|
||||
|
|
@ -13,7 +14,12 @@ pub trait Crypto: Send + Sync + 'static {
|
|||
type Instance: CryptoInstance;
|
||||
fn new() -> Self;
|
||||
fn calculate_checksum(&self, data: &[u8]) -> u8;
|
||||
fn instantiate(&self, data: &[u8]) -> Self::Instance;
|
||||
fn instantiate(
|
||||
&self,
|
||||
data: &[u8],
|
||||
self_signat: [u8; 4],
|
||||
remote_signat: [u8; 4],
|
||||
) -> Self::Instance;
|
||||
}
|
||||
|
||||
cfg_if! {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue