abouttreesummaryrefslogcommitdiff
path: root/src/matrix.h
diff options
context:
space:
mode:
authorPatrick2023-06-22 15:56:21 +0200
committerPatrick2023-06-22 15:56:21 +0200
commit9826729ea9eb492b0b25c52b934d9f1283bb70dd (patch)
treef653d79624a782c3fe14ae0fa02f8ea56745865d /src/matrix.h
parent1273c8ea309926e377cbd5cc6dab6740910aa6ff (diff)
downloadmatrix_esp_thesis-9826729ea9eb492b0b25c52b934d9f1283bb70dd.tar.gz
matrix_esp_thesis-9826729ea9eb492b0b25c52b934d9f1283bb70dd.zip
generate identity keys
Diffstat (limited to 'src/matrix.h')
-rw-r--r--src/matrix.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/matrix.h b/src/matrix.h
index 6538e12..60561aa 100644
--- a/src/matrix.h
+++ b/src/matrix.h
@@ -18,10 +18,15 @@
#define REFRESH_TOKEN_SIZE 20
#define MAX_URL_LEN 128
-#define DEVICE_KEY_SIZE 20
+#define OLM_IDENTITY_KEYS_JSON_SIZE 128
+#define DEVICE_KEY_SIZE 44
+#define SIGNING_KEY_SIZE 44
#define KEY_SHARE_EVENT_LEN 1024
+#define OLM_ACCOUNT_MEMORY_SIZE 7528
+#define OLM_ACCOUNT_RANDOM_SIZE 32+32
+
#define OLM_SESSION_MEMORY_SIZE 3352
#define OLM_ENCRYPT_RANDOM_SIZE 32
@@ -97,7 +102,7 @@ MatrixMegolmOutSessionEncrypt(
typedef struct MatrixClient {
OlmAccount * olmAccount;
- OlmSession * olmSession;
+ char olmAccountMemory[OLM_ACCOUNT_MEMORY_SIZE];
MatrixMegolmInSession megolmInSessions[NUM_MEGOLM_SESSIONS];
int numMegolmInSessions;
@@ -110,6 +115,7 @@ typedef struct MatrixClient {
int numDevices;
char deviceKey[DEVICE_KEY_SIZE];
+ char signingKey[DEVICE_KEY_SIZE];
char userId[USER_ID_SIZE];
char server[SERVER_SIZE];
@@ -132,6 +138,11 @@ MatrixClientSetAccessToken(
const char * accessToken);
bool
+MatrixClientSetDeviceId(
+ MatrixClient * client,
+ const char * deviceId);
+
+bool
MatrixClientLoginPassword(
MatrixClient * client,
const char * username,