diff options
-rw-r--r-- | lib/include/net/stpsession.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/include/net/stpsession.h b/lib/include/net/stpsession.h index 1b22e1b..351be26 100644 --- a/lib/include/net/stpsession.h +++ b/lib/include/net/stpsession.h @@ -30,10 +30,18 @@ #ifndef STP_SESSION_H_ #define STP_SESSION_H_ +#include <crypto/aes.h> #include <stdint.h> #include <defs.h> /* + * 2^12 (4096) bytes is a common page size on + * modern systems, this could lead to potential + * optimizations. + */ +#define MESSAGE_SIZE (1 << 12) + +/* * The Session Request is sent from the client to the * server and contains a HOP (hash, options, pubkey) * payload along with some optional padding. If the 'U' @@ -72,4 +80,15 @@ struct session_request { uint8_t pad[8]; } PACKED; +/* + * OSTP Message Frame containing an IV, AES + * GCM tag, payload length and payload + * with encrypted data. + */ +struct msg_frame { + uint8_t iv[AES_IV_SIZE]; + uint8_t tag[AES_GCM_TAG_SIZE]; + uint16_t len; + uint8_t payload[MESSAGE_SIZE]; +}; #endif /* STP_SESSION_H_ */ |