Struct jacopone::Jacopone

source ·
pub struct Jacopone { /* private fields */ }
Expand description

enviroment for encryption and decryption

Implementations§

create a jacopone enviroment to encrypt/decrypt using thread_count threads

use jacopone::*;
let jacopone = Jacopone::new(4);

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§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.