...but aside from Eritrea, Ethiopia, Iran, Iraq, Marshall Islands, Nauru, Palau, Somalia, and South Sudan everyone is part of one or more (usually more) international treaties that cover copyright such as the Berne Convention or TRIPS or UCC, so you should expect in most places that most people on HN are likely to ever deal with have copyright law that isn't too different for the most common situations.
If that function always returned, say, the AACS key then it would likely be violating copyright in the US. Regardless of whether it was the result of a computation or statically defined.