+ // init olm account\r
+ client->olmAccount = olm_account(client->olmAccountMemory);\r
+\r
+ static uint8_t random[OLM_ACCOUNT_RANDOM_SIZE];\r
+ Randomize(random, OLM_ACCOUNT_RANDOM_SIZE);\r
+\r
+ size_t res;\r
+ res = olm_create_account(\r
+ client->olmAccount,\r
+ random,\r
+ OLM_ACCOUNT_RANDOM_SIZE);\r
+\r
+ // set device key\r
+ static char deviceKeysJson[OLM_IDENTITY_KEYS_JSON_SIZE];\r
+ res =\r
+ olm_account_identity_keys(\r
+ client->olmAccount,\r
+ deviceKeysJson,\r
+ OLM_IDENTITY_KEYS_JSON_SIZE);\r
+\r
+ mjson_get_string(deviceKeysJson, res,\r
+ "$.curve25519",\r
+ client->deviceKey, DEVICE_KEY_SIZE);\r
+ mjson_get_string(deviceKeysJson, res,\r
+ "$.ed25519",\r
+ client->signingKey, SIGNING_KEY_SIZE);\r
+\r