Skip to main content

BigCryptor128

Struct BigCryptor128 

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

A BigCryptor128 wrapper struct for cascading encryption/decryption algorithms that has 128-bit block size

§Introduction

BigCryptor128 is mainly used to make cascade encryption/decryption that has 128-bit block size.

§Quick Start

You have to import (use) the module BigCryptor128 in order to cascade encryption/decryption algorithms that has 128-bit block size such as AES-128 cascade as shown in Example 1.

§Example 1

use cryptocol::symmetric::BigCryptor128;

You can instantiate the BigCryptor128 object with components (hereinafter, referred to as small cryptor) that has u128 keys as Example 2, for example. In this case, you have to take endianness into account. In little-endianness, 0x_1234567890ABCDEFFEDCBA0987654321_u128 is [0x21u8, 0x43, 0x65, 0x87, 0x09, 0xBA, 0xDC, 0xFE, 0xEF, 0xCD, 0xAB, 0x90, 0x78, 0x56, 0x34, 0x12] while the same 0x_1234567890ABCDEFFEDCBA0987654321_u128 is [0x12u8, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21] in big-endianness. The instantiated object should be mutable.

§Example 2

use cryptocol::symmetric::{ BigCryptor128, AES_128 };
let mut _taes = BigCryptor128::new()
                + AES_128::encryptor_with_key_u128(0x_1234567890ABCDEFFEDCBA0987654321_u128)
                + AES_128::decryptor_with_key_u128(0x_FEDCBA09876543211234567890ABCDEF_u128)
                + AES_128::encryptor_with_key_u128(0x_1234567890ABCDEFFEDCBA0987654321_u128);
 

Also, you can instantiate the BigCryptor128 object with small cryptors (component) that have [u8; 16] keys as shown in Example 3. In this case, you don’t have to take endianness into account. The instantiated object should be mutable.

§Example 3

use cryptocol::symmetric::{ BigCryptor128, AES_128 };
let mut _taes = BigCryptor128::new()
                + AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21])
                - AES_128::new_with_key(&[0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF])
                + AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21]);

You can instantiate the BigCryptor128 object without small cryptors (components) that have key and set a u128 key later as shown in Example 4 or [u8; 16] keys later as shown in Example 5.

§Example 4

use cryptocol::symmetric::{ BigCryptor128, AES_128 };
let mut taes = BigCryptor128::new();
let aes1 = AES_128::encryptor_with_key_u128(0x_1234567890ABCDEFFEDCBA0987654321_u128);
let aes2 = AES_128::decryptor_with_key_u128(0x_FEDCBA09876543211234567890ABCDEF_u128);
let aes3 = AES_128::encryptor_with_key_u128(0x_1234567890ABCDEFFEDCBA0987654321_u128);
taes.push_small_cryptor(aes1);
taes.push_small_cryptor(aes2);
taes.push_small_cryptor(aes3);

§Example 5

use cryptocol::symmetric::{ BigCryptor128, AES_128 };
let mut taes = BigCryptor128::new();
let aes1 = AES_128::encryptor_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21]);
let aes2 = AES_128::decryptor_with_key(&[0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF]);
let aes3 = AES_128::encryptor_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21]);
taes.push_small_cryptor(aes1);
taes.push_small_cryptor(aes2);
taes.push_small_cryptor(aes3);

Now, you can freely use any operation mode. This crate provide ECB (Electronic CodeBook), CBC(Cipher Block Chaining), PCBC (Propagation Cipher Block Chaining), CFB (Cipher FeedBack) OFB (Output FeedBack), and CTR (CounTeR). You can choose the way of padding bits according to either PKCS #7 or ISO 7816-4. So, you can import (use) one of the following traits: ECB_PKCS7, ECB_ISO, CBC_PKCS7, CBC_ISO, PCBC_PKCS7, PCBC_ISO, CFB, OFB, and CTR. The following example 6 shows the case that you choose CBC operation mode and padding bits according to PKCS #7.

§Example 6

use std::fmt::Write as _;
use cryptocol::symmetric::{ BigCryptor128, AES_128, CBC_PKCS7 };
let mut taes = BigCryptor128::new()
                + AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21])
                - AES_128::new_with_key(&[0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF])
                + AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21]);
 
let iv = 0x_FEDCBA09876543211234567890ABCDEF_u128;
println!("IV =	{:#034X}", iv);
let message = "In the beginning God created the heavens and the earth.";
println!("M =\t{}", message);
let mut cipher = Vec::<u8>::new();
taes.encrypt_str_into_vec(iv, &message, &mut cipher);
print!("C =\t");
for c in cipher.clone()
    { print!("{:02X} ", c); }
println!();
let mut txt = String::new();
for c in cipher.clone()
    { write!(txt, "{:02X} ", c); }
assert_eq!(txt, "1E 24 26 AD 13 7F 6F 6A CD 22 3A 4F A5 24 D8 E0 E3 6A B2 39 0D 82 2B 6E 7B D6 95 09 6D EF C2 7B 30 53 87 B7 9C D3 21 7C C0 85 11 74 28 7B 98 7B 9F 02 54 81 23 96 6D F5 A1 39 C8 A2 4B 20 76 7A ");
/// let mut recovered = String::new();
taes.decrypt_into_string(iv, cipher.as_ptr(), cipher.len() as u64, &mut recovered);
println!("B =\t{}", recovered);
assert_eq!(recovered, "In the beginning God created the heavens and the earth.");
assert_eq!(recovered, message);

§Notice for Practical Use

Now, you can freely use any methods with any paddings in any operation modes.

  • This crate provides six operation modes: ECB, CBC, PCBC, CFB, OFB, and CTR.
  • This crate provides two padding ways: ISO 7816-4 and PKCS #7.
  • The operation modes ECB, CBC and PCBC requires padding bytes.
  • You can combine three operation modes and two padding ways.
  • The operation modes CFB, OFB, and CTR does not require padding bytes.
  • The traits that implements combination of operation modes and padding ways are provided such as ECB_PKCS7, ECB_ISO, CBC_PKCS7, CBC_ISO, PCBC_PKCS7, and PCBC_ISO.
  • You can find detaild instructions and their helpful examples if you go through those links.

In summary,

padding PKCS7padding ISOno padding
ECBECB_PKCS7ECB_ISO
CBCCBC_PKCS7CBC_ISO
PCBCPCBC_PKCS7PCBC_ISO
CFBCFB
OFBOFB
CTRCTR

Implementations§

Source§

impl BigCryptor128

Source

pub fn new() -> Self

Constructs a new object BigCryptor128.

§Output

A new object BigCryptor128 that has no small cryptors by default.

§Features
  • In order to encrypt data, object should be instantiated mutable.
  • This method does not set any small cryptor (component) by default.
  • You have to set as many small cryptors (components) as you want.
  • The small cryptors (components) should have the block size 128-bit.
§Example 1
use cryptocol::symmetric::{ BigCryptor128, AES_128 };
 
let mut taes = BigCryptor128::new();
taes.push_small_cryptor(AES_128::encryptor_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21]));
taes.push_small_cryptor(AES_128::decryptor_with_key(&[0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF]));
taes.push_small_cryptor(AES_128::encryptor_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21]));
§For more examples,

click here

Source

pub fn new_with_small_cryptor_array<const N: usize>( smallcryptor: [Box<dyn SmallCryptor128>; N], ) -> Self

Constructs a new object BigCryptor128 with some small cryptors (components).

§Arguments

smallcryptor is the array of small cryptors (components) wrapped by Box.

§Output

A new object BigCryptor128 that has small cryptors given as arguments.

§Features

This method sets the small cryptor to be the given argument smallcryptor.

§Example 1 for normal case
use cryptocol::symmetric::{ BigCryptor128, SmallCryptor, AES_128 };
 
let cryptors: [Box<dyn SmallCryptor128>; 3] = [ Box::new(AES_128::encryptor_with_key_u128(0x_1234567890ABCDEFFEDCBA0987654321_u128)),
                                        Box::new(AES_128::decryptor_with_key_u128(0x_FEDCBA09876543211234567890ABCDEF_u128)),
                                        Box::new(AES_128::encryptor_with_key_u128(0x_1234567890ABCDEFFEDCBA0987654321_u128)) ];
let mut _taes = BigCryptor128::new_with_small_cryptor_array(cryptors);
§For more examples,

click here

Source

pub fn new_with_small_cryptor_vec( smallcryptor: Vec<Box<dyn SmallCryptor128>>, ) -> Self

Constructs a new object BigCryptor128 with some small cryptors (components).

§Arguments
  • smallcryptor is the Vec object of small cryptors (components) wrapped by Box.
§Output

A new object BigCryptor128 that has small cryptors given as arguments.

§Features

This method sets the key to be the given argument key.

§Example 1 for normal case
use cryptocol::symmetric::{ BigCryptor128, SmallCryptor, AES_128 };
let cryptors: Vec<Box<dyn SmallCryptor128>> = vec![ Box::new(AES_128::encryptor_with_key_u128(0x_1234567890ABCDEFFEDCBA0987654321_u128)),
                                        Box::new(AES_128::decryptor_with_key_u128(0x_FEDCBA09876543211234567890ABCDEF_u128)),
                                        Box::new(AES_128::encryptor_with_key_u128(0x_1234567890ABCDEFFEDCBA0987654321_u128)) ];
let mut _taes = BigCryptor128::new_with_small_cryptor_vec(cryptors);
§For more examples,

click here

Source

pub fn push_small_cryptor<S: SmallCryptor128 + 'static>( &mut self, smallcryptor: S, )

Adds a small cryptor (component) to Self’s own small cryptor container.

§Arguments

smallcryptor is a small cryptors (components).

§Features

This method automatically wraps the small cryptor by Box.

§Example 1 for normal case
use cryptocol::symmetric::{ BigCryptor128, AES_128 };
let mut taes = BigCryptor128::new();
let aes1 = AES_128::encryptor_with_key_u128(0x_1234567890ABCDEFFEDCBA0987654321_u128);
let aes2 = AES_128::decryptor_with_key_u128(0x_FEDCBA09876543211234567890ABCDEF_u128);
let aes3 = AES_128::encryptor_with_key_u128(0x_1234567890ABCDEFFEDCBA0987654321_u128);
taes.push_small_cryptor(aes1);
taes.push_small_cryptor(aes2);
taes.push_small_cryptor(aes3);
§For more examples,

click here

Source

pub fn push_small_cryptor_array<const N: usize>( &mut self, smallcryptor: [Box<dyn SmallCryptor128>; N], )

Adds small cryptors (components) to Self’s own small cryptor container.

§Arguments

smallcryptors is an array of small cryptors (components).

§Features

Each element of the array the small cryptors should be wrapped by Box.

§Example 1 for normal case
use cryptocol::symmetric::{ BigCryptor128, SmallCryptor, AES_128 };
let mut taes = BigCryptor128::new();
let cryptors: [Box<dyn SmallCryptor128>; 3] = [ Box::new(AES_128::encryptor_with_key_u128(0x_1234567890ABCDEFFEDCBA0987654321_u128)),
                                        Box::new(AES_128::decryptor_with_key_u128(0x_FEDCBA09876543211234567890ABCDEF_u128)),
                                        Box::new(AES_128::encryptor_with_key_u128(0x_1234567890ABCDEFFEDCBA0987654321_u128)) ];
taes.push_small_cryptor_array(cryptors);
§For more examples,

click here

Source

pub fn push_small_cryptor_vec( &mut self, smallcryptor: Vec<Box<dyn SmallCryptor128>>, )

Adds small cryptors (components) to Self’s own small cryptor container.

§Arguments

smallcryptors is a Vec object of small cryptors (components).

§Features

Each element of the Vec object of the small cryptors should be wrapped by Box.

§Example 1 for normal case
use cryptocol::symmetric::{ BigCryptor128, SmallCryptor, AES_128 };
let mut taes = BigCryptor128::new();
let cryptors: Vec<Box<dyn SmallCryptor128>> = vec![ Box::new(AES_128::encryptor_with_key_u128(0x_1234567890ABCDEFFEDCBA0987654321_u128)),
                                        Box::new(AES_128::decryptor_with_key_u128(0x_FEDCBA09876543211234567890ABCDEF_u128)),
                                        Box::new(AES_128::encryptor_with_key_u128(0x_1234567890ABCDEFFEDCBA0987654321_u128)) ];
taes.push_small_cryptor_vec(cryptors);
§For more examples,

click here

Source

pub fn turn_inverse(&mut self)

Flips its role in BigCryptor128.

§Features
  • If it is constructed as encryptor for embracing BigCryptor128, it will be changed into decryptor.
  • If it is constructed as decryptor for embracing BigCryptor128, it will be changed into encryptor.
§Example 1
use cryptocol::symmetric::{ BigCryptor128, AES_128, AES_192, SmallCryptor };
let mut taes = AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21])
                - AES_128::new_with_key(&[0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF])
                + AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21]);
 
let aes = AES_128::new_with_key(&[0xEF, 0xCD, 0xAB, 0x90, 0x78, 0x56, 0x34, 0x12, 0x21, 0x43, 0x65, 0x87, 0x09, 0xBA, 0xDC, 0xFE]);
let rijndael = AES_192::new_with_key(&[0x21, 0x43, 0x65, 0x87, 0x09, 0xBA, 0xDC, 0xFE, 0xEF, 0xCD, 0xAB, 0x90, 0x78, 0x56, 0x34, 0x12, 0x21, 0x43, 0x65, 0x87, 0x09, 0xBA, 0xDC, 0xFE]);
taes.turn_inverse();
let mut bigcryptor = aes + rijndael + taes;
 
let plaintext = 0x_1234567890ABCDEFFEDCBA0987654321_u128;
println!("Plaintext:\t\t{:#034X}", plaintext);
let ciphertext = bigcryptor.encrypt_u128(plaintext);
println!("Ciphertext:\t\t{:#034X}", ciphertext);
assert_eq!(ciphertext, 0x_B881F06147B26243D0742CAA82602E97_u128);
 
let recovered_text = bigcryptor.decrypt_u128(ciphertext);
println!("Recovered text:\t{:#034X}", recovered_text);
assert_eq!(recovered_text, 0x_1234567890ABCDEFFEDCBA0987654321_u128);
assert_eq!(recovered_text, plaintext);
§For more examples,

click here

Source

pub fn turn_encryptor(&mut self)

Changes its role in BigCryptor128 to encryptor.

§Features
  • If it is constructed as encryptor for embracing BigCryptor128, it will not be changed at all.
  • If it is constructed as decryptor for embracing BigCryptor128, it will be changed into encryptor.
§Example 1
use cryptocol::symmetric::{ BigCryptor128, AES_128, AES_192, SmallCryptor };
let mut taes = AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21])
                - AES_128::new_with_key(&[0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF])
                + AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21]);
 
let aes = AES_128::new_with_key(&[0xEF, 0xCD, 0xAB, 0x90, 0x78, 0x56, 0x34, 0x12, 0x21, 0x43, 0x65, 0x87, 0x09, 0xBA, 0xDC, 0xFE]);
let rijndael = AES_192::new_with_key(&[0x21, 0x43, 0x65, 0x87, 0x09, 0xBA, 0xDC, 0xFE, 0xEF, 0xCD, 0xAB, 0x90, 0x78, 0x56, 0x34, 0x12, 0x21, 0x43, 0x65, 0x87, 0x09, 0xBA, 0xDC, 0xFE]);
taes.turn_encryptor();
let mut bigcryptor = aes + rijndael + taes;
 
let plaintext = 0x_1234567890ABCDEFFEDCBA0987654321_u128;
println!("Plaintext:\t\t{:#034X}", plaintext);
let ciphertext = bigcryptor.encrypt_u128(plaintext);
println!("Ciphertext:\t\t{:#034X}", ciphertext);
assert_eq!(ciphertext, 0x_1E561632CF3EDD44E8955A26ABA0AF7E_u128);
 
let recovered_text = bigcryptor.decrypt_u128(ciphertext);
println!("Recovered text:\t{:#034X}", recovered_text);
assert_eq!(recovered_text, 0x_1234567890ABCDEFFEDCBA0987654321_u128);
assert_eq!(recovered_text, plaintext);
§For more examples,

click here

Source

pub fn turn_decryptor(&mut self)

Changes its role in BigCryptor128 to encryptor.

§Features
  • If it is constructed as encryptor for embracing BigCryptor128, it will not be changed at all.
  • If it is constructed as decryptor for embracing BigCryptor128, it will be changed into encryptor.
§Example 1
use cryptocol::symmetric::{ BigCryptor128, AES_128, AES_192, SmallCryptor };
let mut taes = AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21])
                - AES_128::new_with_key(&[0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF])
                + AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21]);
 
let aes = AES_128::new_with_key(&[0xEF, 0xCD, 0xAB, 0x90, 0x78, 0x56, 0x34, 0x12, 0x21, 0x43, 0x65, 0x87, 0x09, 0xBA, 0xDC, 0xFE]);
let rijndael = AES_192::new_with_key(&[0x21, 0x43, 0x65, 0x87, 0x09, 0xBA, 0xDC, 0xFE, 0xEF, 0xCD, 0xAB, 0x90, 0x78, 0x56, 0x34, 0x12, 0x21, 0x43, 0x65, 0x87, 0x09, 0xBA, 0xDC, 0xFE]);
taes.turn_decryptor();
let mut bigcryptor = aes + rijndael + taes;
 
let plaintext = 0x_1234567890ABCDEFFEDCBA0987654321_u128;
println!("Plaintext:\t\t{:#034X}", plaintext);
let ciphertext = bigcryptor.encrypt_u128(plaintext);
println!("Ciphertext:\t\t{:#034X}", ciphertext);
assert_eq!(ciphertext, 0x_B881F06147B26243D0742CAA82602E97_u128);
 
let recovered_text = bigcryptor.decrypt_u128(ciphertext);
println!("Recovered text:\t{:#034X}", recovered_text);
assert_eq!(recovered_text, 0x_1234567890ABCDEFFEDCBA0987654321_u128);
assert_eq!(recovered_text, plaintext);
§For more examples,

click here

Source

pub fn encrypt_u128(&mut self, message: u128) -> u128

Encrypts a 128-bit data.

§Arguments

message is of u128-type and the plaintext to be encrypted.

§Output

This method returns the encrypted data of u128-type from message.

§Example 1 for Normal case
use cryptocol::symmetric::{ BigCryptor128, AES_128 };
 
let mut taes = BigCryptor128::new()
                            + AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21])
                            - AES_128::new_with_key(&[0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF])
                            + AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21]);
let message = 0x_1234567890ABCDEFFEDCBA0987654321_u128;
println!("M = {:#034X}", message);
let cipher = taes.encrypt_u128(message);
println!("C = {:#034X}", cipher);
assert_eq!(cipher, 0x_965C637ECAC29A9B0BE3F62C9593C04C_u128);
§For more examples,

click here

Source

pub fn decrypt_u128(&mut self, cipher: u128) -> u128

Decrypts a 128-bit data.

§Arguments

cioher is of u128-type and the ciphertext to be decrypted.

§Output

This method returns the decrypted data of u128-type from cipher.

§Example 1 for Normal case
use cryptocol::symmetric::{ BigCryptor128, AES_128 };
 
let mut taes = BigCryptor128::new()
                + AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21])
                - AES_128::new_with_key(&[0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF])
                + AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21]);
let message = 0x_1234567890ABCDEFFEDCBA0987654321_u128;
println!("M = {:#034X}", message);
let cipher = taes.encrypt_u128(message);
println!("C = {:#034X}", cipher);
assert_eq!(cipher, 0x_965C637ECAC29A9B0BE3F62C9593C04C_u128);
 
let recovered = taes.decrypt_u128(cipher);
println!("B = {:#034X}", recovered);
assert_eq!(recovered, 0x_1234567890ABCDEFFEDCBA0987654321_u128);
assert_eq!(recovered, message);
§For more examples,

click here

Source

pub fn encrypt_array_u128<const N: usize>( &mut self, message: &[u128; N], cipher: &mut [u128; N], )

Encrypts an array of 128-bit data.

§Arguments
  • message is of an array of u128-type and the plaintext to be encrypted.
  • cipher is of an array of u128-type and the ciphertext to be stored.
§Example 1 for Normal case
use cryptocol::symmetric::{ BigCryptor128, AES_128 };
 
let mut taes = BigCryptor128::new()
                            + AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21])
                            - AES_128::new_with_key(&[0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF])
                            + AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21]);
let message = [0x_1234567890ABCDEFFEDCBA0987654321_u128, 0x11223344556677889900AABBCCDDEEFF, 0xFFEEDDCCBBAA00998877665544332211_u128];
print!("M = ");
for msg in message.clone()
    { print!("{:#034X} ", msg); }
println!();
 
let mut cipher = [0_u128; 3];
taes.encrypt_array_u128(&message, &mut cipher);
print!("C = ");
for c in cipher.clone()
    { print!("{:#034X} ", c); }
println!();
assert_eq!(cipher[0], 0x_965C637ECAC29A9B0BE3F62C9593C04C_u128);
assert_eq!(cipher[1], 0x_A397AABE9537829FABA0596B5D3EA8B9_u128);
assert_eq!(cipher[2], 0x_85457798D08431CCB8A4A58517A5D452_u128);
§For more examples,

click here

Source

pub fn decrypt_array_u128<const N: usize>( &mut self, cipher: &[u128; N], message: &mut [u128; N], )

Decrypts an array of 128-bit data.

§Arguments
  • cipher is of an array of u128-type and the ciphertext to be decrypted.
  • message is of an array of u128-type and the plaintext to be stored.
§Example 1 for Normal case
use cryptocol::symmetric::{ BigCryptor128, AES_128 };
 
let mut taes = BigCryptor128::new()
                + AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21])
                - AES_128::new_with_key(&[0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF])
                + AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21]);
let message = [0x_1234567890ABCDEFFEDCBA0987654321_u128, 0x11223344556677889900AABBCCDDEEFF, 0xFFEEDDCCBBAA00998877665544332211];
print!("M = ");
for msg in message.clone()
    { print!("{:#034X} ", msg); }
println!();
 
let mut cipher = [0_u128; 3];
taes.encrypt_array_u128(&message, &mut cipher);
print!("C = ");
for c in cipher.clone()
    { print!("{:#034X} ", c); }
println!();
assert_eq!(cipher[0], 0x_965C637ECAC29A9B0BE3F62C9593C04C_u128);
assert_eq!(cipher[1], 0x_A397AABE9537829FABA0596B5D3EA8B9_u128);
assert_eq!(cipher[2], 0x_85457798D08431CCB8A4A58517A5D452_u128);
 
let mut recovered = [0_u128; 3];
taes.decrypt_array_u128(&cipher, &mut recovered);
print!("B = ");
for r in recovered.clone()
    { print!("{:#034X} ", r); }
println!();
assert_eq!(recovered[0], 0x_1234567890ABCDEFFEDCBA0987654321_u128);
assert_eq!(recovered[1], 0x_11223344556677889900AABBCCDDEEFF_u128);
assert_eq!(recovered[2], 0x_FFEEDDCCBBAA00998877665544332211_u128);
assert_eq!(recovered[0], message[0]);
assert_eq!(recovered[1], message[1]);
assert_eq!(recovered[2], message[2]);
§For more examples,

click here

Source

pub fn is_successful(&self) -> bool

Checks whether the previous encryption or decryption was successful.

§Output

If the previous encryption or decryption was successful, this method returns true. Otherwise, it returns false.

§Features
  • Usually, you don’t have to use this method because the encryption methods returns the length of ciphertext and the decryption methods returns the length of plaintext but they returns 0 when they failed.
  • If the ciphertext is 16 bytes for decryption with the padding either pkcs7 or iso, the return value 0 of the decryption methods is not discriminatory. You don’t know whether the previous decryption was failed or the original plaintext was just null string or “”. In this case you can check its success with this method.
§Example 1 for Normal case for Successful case for encryption
use std::io::Write;
use std::fmt::Write as _;
use cryptocol::symmetric::{ BigCryptor128, AES_128, CBC_PKCS7 };
 
let iv = 0x_FEDCBA09876543211234567890ABCDEF_u128;
println!("IV =	{}", iv);
let mut taes = BigCryptor128::new()
                + AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21])
                - AES_128::new_with_key(&[0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF])
                + AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21]);
 
let message = "";
println!("M =\t{}", message);
let mut cipher = [0_u8; 16];
let len = taes.encrypt_str_into_array(iv, &message, &mut cipher);
println!("The length of ciphertext = {}", len);
assert_eq!(len, 16);
let success = taes.is_successful();
assert_eq!(success, true);
print!("C =\t");
for c in cipher.clone()
    { print!("{:02X} ", c); }
println!();
let mut txt = String::new();
for c in cipher.clone()
    { write!(txt, "{:02X} ", c); }
assert_eq!(txt, "D9 F7 43 4F 83 5D 3E 70 1F CD A1 4A 49 C1 78 83 ");
§For more examples,

click here

Source

pub fn is_failed(&self) -> bool

Checks whether the previous encryption or decryption was failed.

§Output

If the previous encryption or decryption was failed, this method returns true. Otherwise, it returns false.

§Features
  • Usually, you don’t have to use this method because the encryption methods returns the length of ciphertext and the decryption methods returns the length of plaintext but they returns 0 when they failed.
  • If the ciphertext is 8 bytes for decryption with the padding either pkcs7 or iso, the return value 0 of the decryption methods is not discriminatory. You don’t know whether the previous decryption was failed or the original plaintext was just null string or “”. In this case you can check its success with this method.
§Example 1 for Successful case for encryption
use std::io::Write;
use std::fmt::Write as _;
use cryptocol::symmetric::{ BigCryptor128, AES_128, CBC_PKCS7 };
 
let iv = 0x_FEDCBA09876543211234567890ABCDEF_u128;
println!("IV =	{}", iv);
let mut taes = BigCryptor128::new()
                + AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21])
                - AES_128::new_with_key(&[0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF])
                + AES_128::new_with_key(&[0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0xFE, 0xDC, 0xBA, 0x09, 0x87, 0x65, 0x43, 0x21]);
 
let message = "";
println!("M =\t{}", message);
let mut cipher = [0_u8; 16];
let len = taes.encrypt_str_into_array(iv, &message, &mut cipher);
println!("The length of ciphertext = {}", len);
assert_eq!(len, 16);
let failure = taes.is_failed();
assert_eq!(failure, false);
print!("C =\t");
for c in cipher.clone()
    { print!("{:02X} ", c); }
println!();
let mut txt = String::new();
for c in cipher.clone()
    { write!(txt, "{:02X} ", c); }
assert_eq!(txt, "D9 F7 43 4F 83 5D 3E 70 1F CD A1 4A 49 C1 78 83 ");
§For more examples,

click here

Trait Implementations§

Source§

impl<S> Add<S> for BigCryptor128
where S: SmallCryptor128 + 'static,

Source§

type Output = BigCryptor128

The resulting type after applying the + operator.
Source§

fn add(self, rhs: S) -> Self::Output

Performs the + operation. Read more
Source§

impl CBC_ISO<u128> for BigCryptor128

Source§

fn encrypt( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: *mut u8, ) -> u64

Encrypts the data with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode. Read more
Source§

fn decrypt( &mut self, iv: u128, cipher: *const u8, length_in_bytes: u64, message: *mut u8, ) -> u64

Decrypts the data with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_into_array<U, const N: usize>( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_into_vec<U>( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn decrypt_into_array<U, const N: usize>( &mut self, iv: u128, cipher: *const u8, length_in_bytes: u64, message: &mut [U; N], ) -> u64
where U: SmallUInt,

Decrypts the data with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode, and stores the decrypted data in array [U; N]. Read more
Source§

fn encrypt_str(&mut self, iv: T, message: &str, cipher: *mut u8) -> u64

Encrypts the data in a str object with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_str_into_vec<U>( &mut self, iv: T, message: &str, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data in str with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn encrypt_str_into_array<U, const N: usize>( &mut self, iv: T, message: &str, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data in a str object with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_string(&mut self, iv: T, message: &String, cipher: *mut u8) -> u64

Encrypts the data stored in a String object with the padding according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_string_into_vec<U>( &mut self, iv: T, message: &String, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data stored in a String object with the padding according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn encrypt_string_into_array<U, const N: usize>( &mut self, iv: T, message: &String, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data stored in a String object with the padding according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_vec<U>(&mut self, iv: T, message: &Vec<U>, cipher: *mut u8) -> u64
where U: SmallUInt,

Encrypts the data stored in a Vec<U> object with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_vec_into_vec<U, V>( &mut self, iv: T, message: &Vec<U>, cipher: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in a Vec<U> object with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in Vec<V>. Read more
Source§

fn encrypt_vec_into_array<U, V, const N: usize>( &mut self, iv: T, message: &Vec<U>, cipher: &mut [V; N], ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in a Vec<U> object with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in array [V; N]. Read more
Source§

fn encrypt_array<U, const N: usize>( &mut self, iv: T, message: &[U; N], cipher: *mut u8, ) -> u64
where U: SmallUInt,

Encrypts the data stored in an array [U; N] object with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_array_into_vec<U, V, const N: usize>( &mut self, iv: T, message: &[U; N], cipher: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in an array [U; N] object with the padding according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in Vec<V>. Read more
Source§

fn encrypt_array_into_array<U, V, const N: usize, const M: usize>( &mut self, iv: T, message: &[U; N], cipher: &mut [V; M], ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in an array [U; N] object with the padding according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in array [V; M]. Read more
Source§

fn decrypt_into_vec<U>( &mut self, iv: T, cipher: *const u8, length_in_bytes: u64, message: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Decrypts the data with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode, and stores the decrypted data in Vec<U>. Read more
Source§

fn decrypt_into_string( &mut self, iv: T, cipher: *const u8, length_in_bytes: u64, message: &mut String, ) -> u64

Decrypts the data with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode, and stores the decrypted data in a String. Read more
Source§

fn decrypt_vec<U>(&mut self, iv: T, cipher: &Vec<U>, message: *mut u8) -> u64
where U: SmallUInt,

Decrypts the data stored in a Vec<U> object with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode. Read more
Source§

fn decrypt_vec_into_vec<U, V>( &mut self, iv: T, cipher: &Vec<U>, message: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in a Vec<U> object with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode, and stores the decrypted data in Vec<V>. Read more
Source§

fn decrypt_vec_into_array<U, V, const N: usize>( &mut self, iv: T, cipher: &Vec<U>, message: &mut [V; N], ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in a Vec<U> object with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode, and stores the decrypted data in array [V; N]. Read more
Source§

fn decrypt_vec_into_string<U>( &mut self, iv: T, cipher: &Vec<U>, message: &mut String, ) -> u64
where U: SmallUInt,

Decrypts the data in str with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode, and stores the decrypted data in String. Read more
Source§

fn decrypt_array<U, const N: usize>( &mut self, iv: T, cipher: &[U; N], message: *mut u8, ) -> u64
where U: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode. Read more
Source§

fn decrypt_array_into_vec<U, V, const N: usize>( &mut self, iv: T, cipher: &[U; N], message: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode, and stores the decrypted data in Vec<V>. Read more
Source§

fn decrypt_array_into_array<U, V, const N: usize, const M: usize>( &mut self, iv: T, cipher: &[U; N], message: &mut [V; M], ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode, and stores the decrypted data in array [V; M]. Read more
Source§

fn decrypt_array_into_string<U, const N: usize>( &mut self, iv: T, cipher: &[U; N], message: &mut String, ) -> u64
where U: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to ISO 7816-4 in CBC (Cipher-Block Chaining) mode, and stores the decrypted data in String. Read more
Source§

impl CBC_PKCS7<u128> for BigCryptor128

Source§

fn encrypt( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: *mut u8, ) -> u64

Encrypts the data with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode. Read more
Source§

fn decrypt( &mut self, iv: u128, cipher: *const u8, length_in_bytes: u64, message: *mut u8, ) -> u64

Decrypts the data with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_into_array<U, const N: usize>( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_into_vec<U>( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn decrypt_into_array<U, const N: usize>( &mut self, iv: u128, cipher: *const u8, length_in_bytes: u64, message: &mut [U; N], ) -> u64
where U: SmallUInt,

Decrypts the data with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode, and stores the decrypted data in array [U; N]. Read more
Source§

fn encrypt_str(&mut self, iv: T, message: &str, cipher: *mut u8) -> u64

Encrypts the data in a str object with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_str_into_vec<U>( &mut self, iv: T, message: &str, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data in str with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn encrypt_str_into_array<U, const N: usize>( &mut self, iv: T, message: &str, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data in a str object with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_string(&mut self, iv: T, message: &String, cipher: *mut u8) -> u64

Encrypts the data stored in a String object with the padding according to PKCS #7 in CBC (Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_string_into_vec<U>( &mut self, iv: T, message: &String, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data stored in a String object with the padding according to PKCS #7 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn encrypt_string_into_array<U, const N: usize>( &mut self, iv: T, message: &String, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data stored in a String object with the padding according to PKCS #7 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_vec<U>(&mut self, iv: T, message: &Vec<U>, cipher: *mut u8) -> u64
where U: SmallUInt,

Encrypts the data stored in a Vec<U> object with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_vec_into_vec<U, V>( &mut self, iv: T, message: &Vec<U>, cipher: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in a Vec<U> object with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in Vec<V>. Read more
Source§

fn encrypt_vec_into_array<U, V, const N: usize>( &mut self, iv: T, message: &Vec<U>, cipher: &mut [V; N], ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in a Vec<U> object with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in array [V; N]. Read more
Source§

fn encrypt_array<U, const N: usize>( &mut self, iv: T, message: &[U; N], cipher: *mut u8, ) -> u64
where U: SmallUInt,

Encrypts the data stored in an array [U; N] object with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_array_into_vec<U, V, const N: usize>( &mut self, iv: T, message: &[U; N], cipher: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in an array [U; N] object with the padding according to PKCS #7 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in Vec<V>. Read more
Source§

fn encrypt_array_into_array<U, V, const N: usize, const M: usize>( &mut self, iv: T, message: &[U; N], cipher: &mut [V; M], ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in an array [U; N] object with the padding according to PKCS #7 in CBC (Cipher-Block Chaining) mode, and stores the encrypted data in array [V; M]. Read more
Source§

fn decrypt_into_vec<U>( &mut self, iv: T, cipher: *const u8, length_in_bytes: u64, message: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Decrypts the data with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode, and stores the decrypted data in Vec<U>. Read more
Source§

fn decrypt_into_string( &mut self, iv: T, cipher: *const u8, length_in_bytes: u64, message: &mut String, ) -> u64

Decrypts the data with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode, and stores the decrypted data in a String. Read more
Source§

fn decrypt_vec<U>(&mut self, iv: T, cipher: &Vec<U>, message: *mut u8) -> u64
where U: SmallUInt,

Decrypts the data stored in a Vec<U> object with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode. Read more
Source§

fn decrypt_vec_into_vec<U, V>( &mut self, iv: T, cipher: &Vec<U>, message: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in a Vec<U> object with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode, and stores the decrypted data in Vec<V>. Read more
Source§

fn decrypt_vec_into_array<U, V, const N: usize>( &mut self, iv: T, cipher: &Vec<U>, message: &mut [V; N], ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in a Vec<U> object with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode, and stores the decrypted data in array [V; N]. Read more
Source§

fn decrypt_vec_into_string<U>( &mut self, iv: T, cipher: &Vec<U>, message: &mut String, ) -> u64
where U: SmallUInt,

Decrypts the data in str with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode, and stores the decrypted data in String. Read more
Source§

fn decrypt_array<U, const N: usize>( &mut self, iv: T, cipher: &[U; N], message: *mut u8, ) -> u64
where U: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode. Read more
Source§

fn decrypt_array_into_vec<U, V, const N: usize>( &mut self, iv: T, cipher: &[U; N], message: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode, and stores the decrypted data in Vec<V>. Read more
Source§

fn decrypt_array_into_array<U, V, const N: usize, const M: usize>( &mut self, iv: T, cipher: &[U; N], message: &mut [V; M], ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode, and stores the decrypted data in array [V; M]. Read more
Source§

fn decrypt_array_into_string<U, const N: usize>( &mut self, iv: T, cipher: &[U; N], message: &mut String, ) -> u64
where U: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to PKCS #7 in CBC (Cipher-Block Chaining) mode, and stores the decrypted data in String. Read more
Source§

impl CFB<u128> for BigCryptor128

Source§

fn encrypt( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: *mut u8, ) -> u64

Encrypts the data without any padding in CFB (Cipher FeedBack) mode. Read more
Source§

fn decrypt( &mut self, iv: u128, cipher: *const u8, length_in_bytes: u64, message: *mut u8, ) -> u64

Decrypts the data without any padding in CFB (Cipher FeedBack) mode. Read more
Source§

fn encrypt_into_array<U, const N: usize>( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data without any padding in CFB (Cipher FeedBack) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_into_vec<U>( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data without any padding in CFB (Cipher FeedBack) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn decrypt_into_array<U, const N: usize>( &mut self, iv: u128, cipher: *const u8, length_in_bytes: u64, message: &mut [U; N], ) -> u64
where U: SmallUInt,

Decrypts the data without any padding in CFB (Cipher FeedBack) mode, and stores the decrypted data in array [U; N]. Read more
Source§

fn encrypt_str(&mut self, iv: T, message: &str, cipher: *mut u8) -> u64

Encrypts the data in a str object without any padding in CFB (Cipher FeedBack) mode. Read more
Source§

fn encrypt_str_into_vec<U>( &mut self, iv: T, message: &str, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data in str without any padding in CFB (Cipher FeedBack) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn encrypt_str_into_array<U, const N: usize>( &mut self, iv: T, message: &str, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data in a str object without any padding in CFB (Cipher FeedBack) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_string(&mut self, iv: T, message: &String, cipher: *mut u8) -> u64

Encrypts the data stored in a String object without any padding in CFB (Cipher FeedBack) mode. Read more
Source§

fn encrypt_string_into_vec<U>( &mut self, iv: T, message: &String, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data stored in a String object without any padding in CFB (Cipher FeedBack) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn encrypt_string_into_array<U, const N: usize>( &mut self, iv: T, message: &String, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data stored in a String object without any padding in CFB (Cipher FeedBack) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_vec<U>(&mut self, iv: T, message: &Vec<U>, cipher: *mut u8) -> u64
where U: SmallUInt,

Encrypts the data stored in a Vec<U> object without any padding in CFB (Cipher FeedBack) mode. Read more
Source§

fn encrypt_vec_into_vec<U, V>( &mut self, iv: T, message: &Vec<U>, cipher: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in a Vec<U> object without any padding in CFB (Cipher FeedBack) mode, and stores the encrypted data in Vec<V>. Read more
Source§

fn encrypt_vec_into_array<U, V, const N: usize>( &mut self, iv: T, message: &Vec<U>, cipher: &mut [V; N], ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in a Vec<U> object without any padding in CFB (Cipher FeedBack) mode, and stores the encrypted data in array [V; N]. Read more
Source§

fn encrypt_array<U, const N: usize>( &mut self, iv: T, message: &[U; N], cipher: *mut u8, ) -> u64
where U: SmallUInt,

Encrypts the data stored in an array [U; N] object without any padding in CFB (Cipher FeedBack) mode. Read more
Source§

fn encrypt_array_into_vec<U, V, const N: usize>( &mut self, iv: T, message: &[U; N], cipher: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in an array [U; N] object without any padding in CFB (Cipher FeedBack) mode, and stores the encrypted data in Vec<V>. Read more
Source§

fn encrypt_array_into_array<U, V, const N: usize, const M: usize>( &mut self, iv: T, message: &[U; N], cipher: &mut [V; M], ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in an array [U; N] object without any padding in CFB (Cipher FeedBack) mode, and stores the encrypted data in array [V; M]. Read more
Source§

fn decrypt_into_vec<U>( &mut self, iv: T, cipher: *const u8, length_in_bytes: u64, message: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Decrypts the data without any padding in CFB (Cipher FeedBack) mode, and stores the decrypted data in Vec<U>. Read more
Source§

fn decrypt_into_string( &mut self, iv: T, cipher: *const u8, length_in_bytes: u64, message: &mut String, ) -> u64

Decrypts the data without any padding in CFB (Cipher FeedBack) mode, and stores the decrypted data in a String. Read more
Source§

fn decrypt_vec<U>(&mut self, iv: T, cipher: &Vec<U>, message: *mut u8) -> u64
where U: SmallUInt,

Decrypts the data stored in a Vec<U> object without any padding in CFB (Cipher FeedBack) mode. Read more
Source§

fn decrypt_vec_into_vec<U, V>( &mut self, iv: T, cipher: &Vec<U>, message: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in a Vec<U> object without any padding in CFB (Cipher FeedBack) mode, and stores the decrypted data in Vec<V>. Read more
Source§

fn decrypt_vec_into_array<U, V, const N: usize>( &mut self, iv: T, cipher: &Vec<U>, message: &mut [V; N], ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in a Vec<U> object without any padding in CFB (Cipher FeedBack) mode, and stores the decrypted data in array [V; N]. Read more
Source§

fn decrypt_vec_into_string<U>( &mut self, iv: T, cipher: &Vec<U>, message: &mut String, ) -> u64
where U: SmallUInt,

Decrypts the data in str without any padding in CFB (Cipher FeedBack) mode, and stores the decrypted data in String. Read more
Source§

fn decrypt_array<U, const N: usize>( &mut self, iv: T, cipher: &[U; N], message: *mut u8, ) -> u64
where U: SmallUInt,

Decrypts the data stored in an array [U; N] object without any padding in CFB (Cipher FeedBack) mode. Read more
Source§

fn decrypt_array_into_vec<U, V, const N: usize>( &mut self, iv: T, cipher: &[U; N], message: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in an array [U; N] object without any padding in CFB (Cipher FeedBack) mode, and stores the decrypted data in Vec<V>. Read more
Source§

fn decrypt_array_into_array<U, V, const N: usize, const M: usize>( &mut self, iv: T, cipher: &[U; N], message: &mut [V; M], ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in an array [U; N] object without any padding in CFB (Cipher FeedBack) mode, and stores the decrypted data in array [V; M]. Read more
Source§

fn decrypt_array_into_string<U, const N: usize>( &mut self, iv: T, cipher: &[U; N], message: &mut String, ) -> u64
where U: SmallUInt,

Decrypts the data stored in an array [U; N] object without any padding in CFB (Cipher FeedBack) mode, and stores the decrypted data in String. Read more
Source§

impl CTR<u128> for BigCryptor128

Source§

fn encrypt( &mut self, nonce: u128, message: *const u8, length_in_bytes: u64, cipher: *mut u8, ) -> u64

Encrypts the data without any padding in CTR (CounTeR) mode. Read more
Source§

fn encrypt_into_array<U, const N: usize>( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data without any padding in CTR (CounTeR) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_into_vec<U>( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data without any padding in CTR (CounTeR) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn decrypt_into_array<U, const N: usize>( &mut self, iv: u128, cipher: *const u8, length_in_bytes: u64, message: &mut [U; N], ) -> u64
where U: SmallUInt,

Decrypts the data without any padding in CTR (CounTeR) mode, and stores the decrypted data in array [U; N]. Read more
Source§

fn encrypt_str(&mut self, nonce: T, message: &str, cipher: *mut u8) -> u64

Encrypts the data in a str object without any padding in CTR (CounTeR) mode. Read more
Source§

fn encrypt_str_into_vec<U>( &mut self, nonce: T, message: &str, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data in str without any padding in CTR (CounTeR) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn encrypt_str_into_array<U, const N: usize>( &mut self, nonce: T, message: &str, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data in a str object without any padding in CTR (CounTeR) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_string(&mut self, nonce: T, message: &String, cipher: *mut u8) -> u64

Encrypts the data stored in a String object without any padding in CTR (CounTeR) mode. Read more
Source§

fn encrypt_string_into_vec<U>( &mut self, nonce: T, message: &String, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data stored in a String object without any padding in CTR (CounTeR) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn encrypt_string_into_array<U, const N: usize>( &mut self, nonce: T, message: &String, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data stored in a String object without any padding in CTR (CounTeR) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_vec<U>(&mut self, nonce: T, message: &Vec<U>, cipher: *mut u8) -> u64
where U: SmallUInt,

Encrypts the data stored in a Vec<U> object without any padding in CTR (CounTeR) mode. Read more
Source§

fn encrypt_vec_into_vec<U, V>( &mut self, nonce: T, message: &Vec<U>, cipher: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in a Vec<U> object without any padding in CTR (CounTeR) mode, and stores the encrypted data in Vec<V>. Read more
Source§

fn encrypt_vec_into_array<U, V, const N: usize>( &mut self, nonce: T, message: &Vec<U>, cipher: &mut [V; N], ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in a Vec<U> object without any padding in CTR (CounTeR) mode, and stores the encrypted data in array [V; N]. Read more
Source§

fn encrypt_array<U, const N: usize>( &mut self, nonce: T, message: &[U; N], cipher: *mut u8, ) -> u64
where U: SmallUInt,

Encrypts the data stored in an array [U; N] object without any padding in CTR (CounTeR) mode. Read more
Source§

fn encrypt_array_into_vec<U, V, const N: usize>( &mut self, nonce: T, message: &[U; N], cipher: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in an array [U; N] object without any padding in CTR (CounTeR) mode, and stores the encrypted data in Vec<V>. Read more
Source§

fn encrypt_array_into_array<U, V, const N: usize, const M: usize>( &mut self, nonce: T, message: &[U; N], cipher: &mut [V; M], ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in an array [U; N] object without any padding in CTR (CounTeR) mode, and stores the encrypted data in array [V; M]. Read more
Source§

fn decrypt( &mut self, nonce: T, cipher: *const u8, length_in_bytes: u64, message: *mut u8, ) -> u64

Decrypts the data without any padding in CTR (CounTeR) mode. Read more
Source§

fn decrypt_into_vec<U>( &mut self, nonce: T, cipher: *const u8, length_in_bytes: u64, message: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Decrypts the data without any padding in CTR (CounTeR) mode, and stores the decrypted data in Vec<U>. Read more
Source§

fn decrypt_into_string( &mut self, nonce: T, cipher: *const u8, length_in_bytes: u64, message: &mut String, ) -> u64

Decrypts the data without any padding in CTR (CounTeR) mode, and stores the decrypted data in a String. Read more
Source§

fn decrypt_vec<U>(&mut self, nonce: T, cipher: &Vec<U>, message: *mut u8) -> u64
where U: SmallUInt,

Decrypts the data stored in a Vec<U> object without any padding in CTR (CounTeR) mode. Read more
Source§

fn decrypt_vec_into_vec<U, V>( &mut self, nonce: T, cipher: &Vec<U>, message: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in a Vec<U> object without any padding in CTR (CounTeR) mode, and stores the decrypted data in Vec<V>. Read more
Source§

fn decrypt_vec_into_array<U, V, const N: usize>( &mut self, nonce: T, cipher: &Vec<U>, message: &mut [V; N], ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in a Vec<U> object without any padding in CTR (CounTeR) mode, and stores the decrypted data in array [V; N]. Read more
Source§

fn decrypt_vec_into_string<U>( &mut self, nonce: T, cipher: &Vec<U>, message: &mut String, ) -> u64
where U: SmallUInt,

Decrypts the data in str without any padding in CTR (CounTeR) mode, and stores the decrypted data in String. Read more
Source§

fn decrypt_array<U, const N: usize>( &mut self, nonce: T, cipher: &[U; N], message: *mut u8, ) -> u64
where U: SmallUInt,

Decrypts the data stored in an array [U; N] object without any padding in CTR (CounTeR) mode. Read more
Source§

fn decrypt_array_into_vec<U, V, const N: usize>( &mut self, nonce: T, cipher: &[U; N], message: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in an array [U; N] object without any padding in CTR (CounTeR) mode, and stores the decrypted data in Vec<V>. Read more
Source§

fn decrypt_array_into_array<U, V, const N: usize, const M: usize>( &mut self, nonce: T, cipher: &[U; N], message: &mut [V; M], ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in an array [U; N] object without any padding in CTR (CounTeR) mode, and stores the decrypted data in array [V; M]. Read more
Source§

fn decrypt_array_into_string<U, const N: usize>( &mut self, nonce: T, cipher: &[U; N], message: &mut String, ) -> u64
where U: SmallUInt,

Decrypts the data stored in an array [U; N] object without any padding in CTR (CounTeR) mode, and stores the decrypted data in String. Read more
Source§

impl ECB_ISO<u128> for BigCryptor128

Source§

fn encrypt( &mut self, message: *const u8, length_in_bytes: u64, cipher: *mut u8, ) -> u64

Encrypts the data with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode. Read more
Source§

fn decrypt( &mut self, cipher: *const u8, length_in_bytes: u64, message: *mut u8, ) -> u64

Decrypts the data with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode. Read more
Source§

fn encrypt_into_array<U, const N: usize>( &mut self, message: *const u8, length_in_bytes: u64, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_into_vec<U>( &mut self, message: *const u8, length_in_bytes: u64, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn decrypt_into_array<U, const N: usize>( &mut self, cipher: *const u8, length_in_bytes: u64, message: &mut [U; N], ) -> u64
where U: SmallUInt,

Decrypts the data with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode, and stores the decrypted data in array [U; N]. Read more
Source§

fn encrypt_str(&mut self, message: &str, cipher: *mut u8) -> u64

Encrypts the data in a str object with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode. Read more
Source§

fn encrypt_str_into_vec<U>(&mut self, message: &str, cipher: &mut Vec<U>) -> u64
where U: SmallUInt,

Encrypts the data in str with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn encrypt_str_into_array<U, const N: usize>( &mut self, message: &str, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data in a str object with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_string(&mut self, message: &String, cipher: *mut u8) -> u64

Encrypts the data stored in a String object with the padding according to ISO 7816-4 in ECB (Electronic CodeBook) mode. Read more
Source§

fn encrypt_string_into_vec<U>( &mut self, message: &String, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data stored in a String object with the padding according to ISO 7816-4 in ECB (Electronic CodeBook) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn encrypt_string_into_array<U, const N: usize>( &mut self, message: &String, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data stored in a String object with the padding according to ISO 7816-4 in ECB (Electronic CodeBook) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_vec<U>(&mut self, message: &Vec<U>, cipher: *mut u8) -> u64
where U: SmallUInt,

Encrypts the data stored in a Vec<U> object with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode. Read more
Source§

fn encrypt_vec_into_vec<U, V>( &mut self, message: &Vec<U>, cipher: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in a Vec<U> object with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode, and stores the encrypted data in Vec<V>. Read more
Source§

fn encrypt_vec_into_array<U, V, const N: usize>( &mut self, message: &Vec<U>, cipher: &mut [V; N], ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in a Vec<U> object with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode, and stores the encrypted data in array [V; N]. Read more
Source§

fn encrypt_array<U, const N: usize>( &mut self, message: &[U; N], cipher: *mut u8, ) -> u64
where U: SmallUInt,

Encrypts the data stored in an array [U; N] object with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode. Read more
Source§

fn encrypt_array_into_vec<U, V, const N: usize>( &mut self, message: &[U; N], cipher: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in an array [U; N] object with the padding according to ISO 7816-4 in ECB (Electronic CodeBook) mode, and stores the encrypted data in Vec<V>. Read more
Source§

fn encrypt_array_into_array<U, V, const N: usize, const M: usize>( &mut self, message: &[U; N], cipher: &mut [V; M], ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in an array [U; N] object with the padding according to ISO 7816-4 in ECB (Electronic CodeBook) mode, and stores the encrypted data in array [V; M]. Read more
Source§

fn decrypt_into_vec<U>( &mut self, cipher: *const u8, length_in_bytes: u64, message: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Decrypts the data with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode, and stores the decrypted data in Vec<U>. Read more
Source§

fn decrypt_into_string( &mut self, cipher: *const u8, length_in_bytes: u64, message: &mut String, ) -> u64

Decrypts the data with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode, and stores the decrypted data in a String. Read more
Source§

fn decrypt_vec<U>(&mut self, cipher: &Vec<U>, message: *mut u8) -> u64
where U: SmallUInt,

Decrypts the data stored in a Vec<U> object with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode. Read more
Source§

fn decrypt_vec_into_vec<U, V>( &mut self, cipher: &Vec<U>, message: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in a Vec<U> object with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode, and stores the decrypted data in Vec<V>. Read more
Source§

fn decrypt_vec_into_array<U, V, const N: usize>( &mut self, cipher: &Vec<U>, message: &mut [V; N], ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in a Vec<U> object with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode, and stores the decrypted data in array [V; N]. Read more
Source§

fn decrypt_vec_into_string<U>( &mut self, cipher: &Vec<U>, message: &mut String, ) -> u64
where U: SmallUInt,

Decrypts the data in str with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode, and stores the decrypted data in String. Read more
Source§

fn decrypt_array<U, const N: usize>( &mut self, cipher: &[U; N], message: *mut u8, ) -> u64
where U: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode. Read more
Source§

fn decrypt_array_into_vec<U, V, const N: usize>( &mut self, cipher: &[U; N], message: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode, and stores the decrypted data in Vec<V>. Read more
Source§

fn decrypt_array_into_array<U, V, const N: usize, const M: usize>( &mut self, cipher: &[U; N], message: &mut [V; M], ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode, and stores the decrypted data in array [V; M]. Read more
Source§

fn decrypt_array_into_string<U, const N: usize>( &mut self, cipher: &[U; N], message: &mut String, ) -> u64
where U: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to ISO 7816-4 in ECB (Electronic CodeBook) mode, and stores the decrypted data in String. Read more
Source§

impl ECB_PKCS7<u128> for BigCryptor128

Source§

fn encrypt( &mut self, message: *const u8, length_in_bytes: u64, cipher: *mut u8, ) -> u64

Encrypts the data with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode. Read more
Source§

fn decrypt( &mut self, cipher: *const u8, length_in_bytes: u64, message: *mut u8, ) -> u64

Decrypts the data with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode. Read more
Source§

fn encrypt_into_array<U, const N: usize>( &mut self, message: *const u8, length_in_bytes: u64, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_into_vec<U>( &mut self, message: *const u8, length_in_bytes: u64, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn decrypt_into_array<U, const N: usize>( &mut self, cipher: *const u8, length_in_bytes: u64, message: &mut [U; N], ) -> u64
where U: SmallUInt,

Decrypts the data with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode, and stores the decrypted data in array [U; N]. Read more
Source§

fn encrypt_str(&mut self, message: &str, cipher: *mut u8) -> u64

Encrypts the data in a str object with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode. Read more
Source§

fn encrypt_str_into_vec<U>(&mut self, message: &str, cipher: &mut Vec<U>) -> u64
where U: SmallUInt,

Encrypts the data in str with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn encrypt_str_into_array<U, const N: usize>( &mut self, message: &str, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data in a str object with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_string(&mut self, message: &String, cipher: *mut u8) -> u64

Encrypts the data stored in a String object with the padding according to PKCS #7 in ECB (Electronic CodeBook) mode. Read more
Source§

fn encrypt_string_into_vec<U>( &mut self, message: &String, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data stored in a String object with the padding according to PKCS #7 in ECB (Electronic CodeBook) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn encrypt_string_into_array<U, const N: usize>( &mut self, message: &String, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data stored in a String object with the padding according to PKCS #7 in ECB (Electronic CodeBook) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_vec<U>(&mut self, message: &Vec<U>, cipher: *mut u8) -> u64
where U: SmallUInt,

Encrypts the data stored in a Vec<U> object with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode. Read more
Source§

fn encrypt_vec_into_vec<U, V>( &mut self, message: &Vec<U>, cipher: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in a Vec<U> object with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode, and stores the encrypted data in Vec<V>. Read more
Source§

fn encrypt_vec_into_array<U, V, const N: usize>( &mut self, message: &Vec<U>, cipher: &mut [V; N], ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in a Vec<U> object with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode, and stores the encrypted data in array [V; N]. Read more
Source§

fn encrypt_array<U, const N: usize>( &mut self, message: &[U; N], cipher: *mut u8, ) -> u64
where U: SmallUInt,

Encrypts the data stored in an array [U; N] object with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode. Read more
Source§

fn encrypt_array_into_vec<U, V, const N: usize>( &mut self, message: &[U; N], cipher: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in an array [U; N] object with the padding according to PKCS #7 in ECB (Electronic CodeBook) mode, and stores the encrypted data in Vec<V>. Read more
Source§

fn encrypt_array_into_array<U, V, const N: usize, const M: usize>( &mut self, message: &[U; N], cipher: &mut [V; M], ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in an array [U; N] object with the padding according to PKCS #7 in ECB (Electronic CodeBook) mode, and stores the encrypted data in array [V; M]. Read more
Source§

fn decrypt_into_vec<U>( &mut self, cipher: *const u8, length_in_bytes: u64, message: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Decrypts the data with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode, and stores the decrypted data in Vec<U>. Read more
Source§

fn decrypt_into_string( &mut self, cipher: *const u8, length_in_bytes: u64, message: &mut String, ) -> u64

Decrypts the data with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode, and stores the decrypted data in a String. Read more
Source§

fn decrypt_vec<U>(&mut self, cipher: &Vec<U>, message: *mut u8) -> u64
where U: SmallUInt,

Decrypts the data stored in a Vec<U> object with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode. Read more
Source§

fn decrypt_vec_into_vec<U, V>( &mut self, cipher: &Vec<U>, message: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in a Vec<U> object with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode, and stores the decrypted data in Vec<V>. Read more
Source§

fn decrypt_vec_into_array<U, V, const N: usize>( &mut self, cipher: &Vec<U>, message: &mut [V; N], ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in a Vec<U> object with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode, and stores the decrypted data in array [V; N]. Read more
Source§

fn decrypt_vec_into_string<U>( &mut self, cipher: &Vec<U>, message: &mut String, ) -> u64
where U: SmallUInt,

Decrypts the data in str with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode, and stores the decrypted data in String. Read more
Source§

fn decrypt_array<U, const N: usize>( &mut self, cipher: &[U; N], message: *mut u8, ) -> u64
where U: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode. Read more
Source§

fn decrypt_array_into_vec<U, V, const N: usize>( &mut self, cipher: &[U; N], message: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode, and stores the decrypted data in Vec<V>. Read more
Source§

fn decrypt_array_into_array<U, V, const N: usize, const M: usize>( &mut self, cipher: &[U; N], message: &mut [V; M], ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode, and stores the decrypted data in array [V; M]. Read more
Source§

fn decrypt_array_into_string<U, const N: usize>( &mut self, cipher: &[U; N], message: &mut String, ) -> u64
where U: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to PKCS #7 in ECB (Electronic CodeBook) mode, and stores the decrypted data in String. Read more
Source§

impl OFB<u128> for BigCryptor128

Source§

fn encrypt( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: *mut u8, ) -> u64

Encrypts the data without any padding in OFB (Output FeedBack) mode. Read more
Source§

fn encrypt_into_array<U, const N: usize>( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data without any padding in OFB (Output FeedBack) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_into_vec<U>( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data without any padding in OFB (Output FeedBack) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn decrypt_into_array<U, const N: usize>( &mut self, iv: u128, cipher: *const u8, length_in_bytes: u64, message: &mut [U; N], ) -> u64
where U: SmallUInt,

Decrypts the data without any padding in OFB (Output FeedBack) mode, and stores the decrypted data in array [U; N]. Read more
Source§

fn encrypt_str(&mut self, iv: T, message: &str, cipher: *mut u8) -> u64

Encrypts the data in a str object without any padding in OFB (Output FeedBack) mode. Read more
Source§

fn encrypt_str_into_vec<U>( &mut self, iv: T, message: &str, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data in str without any padding in OFB (Output FeedBack) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn encrypt_str_into_array<U, const N: usize>( &mut self, iv: T, message: &str, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data in a str object without any padding in OFB (Output FeedBack) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_string(&mut self, iv: T, message: &String, cipher: *mut u8) -> u64

Encrypts the data stored in a String object without any padding in OFB (Output FeedBack) mode. Read more
Source§

fn encrypt_string_into_vec<U>( &mut self, iv: T, message: &String, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data stored in a String object without any padding in OFB (Output FeedBack) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn encrypt_string_into_array<U, const N: usize>( &mut self, iv: T, message: &String, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data stored in a String object without any padding in OFB (Output FeedBack) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_vec<U>(&mut self, iv: T, message: &Vec<U>, cipher: *mut u8) -> u64
where U: SmallUInt,

Encrypts the data stored in a Vec<U> object without any padding in OFB (Output FeedBack) mode. Read more
Source§

fn encrypt_vec_into_vec<U, V>( &mut self, iv: T, message: &Vec<U>, cipher: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in a Vec<U> object without any padding in OFB (Output FeedBack) mode, and stores the encrypted data in Vec<V>. Read more
Source§

fn encrypt_vec_into_array<U, V, const N: usize>( &mut self, iv: T, message: &Vec<U>, cipher: &mut [V; N], ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in a Vec<U> object without any padding in OFB (Output FeedBack) mode, and stores the encrypted data in array [V; N]. Read more
Source§

fn encrypt_array<U, const N: usize>( &mut self, iv: T, message: &[U; N], cipher: *mut u8, ) -> u64
where U: SmallUInt,

Encrypts the data stored in an array [U; N] object without any padding in OFB (Output FeedBack) mode. Read more
Source§

fn encrypt_array_into_vec<U, V, const N: usize>( &mut self, iv: T, message: &[U; N], cipher: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in an array [U; N] object without any padding in OFB (Output FeedBack) mode, and stores the encrypted data in Vec<V>. Read more
Source§

fn encrypt_array_into_array<U, V, const N: usize, const M: usize>( &mut self, iv: T, message: &[U; N], cipher: &mut [V; M], ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in an array [U; N] object without any padding in OFB (Output FeedBack) mode, and stores the encrypted data in array [V; M]. Read more
Source§

fn decrypt( &mut self, iv: T, cipher: *const u8, length_in_bytes: u64, message: *mut u8, ) -> u64

Decrypts the data without any padding in OFB (Output FeedBack) mode. Read more
Source§

fn decrypt_into_vec<U>( &mut self, iv: T, cipher: *const u8, length_in_bytes: u64, message: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Decrypts the data without any padding in OFB (Output FeedBack) mode, and stores the decrypted data in Vec<U>. Read more
Source§

fn decrypt_into_string( &mut self, iv: T, cipher: *const u8, length_in_bytes: u64, message: &mut String, ) -> u64

Decrypts the data without any padding in OFB (Output FeedBack) mode, and stores the decrypted data in a String. Read more
Source§

fn decrypt_vec<U>(&mut self, iv: T, cipher: &Vec<U>, message: *mut u8) -> u64
where U: SmallUInt,

Decrypts the data stored in a Vec<U> object without any padding in OFB (Output FeedBack) mode. Read more
Source§

fn decrypt_vec_into_vec<U, V>( &mut self, iv: T, cipher: &Vec<U>, message: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in a Vec<U> object without any padding in OFB (Output FeedBack) mode, and stores the decrypted data in Vec<V>. Read more
Source§

fn decrypt_vec_into_array<U, V, const N: usize>( &mut self, iv: T, cipher: &Vec<U>, message: &mut [V; N], ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in a Vec<U> object without any padding in OFB (Output FeedBack) mode, and stores the decrypted data in array [V; N]. Read more
Source§

fn decrypt_vec_into_string<U>( &mut self, iv: T, cipher: &Vec<U>, message: &mut String, ) -> u64
where U: SmallUInt,

Decrypts the data in str without any padding in OFB (Output FeedBack) mode, and stores the decrypted data in String. Read more
Source§

fn decrypt_array<U, const N: usize>( &mut self, iv: T, cipher: &[U; N], message: *mut u8, ) -> u64
where U: SmallUInt,

Decrypts the data stored in an array [U; N] object without any padding in OFB (Output FeedBack) mode. Read more
Source§

fn decrypt_array_into_vec<U, V, const N: usize>( &mut self, iv: T, cipher: &[U; N], message: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in an array [U; N] object without any padding in OFB (Output FeedBack) mode, and stores the decrypted data in Vec<V>. Read more
Source§

fn decrypt_array_into_array<U, V, const N: usize, const M: usize>( &mut self, iv: T, cipher: &[U; N], message: &mut [V; M], ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in an array [U; N] object without any padding in OFB (Output FeedBack) mode, and stores the decrypted data in array [V; M]. Read more
Source§

fn decrypt_array_into_string<U, const N: usize>( &mut self, iv: T, cipher: &[U; N], message: &mut String, ) -> u64
where U: SmallUInt,

Decrypts the data stored in an array [U; N] object without any padding in OFB (Output FeedBack) mode, and stores the decrypted data in String. Read more
Source§

impl PCBC_ISO<u128> for BigCryptor128

Source§

fn encrypt( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: *mut u8, ) -> u64

Encrypts the data with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode. Read more
Source§

fn decrypt( &mut self, iv: u128, cipher: *const u8, length_in_bytes: u64, message: *mut u8, ) -> u64

Decrypts the data with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_into_array<U, const N: usize>( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_into_vec<U>( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn decrypt_into_array<U, const N: usize>( &mut self, iv: u128, cipher: *const u8, length_in_bytes: u64, message: &mut [U; N], ) -> u64
where U: SmallUInt,

Decrypts the data with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the decrypted data in array [U; N]. Read more
Source§

fn encrypt_str(&mut self, iv: T, message: &str, cipher: *mut u8) -> u64

Encrypts the data in a str object with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_str_into_vec<U>( &mut self, iv: T, message: &str, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data in str with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn encrypt_str_into_array<U, const N: usize>( &mut self, iv: T, message: &str, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data in a str object with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_string(&mut self, iv: T, message: &String, cipher: *mut u8) -> u64

Encrypts the data stored in a String object with the padding according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_string_into_vec<U>( &mut self, iv: T, message: &String, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data stored in a String object with the padding according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn encrypt_string_into_array<U, const N: usize>( &mut self, iv: T, message: &String, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data stored in a String object with the padding according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_vec<U>(&mut self, iv: T, message: &Vec<U>, cipher: *mut u8) -> u64
where U: SmallUInt,

Encrypts the data stored in a Vec<U> object with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_vec_into_vec<U, V>( &mut self, iv: T, message: &Vec<U>, cipher: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in a Vec<U> object with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in Vec<V>. Read more
Source§

fn encrypt_vec_into_array<U, V, const N: usize>( &mut self, iv: T, message: &Vec<U>, cipher: &mut [V; N], ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in a Vec<U> object with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in array [V; N]. Read more
Source§

fn encrypt_array<U, const N: usize>( &mut self, iv: T, message: &[U; N], cipher: *mut u8, ) -> u64
where U: SmallUInt,

Encrypts the data stored in an array [U; N] object with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_array_into_vec<U, V, const N: usize>( &mut self, iv: T, message: &[U; N], cipher: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in an array [U; N] object with the padding according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in Vec<V>. Read more
Source§

fn encrypt_array_into_array<U, V, const N: usize, const M: usize>( &mut self, iv: T, message: &[U; N], cipher: &mut [V; M], ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in an array [U; N] object with the padding according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in array [V; M]. Read more
Source§

fn decrypt_into_vec<U>( &mut self, iv: T, cipher: *const u8, length_in_bytes: u64, message: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Decrypts the data with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the decrypted data in Vec<U>. Read more
Source§

fn decrypt_into_string( &mut self, iv: T, cipher: *const u8, length_in_bytes: u64, message: &mut String, ) -> u64

Decrypts the data with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the decrypted data in a String. Read more
Source§

fn decrypt_vec<U>(&mut self, iv: T, cipher: &Vec<U>, message: *mut u8) -> u64
where U: SmallUInt,

Decrypts the data stored in a Vec<U> object with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode. Read more
Source§

fn decrypt_vec_into_vec<U, V>( &mut self, iv: T, cipher: &Vec<U>, message: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in a Vec<U> object with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the decrypted data in Vec<V>. Read more
Source§

fn decrypt_vec_into_array<U, V, const N: usize>( &mut self, iv: T, cipher: &Vec<U>, message: &mut [V; N], ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in a Vec<U> object with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the decrypted data in array [V; N]. Read more
Source§

fn decrypt_vec_into_string<U>( &mut self, iv: T, cipher: &Vec<U>, message: &mut String, ) -> u64
where U: SmallUInt,

Decrypts the data in str with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the decrypted data in String. Read more
Source§

fn decrypt_array<U, const N: usize>( &mut self, iv: T, cipher: &[U; N], message: *mut u8, ) -> u64
where U: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode. Read more
Source§

fn decrypt_array_into_vec<U, V, const N: usize>( &mut self, iv: T, cipher: &[U; N], message: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the decrypted data in Vec<V>. Read more
Source§

fn decrypt_array_into_array<U, V, const N: usize, const M: usize>( &mut self, iv: T, cipher: &[U; N], message: &mut [V; M], ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the decrypted data in array [V; M]. Read more
Source§

fn decrypt_array_into_string<U, const N: usize>( &mut self, iv: T, cipher: &[U; N], message: &mut String, ) -> u64
where U: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to ISO 7816-4 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the decrypted data in String. Read more
Source§

impl PCBC_PKCS7<u128> for BigCryptor128

Source§

fn encrypt( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: *mut u8, ) -> u64

Encrypts the data with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode. Read more
Source§

fn decrypt( &mut self, iv: u128, cipher: *const u8, length_in_bytes: u64, message: *mut u8, ) -> u64

Decrypts the data with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_into_array<U, const N: usize>( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_into_vec<U>( &mut self, iv: u128, message: *const u8, length_in_bytes: u64, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn decrypt_into_array<U, const N: usize>( &mut self, iv: u128, cipher: *const u8, length_in_bytes: u64, message: &mut [U; N], ) -> u64
where U: SmallUInt,

Decrypts the data with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the decrypted data in array [U; N]. Read more
Source§

fn encrypt_str(&mut self, iv: T, message: &str, cipher: *mut u8) -> u64

Encrypts the data in a str object with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_str_into_vec<U>( &mut self, iv: T, message: &str, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data in str with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn encrypt_str_into_array<U, const N: usize>( &mut self, iv: T, message: &str, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data in a str object with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_string(&mut self, iv: T, message: &String, cipher: *mut u8) -> u64

Encrypts the data stored in a String object with the padding according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_string_into_vec<U>( &mut self, iv: T, message: &String, cipher: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Encrypts the data stored in a String object with the padding according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in Vec<U>. Read more
Source§

fn encrypt_string_into_array<U, const N: usize>( &mut self, iv: T, message: &String, cipher: &mut [U; N], ) -> u64
where U: SmallUInt,

Encrypts the data stored in a String object with the padding according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in array [U; N]. Read more
Source§

fn encrypt_vec<U>(&mut self, iv: T, message: &Vec<U>, cipher: *mut u8) -> u64
where U: SmallUInt,

Encrypts the data stored in a Vec<U> object with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_vec_into_vec<U, V>( &mut self, iv: T, message: &Vec<U>, cipher: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in a Vec<U> object with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in Vec<V>. Read more
Source§

fn encrypt_vec_into_array<U, V, const N: usize>( &mut self, iv: T, message: &Vec<U>, cipher: &mut [V; N], ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in a Vec<U> object with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in array [V; N]. Read more
Source§

fn encrypt_array<U, const N: usize>( &mut self, iv: T, message: &[U; N], cipher: *mut u8, ) -> u64
where U: SmallUInt,

Encrypts the data stored in an array [U; N] object with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode. Read more
Source§

fn encrypt_array_into_vec<U, V, const N: usize>( &mut self, iv: T, message: &[U; N], cipher: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in an array [U; N] object with the padding according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in Vec<V>. Read more
Source§

fn encrypt_array_into_array<U, V, const N: usize, const M: usize>( &mut self, iv: T, message: &[U; N], cipher: &mut [V; M], ) -> u64
where U: SmallUInt, V: SmallUInt,

Encrypts the data stored in an array [U; N] object with the padding according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the encrypted data in array [V; M]. Read more
Source§

fn decrypt_into_vec<U>( &mut self, iv: T, cipher: *const u8, length_in_bytes: u64, message: &mut Vec<U>, ) -> u64
where U: SmallUInt,

Decrypts the data with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the decrypted data in Vec<U>. Read more
Source§

fn decrypt_into_string( &mut self, iv: T, cipher: *const u8, length_in_bytes: u64, message: &mut String, ) -> u64

Decrypts the data with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the decrypted data in a String. Read more
Source§

fn decrypt_vec<U>(&mut self, iv: T, cipher: &Vec<U>, message: *mut u8) -> u64
where U: SmallUInt,

Decrypts the data stored in a Vec<U> object with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode. Read more
Source§

fn decrypt_vec_into_vec<U, V>( &mut self, iv: T, cipher: &Vec<U>, message: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in a Vec<U> object with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the decrypted data in Vec<V>. Read more
Source§

fn decrypt_vec_into_array<U, V, const N: usize>( &mut self, iv: T, cipher: &Vec<U>, message: &mut [V; N], ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in a Vec<U> object with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the decrypted data in array [V; N]. Read more
Source§

fn decrypt_vec_into_string<U>( &mut self, iv: T, cipher: &Vec<U>, message: &mut String, ) -> u64
where U: SmallUInt,

Decrypts the data in str with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the decrypted data in String. Read more
Source§

fn decrypt_array<U, const N: usize>( &mut self, iv: T, cipher: &[U; N], message: *mut u8, ) -> u64
where U: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode. Read more
Source§

fn decrypt_array_into_vec<U, V, const N: usize>( &mut self, iv: T, cipher: &[U; N], message: &mut Vec<V>, ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the decrypted data in Vec<V>. Read more
Source§

fn decrypt_array_into_array<U, V, const N: usize, const M: usize>( &mut self, iv: T, cipher: &[U; N], message: &mut [V; M], ) -> u64
where U: SmallUInt, V: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the decrypted data in array [V; M]. Read more
Source§

fn decrypt_array_into_string<U, const N: usize>( &mut self, iv: T, cipher: &[U; N], message: &mut String, ) -> u64
where U: SmallUInt,

Decrypts the data stored in an array [U; N] object with the padding defined according to PKCS #7 in PCBC (Propagation Cipher-Block Chaining) mode, and stores the decrypted data in String. Read more
Source§

impl PRNG_Engine for BigCryptor128

Source§

fn sow_array(&mut self, _: &[u64; 8], original: &[u64; 8])

Provides new seeds for self. Read more
Source§

fn harvest(&mut self, count: u64, message: &[u64; 8]) -> [u64; 8]

Outputs the pseudo-random number array. Read more
Source§

impl SmallCryptor<u128, 16> for BigCryptor128

Source§

fn move_to_next_key(&mut self)

Source§

fn encrypt_unit(&mut self, message: u128) -> u128

Source§

fn decrypt_unit(&mut self, cipher: u128) -> u128

Source§

fn turn_inverse(&mut self)

Source§

fn turn_encryptor(&mut self)

Source§

fn turn_decryptor(&mut self)

Source§

impl<S> Sub<S> for BigCryptor128
where S: SmallCryptor128 + 'static,

Source§

type Output = BigCryptor128

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: S) -> Self::Output

Performs the - operation. Read more
Source§

impl SmallCryptor128 for BigCryptor128

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.