From f9b2567d8eab507d1392d8ab00249160cace2d77 Mon Sep 17 00:00:00 2001 From: Jake Probst Date: Sun, 23 Jun 2019 15:52:09 -0700 Subject: [PATCH] null pso cipher --- src/crypto/mod.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/crypto/mod.rs b/src/crypto/mod.rs index 9267e49..82e0ea1 100644 --- a/src/crypto/mod.rs +++ b/src/crypto/mod.rs @@ -1,4 +1,4 @@ -mod pc; +pub mod pc; #[derive(Debug)] @@ -8,7 +8,22 @@ pub enum CipherError { -trait PSOCipher { +pub trait PSOCipher { fn encrypt(&mut self, data: &Vec) -> Result, CipherError>; fn decrypt(&mut self, data: &Vec) -> Result, CipherError>; } + + + +pub struct NullCipher { +} + +impl PSOCipher for NullCipher { + fn encrypt(&mut self, data: &Vec) -> Result, CipherError> { + Ok(data.clone()) + } + + fn decrypt(&mut self, data: &Vec) -> Result, CipherError> { + Ok(data.clone()) + } +}