added error handling to SHA256 routines
added error handling to aes256 routines