added create_vec
This commit is contained in:
parent
a635c305d3
commit
250fc9a391
@ -1,3 +1,11 @@
|
|||||||
|
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 {
|
||||||
@ -40,5 +48,15 @@ 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
|
||||||
|
}
|
||||||
// Methoden der Klasse
|
// Methoden der Klasse
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user