The $8 will vary, and the actual cost function completely depends on the implimentation, its definitely possible to do worse, very likely possible to do better - there was rumors a few years ago that some Riemann surface based math can do it in O(1), but I know nothing about Riemann surfaces so can't judge their veracity.
However, you will do yourself a big favor if you take the time to understand why this is wrong:
> if 2^512 calculations costs you $8 then (2^512)^2 calculations costs you $64
The cost per calculation is some constant C:
Cost(n calcs) = n calcs * C
Therefore,
Cost(n^2 calcs) = n^2 calcs * C
In this example, C = $8 / 2^512 = $2^-509
So Cost(2^512^2) = Cost(2^1024) = 2^1024 * $2^-509 = $2^425