\r
#define NUM_MEGOLM_SESSIONS 10\r
#define NUM_OLM_SESSIONS 10\r
-#define NUM_DEVICES 10\r
+#define NUM_DEVICES 100\r
\r
// Matrix Device\r
\r
void * pickled, int pickledLen,\r
const void * key, int keyLen);\r
\r
+bool\r
+MatrixOlmSessionFrom(\r
+ MatrixOlmSession * session,\r
+ OlmAccount * olmAccount,\r
+ const char * deviceId,\r
+ const char * deviceKey,\r
+ const char * encrypted);\r
+\r
bool\r
MatrixOlmSessionTo(\r
MatrixOlmSession * session,\r
// Matrix Megolm Session\r
\r
typedef struct MatrixMegolmInSession {\r
+ char roomId[ROOM_ID_SIZE];\r
+ char id[MEGOLM_SESSION_ID_SIZE];\r
+ char key[MEGOLM_SESSION_KEY_SIZE];\r
+\r
OlmInboundGroupSession * session;\r
+ char memory[MEGOLM_OUTBOUND_SESSION_MEMORY_SIZE];\r
+\r
} MatrixMegolmInSession;\r
\r
+bool\r
+MatrixMegolmInSessionInit(\r
+ MatrixMegolmInSession * session,\r
+ const char * roomId,\r
+ const char * sessionId,\r
+ const char * sessionKey, int sessionKeyLen);\r
+\r
bool\r
MatrixMegolmInSessionDecrypt(\r
- MatrixMegolmInSession * megolmInSession,\r
- const char * encrypted,\r
+ MatrixMegolmInSession * session,\r
+ const char * encrypted, int encryptedLen,\r
char * outDecrypted, int outDecryptedCap);\r
\r
typedef struct MatrixMegolmOutSession {\r
char roomId[ROOM_ID_SIZE];\r
+ char id[MEGOLM_SESSION_ID_SIZE];\r
+ char key[MEGOLM_SESSION_KEY_SIZE];\r
\r
OlmOutboundGroupSession * session;\r
char memory[MEGOLM_OUTBOUND_SESSION_MEMORY_SIZE];\r
-\r
- char id[MEGOLM_SESSION_ID_SIZE];\r
- char key[MEGOLM_SESSION_KEY_SIZE];\r
} MatrixMegolmOutSession;\r
\r
bool\r
MatrixMegolmOutSession ** outSession);\r
\r
bool\r
-MatrixClientSetMegolmOutSession(\r
+MatrixClientNewMegolmOutSession(\r
MatrixClient * client,\r
const char * roomId,\r
- MatrixMegolmOutSession session);\r
+ MatrixMegolmOutSession ** outSession);\r
\r
bool\r
-MatrixClientInitMegolmOutSession(\r
+MatrixClientGetMegolmInSession(\r
MatrixClient * client,\r
- const char * roomId);\r
+ const char * roomId, int roomIdLen,\r
+ const char * sessionId, int sessionIdLen,\r
+ MatrixMegolmInSession ** outSession);\r
+\r
+bool\r
+MatrixClientNewMegolmInSession(\r
+ MatrixClient * client,\r
+ const char * roomId,\r
+ const char * sessionId,\r
+ const char * sessionKey,\r
+ MatrixMegolmInSession ** outSession);\r
\r
bool\r
MatrixClientRequestMegolmInSession(\r
const char * sessionId,\r
const char * senderKey,\r
const char * userId,\r
- const char * deviceId, // TODO: remove deviceId (query all devices)\r
- MatrixMegolmInSession * outMegolmInSession);\r
+ const char * deviceId); // TODO: remove deviceId (query all devices)\r
\r
bool\r
-MatrixClientGetOlmSession(\r
+MatrixClientGetOlmSessionIn(\r
+ MatrixClient * client,\r
+ const char * userId,\r
+ const char * deviceId,\r
+ const char * encrypted,\r
+ MatrixOlmSession ** outSession);\r
+ \r
+bool\r
+MatrixClientGetOlmSessionOut(\r
MatrixClient * client,\r
const char * userId,\r
const char * deviceId,\r
const char * sIn, int sInLen,\r
char * sOut, int sOutCap);\r
\r
+bool\r
+JsonCanonicalize(\r
+ const char * sIn, int sInLen,\r
+ char * sOut, int sOutCap);\r
+ \r
bool\r
JsonSign(\r
MatrixClient * client,\r