First principles calculations on crystalline and liquid iron at Earth's core conditions