I was reading the article about the SHA1 hashing function (I know it is not secure anymore) and I've found a pseudocode implementation on Wikipedia.
I can see that there are a lot of mathematical operations, and what I wanted to know is the justification of each step in this hashing function. I want to know, for example, how each part increases the security of the function. How do we know that these operations are gonna produce a drastic change in the output when a minimum change is made in the input?
Is there a book about the theory behind hashing function? Maybe a book that explains mathematical functions or operations that maps the input to a very large output space such that is very hard to do the inverse way.
Is there a very simple hashing function that can be studied and that are examples of attacks? Is there some paper that explains the evolution of these functions and the justification for some math operations in this?