Skip to content

miniproto.auth.key_exchange.factorize_pq

factorize_pq(pq: int) -> tuple[int, int]

Factor Telegram’s small composite pq and return its factors in ascending order.

Parameters:

  • pq (int) – Positive composite challenge decoded from Telegram’s resPQ response.

Raises:

  • ValueError – If the native factorizer returns invalid factors.