Refactored message signing/verifying