Implementing DoS protection for password hash calculation.