]> gitweb.ps.run Git - matrix_esp_thesis/blobdiff - src/matrix.h
generate identity keys
[matrix_esp_thesis] / src / matrix.h
index 6538e12d7fa6f16a464d388e11fa41edc18dc44f..60561aa04087d4c0c81d5881a9a235e216120e18 100644 (file)
 #define REFRESH_TOKEN_SIZE 20\r
 #define MAX_URL_LEN 128\r
 \r
 #define REFRESH_TOKEN_SIZE 20\r
 #define MAX_URL_LEN 128\r
 \r
-#define DEVICE_KEY_SIZE 20\r
+#define OLM_IDENTITY_KEYS_JSON_SIZE 128\r
+#define DEVICE_KEY_SIZE 44\r
+#define SIGNING_KEY_SIZE 44\r
 \r
 #define KEY_SHARE_EVENT_LEN 1024\r
 \r
 \r
 #define KEY_SHARE_EVENT_LEN 1024\r
 \r
+#define OLM_ACCOUNT_MEMORY_SIZE 7528\r
+#define OLM_ACCOUNT_RANDOM_SIZE 32+32\r
+\r
 #define OLM_SESSION_MEMORY_SIZE 3352\r
 #define OLM_ENCRYPT_RANDOM_SIZE 32\r
 \r
 #define OLM_SESSION_MEMORY_SIZE 3352\r
 #define OLM_ENCRYPT_RANDOM_SIZE 32\r
 \r
@@ -97,7 +102,7 @@ MatrixMegolmOutSessionEncrypt(
 \r
 typedef struct MatrixClient {\r
     OlmAccount * olmAccount;\r
 \r
 typedef struct MatrixClient {\r
     OlmAccount * olmAccount;\r
-    OlmSession * olmSession;\r
+    char olmAccountMemory[OLM_ACCOUNT_MEMORY_SIZE];\r
 \r
     MatrixMegolmInSession megolmInSessions[NUM_MEGOLM_SESSIONS];\r
     int numMegolmInSessions;\r
 \r
     MatrixMegolmInSession megolmInSessions[NUM_MEGOLM_SESSIONS];\r
     int numMegolmInSessions;\r
@@ -110,6 +115,7 @@ typedef struct MatrixClient {
     int numDevices;\r
     \r
     char deviceKey[DEVICE_KEY_SIZE];\r
     int numDevices;\r
     \r
     char deviceKey[DEVICE_KEY_SIZE];\r
+    char signingKey[DEVICE_KEY_SIZE];\r
 \r
     char userId[USER_ID_SIZE];\r
     char server[SERVER_SIZE];\r
 \r
     char userId[USER_ID_SIZE];\r
     char server[SERVER_SIZE];\r
@@ -131,6 +137,11 @@ MatrixClientSetAccessToken(
     MatrixClient * client,\r
     const char * accessToken);\r
 \r
     MatrixClient * client,\r
     const char * accessToken);\r
 \r
+bool\r
+MatrixClientSetDeviceId(\r
+    MatrixClient * client,\r
+    const char * deviceId);\r
+\r
 bool\r
 MatrixClientLoginPassword(\r
     MatrixClient * client,\r
 bool\r
 MatrixClientLoginPassword(\r
     MatrixClient * client,\r