Struct Jacopone

Source
pub struct Jacopone { /* private fields */ }
Expand description

enviroment for encryption and decryption

Implementations§

Source§

impl Jacopone

Source

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);
Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Erased for T