How can something so fundamentally math-based as Public-key cryptography be so heavyliy patented?
Using math does not disqualify someone from obtaining a patent.
It's just series of steps, a recipe. You do "A", then "B", then "C" as outlined in a patent then you violate a patent and the person has the right to sue you. Whether the steps are outlined involve math or not isn't really relevant.
What is covered and not covered by a patent is very arbitrary and based on court precedent. Any sort of sanctions against "pure math functions" are usually easily worked around by including "as done in a computer" or similar language.
Patents are a very good way for governments to retard progress while rewarding large companies for investing in large numbers of lawyers.