Pohlig–Hellman algorithm