Add sanity check after key generation

Add a sanity check to prevent cosmic rays from flipping a bit in the generated public key, or bugs in the elliptic curve code. This is simply done by signing a (randomized) message, and verifying the result.
@diapolo Please don't suggest that. If you want the data (to be used with `.size()`), use `.data()`. .`c_str()` is if you want a null-terminated string.