[crypto] unify one-time keys usage
Summary:
ENG-6577.
- Remove getOneTimeKeyArray function.
- Updates getOneTimeKeyArray callsites to getOneTimeKeyValues.
- Remove parsing by offsets from createSessionAsInitializer.
- Remove the keyIndex argument - it's not used, Identity returns only one one-time key.
- Rename oneTimeKeys -> oneTimeKey.
- Remove calling getOneTimeKeyValuesFromBlob - we now expect short keys in session creators.
- Move parsing long-format to getOlmSessionInitializationData. The get_olm_session_initialization_data endpoint returns keys in long format, so parse it immediately after receiving and in the rest of the codebase we assume we operate on short format. I decided to not update get_olm_session_initialization_data to return short keys as it will be deprecated soon so we can avoid handling backward compatibility - old clients still expect long format.
Adding all three reviewers as blocking - all worked on code related to session creation and keys, to make sure we are all on the same page about one-time keys usage.
Test Plan:
- Creating notif sesssion on native works (not testing notifs itself, just session creation).
- Creating notif session on web.
- Creating content session on native.
- Keyserver during login uploads short keys.
- All devices as response to RefreshKeyRequest uploads keys in short format.
Reviewers: marcin, varun, tomek
Reviewed By: marcin, varun, tomek
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D10964