pub struct Jacopone { /* private fields */ }Expand description
enviroment for encryption and decryption
Implementations§
Source§impl Jacopone
impl Jacopone
Sourcepub fn new(thread_count: u8) -> Jacopone
pub fn new(thread_count: u8) -> Jacopone
create a jacopone enviroment to encrypt/decrypt using thread_count threads
use jacopone::*;
let jacopone = Jacopone::new(4);Sourcepub fn encrypt(&self, data: CipherData) -> Vec<u8> ⓘ
pub fn encrypt(&self, data: CipherData) -> Vec<u8> ⓘ
encrypt given CipherData
use jacopone::*;
let jacopone = Jacopone::new(4);
let message = "i'm not a safe algorithm".as_bytes().to_vec();
//I'm sorry, it has to be 60 bytes long
let nonce = vec![1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,
0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0];
let key = vec![12,45,8,43,1,2,65,9,1,4,7,9,1,9,3,5,2,4,9,4,1,2,6,9,1,3,6,9,1,9,4,6];
let counter = 42;
let data = CipherData::new(message, key, nonce, counter);
let ciphertext = jacopone.encrypt(data);Auto Trait Implementations§
impl Freeze for Jacopone
impl RefUnwindSafe for Jacopone
impl Send for Jacopone
impl !Sync for Jacopone
impl Unpin for Jacopone
impl UnsafeUnpin for Jacopone
impl UnwindSafe for Jacopone
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