Skip to content

miniproto_native::crypto::pq_factorize

  • Crate: miniproto_native
  • Rust visibility: restricted
  • Source: rust/miniproto/src/crypto.rs
  • Python exposure: miniproto._native.pq_factorize (confirmed from adjacent PyO3 attributes)
fn pq_factorize(py: _, pq: u64) -> _
  • py: The acquired GIL token used to detach the factorization search.
  • pq: Composite MTProto handshake value to split into ordered factors.
fn pq_factorize(py: Python<'_>, pq: u64) -> PyResult<(u64, u64)>

Defined in rust/miniproto/src/crypto.rs:468-470

Factorizes Python pq_factorize(pq) into ordered nontrivial u64 factors.

Returns ValueError for non-composite values and runs the potentially expensive search with the GIL released.

  • py: The acquired GIL token used to detach the factorization search.
  • pq: Composite MTProto handshake value to split into ordered factors.