wrap errors in sm if decryption was successfull
raise a SW error on failed decryption