cryptoy 0.4.0

Toy implementations of cryptographic protocols for educational purposes
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use num_bigint::BigUint;

use crate::error::Error;

pub trait Codec {
    fn encode(&mut self, chunk: &[u8]) -> Result<BigUint, Error>;
    fn decode(&self, chunk: &BigUint) -> Result<Vec<u8>, Error>;
}

pub trait RsaKey {
    fn crypt(&self, message: &BigUint) -> Result<BigUint, Error>;
}