wip messages creation & handling

This commit is contained in:
TIBERGHIEN corentin
2026-01-09 20:09:39 +01:00
parent 9fc33804d0
commit 489669b93d
7 changed files with 114 additions and 77 deletions

View File

@@ -39,7 +39,9 @@ pub fn construct_message(
match msgtype {
HELLO | HELLOREPLY => {
// length
message.extend_from_slice(&(EXTENSIONS + payload.len()).to_be_bytes());
let a = payload.len() as u16;
println!("payload size:{}", a);
message.extend_from_slice(&a.to_be_bytes());
message.extend_from_slice(&payload);
let signature = sign_message(crypto_pair, &message);
message.extend_from_slice(&signature);