added sha256 implementation to remove openssl dep.