A cryptographic hash function is a function which maps an input of arbitrary length to an output of fixed length. It is used for public key encryption, digital signature, pseudorandom generator message authentication code and so on. It is one of the most important primitives in cryptography. For simplicity, a cryptographic hash function is called a hash function in this article. Hash function should satisfy preimage resistance(PR), second-preimage resistance(2nd PR) and collision resistance(CR). Informally, preimage resistance means that, given an output, it is infeasible to obtain an input which produces the output. Second-preimage resistance means that, given an input, it is infeasible to obtain another input which produces the same output as the given input. Collision resistance means that it is infeasible to obtain two different inputs which produce the same output.