implement hash functions
basically finished. need for test
Implementation of both two protocols are finished.