SHA512 and goto cleaning

Thanks for writing this! I've tested it on iOS 6.1 and added a specific SHA512 function.
Also removed that "goto".