blob: 1c6f0caf666da179c8e07ec45685864ec59be185 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
// common.h --- shared between client and server
//
// Copyright (c) 2026 Martin Michalec <martin@michalec.dev>
//
// SPDX-License-Identifier: MIT
//
// Commentary:
//
// Code:
#ifndef INCLUDED_COMMON_H
#define INCLUDED_COMMON_H
#include "stdint.h"
#include "crypto.h"
struct packet {
uint8_t size;
uint8_t data[];
};
#define MAX_PACKET_SIZE (256 - sizeof (struct packet))
#define MAX_MESSAGE_LENGTH 80
struct message {
char length;
char data[MAX_MESSAGE_LENGTH];
};
enum key_kind {
KK_NONE,
KK_PSK,
KK_DHKX,
};
bool load_aes_256_key (aes_256_key, const char *filename);
void print_hex (uint8_t *data, size_t size);
#endif // INCLUDED_COMMON_H
// common.h ends here
|