Compare commits

..

No commits in common. "8ad180138ebb98bca225198994da601ecf5580ac" and "d06aead691705d7cd3cf95d6f72ad0012b9c01e4" have entirely different histories.

View File

@ -1,11 +1,3 @@
use crypto_box::{
aead::{Aead, AeadCore, OsRng},
PublicKey, SalsaBox, SecretKey,
};
use std::io::Write;
use std::net::TcpStream;
const KEYLENGTH: u8 = 32; const KEYLENGTH: u8 = 32;
pub enum PayloadType { pub enum PayloadType {
@ -48,16 +40,6 @@ impl Message {
msg.payload[0] = msg_type as u8; msg.payload[0] = msg_type as u8;
msg msg
} }
fn creat_vec(ciphertext: Vec<u8>) -> Vec<u8> {
let mut vec: Vec<u8> = vec![0; 14 + ciphertext.len()];
for i in 14..(14 + ciphertext.len()){
vec[i] = ciphertext[i - 14];
}
vec
}
fn recive(input: Vec<u8>) -> Message { fn recive(input: Vec<u8>) -> Message {
let byte1 = input.get(0).expect("Fail to Read Byte 1"); let byte1 = input.get(0).expect("Fail to Read Byte 1");