X-Git-Url: https://gitweb.ps.run/matrix_esp_thesis/blobdiff_plain/464bfb1912d0806143386f61c33dd45fbafc38e8..c7aba5979c820958aa08947903afb47ace496a16:/src/matrix.h diff --git a/src/matrix.h b/src/matrix.h index 91ed208..3614b6a 100644 --- a/src/matrix.h +++ b/src/matrix.h @@ -11,6 +11,7 @@ #define USER_ID_SIZE 64 +#define ROOM_ID_SIZE 128 #define SERVER_SIZE 20 #define ACCESS_TOKEN_SIZE 40 #define DEVICE_ID_SIZE 20 @@ -102,7 +103,7 @@ typedef struct MatrixMegolmInSession { } MatrixMegolmInSession; typedef struct MatrixMegolmOutSession { - const char * roomId; + char roomId[ROOM_ID_SIZE]; OlmOutboundGroupSession * session; char memory[MEGOLM_OUTBOUND_SESSION_MEMORY_SIZE]; @@ -115,13 +116,25 @@ bool MatrixMegolmOutSessionInit( MatrixMegolmOutSession * session, const char * roomId); - + bool MatrixMegolmOutSessionEncrypt( MatrixMegolmOutSession * session, const char * plaintext, char * outBuffer, int outBufferCap); +bool +MatrixMegolmOutSessionSave( + MatrixMegolmOutSession * session, + const char * filename, + const char * key); + +bool +MatrixMegolmOutSessionLoad( + MatrixMegolmOutSession * session, + const char * filename, + const char * key); + // Matrix Client @@ -252,6 +265,11 @@ MatrixClientSetMegolmOutSession( const char * roomId, MatrixMegolmOutSession session); +bool +MatrixClientInitMegolmOutSession( + MatrixClient * client, + const char * roomId); + bool MatrixClientGetOlmSession( MatrixClient * client,