Browse Source

null pso cipher

pull/3/head
Jake Probst 6 years ago
parent
commit
f9b2567d8e
  1. 19
      src/crypto/mod.rs

19
src/crypto/mod.rs

@ -1,4 +1,4 @@
mod pc;
pub mod pc;
#[derive(Debug)] #[derive(Debug)]
@ -8,7 +8,22 @@ pub enum CipherError {
trait PSOCipher {
pub trait PSOCipher {
fn encrypt(&mut self, data: &Vec<u8>) -> Result<Vec<u8>, CipherError>; fn encrypt(&mut self, data: &Vec<u8>) -> Result<Vec<u8>, CipherError>;
fn decrypt(&mut self, data: &Vec<u8>) -> Result<Vec<u8>, CipherError>; fn decrypt(&mut self, data: &Vec<u8>) -> Result<Vec<u8>, CipherError>;
} }
pub struct NullCipher {
}
impl PSOCipher for NullCipher {
fn encrypt(&mut self, data: &Vec<u8>) -> Result<Vec<u8>, CipherError> {
Ok(data.clone())
}
fn decrypt(&mut self, data: &Vec<u8>) -> Result<Vec<u8>, CipherError> {
Ok(data.clone())
}
}
Loading…
Cancel
Save