Skip to content

miniproto.auth.key_exchange.decrypt_server_dh_answer

miniproto.auth.key_exchange.decrypt_server_dh_answer

Section titled “miniproto.auth.key_exchange.decrypt_server_dh_answer”
decrypt_server_dh_answer(encrypted_answer: bytes, *, new_nonce: int, server_nonce: int) -> ServerDHInnerData

Decrypt, integrity-check, and decode Telegram’s encrypted DH inner payload.

Parameters:

  • encrypted_answer (bytes) – AES-IGE ciphertext returned in server_DH_params_ok.
  • new_nonce (int) – Fresh client nonce used to derive the temporary cipher key.
  • server_nonce (int) – Server nonce used to derive the temporary cipher key.

Raises:

  • ValueError – If ciphertext is too short or no SHA-1-prefixed payload validates.
  • TLCodecError – If the validated payload does not decode as server DH inner data.