Skip to main content

wiener

Function wiener 

Source
pub fn wiener(e: &BigInt, n: &BigInt) -> Option<(BigInt, BigInt)>
Expand description

Wiener’s attack: catches a small private exponent d (d < ⅓ N^{1/4}). The convergents of the continued fraction of e/N include k/d; from d we recover φ(N), then p, q as roots of x² − (N − φ + 1)x + N. A small d is a compressed private key — and this reuses the very continued-fraction / rational-reconstruction machinery the 2-adic FCSR rung was built on.