Check the input type for both sign and verify. This avoids the issue whe...

...re something invalid is passed, OpenSSL.malloc fails and we end up with UnboundLocalError.