loco_protocol/secure/mod.rs
1/*
2 * Created on Sat Sep 09 2023
3 *
4 * Copyright (c) storycraft. Licensed under the MIT Licence.
5 */
6
7use serde::{Deserialize, Serialize};
8
9pub mod client;
10
11#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12pub struct SecurePacket<T: ?Sized> {
13 pub iv: [u8; 16],
14 pub data: T,
15}
16
17#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
18pub struct HandshakePacket<T: ?Sized> {
19 key_type: u32,
20 encrypt_type: u32,
21 encrypted_key: T,
22}