Make signing fail if a too small buffer is passed.

Bug discovered by Sergio Demian Lerner.
Merge pull request #169

603c33b Make signing fail if a too small buffer is passed. (Pieter Wuille)
[API BREAK] Use a nonce-generation function instead of a nonce
Implement SHA256 / HMAC-SHA256 / RFC6979.
Use rfc6979 as default nonce generation function