simplifying sha512 code
trying to avoid leaks. no more events used.