SHA1 Ref implementation using TH

It is not a complete pull request, there has to have some more changes. I am still not  sure where to keep `k` and `f` functions.