Expand description
MTProto authentication key generation (DH handshake steps).
Structs§
- DhParams
ForRetry - Pre-processed server DH parameters retained so that step 3 can be
repeated on
dh_gen_retrywithout having to re-decrypt the server response. - Finished
- The final output of a successful auth key handshake.
- Step1
- State after step 1.
- Step2
- State after step 2.
- Step3
- State after step 3.
Enums§
- Error
- Errors that can occur during auth key generation.
- Finish
Result - Result of
finisheither the handshake is done, or the server wants us to retry step 3 with theauth_key_aux_hashasretry_id.
Functions§
- finish
- Finalise the handshake.
- key_
for_ fingerprint - RSA key by server fingerprint. Includes both production and test DC keys.
- retry_
step3 - Re-run the client DH params generation after a
dh_gen_retryresponse. Feed thedh_params,nonce,server_nonce,new_noncefromFinishResult::Retryand theretry_id(=auth_key_aux_hash). - step1
- Generate a
req_pq_multirequest. Returns the request + opaque state. - step2
- Process
ResPQand generatereq_DH_params. - step3
- Process
ServerDhParamsinto a reusableDhParamsForRetry+ send the firstset_client_DH_paramsrequest. - step2_
temp - Like
step2but requests a temporary auth key (PFS). Uses p_q_inner_data_temp_dc instead of p_q_inner_data_dc. Caller must bind the resulting key via auth.bindTempAuthKey before any RPCs.