message: Add blake2b writer.
diff: #include <sstream>
  #include <vector>
  +#include <sodium.h>
  +
  typedef uint256 ChainCode;
  @@ -311,6 +313,45 @@ public:
  }
  };
  +/** A writer stream (for serialization) that computes a 256-bit BLAKE2b hash. */
  +class CBLAKE2bWriter
  +{
  +private:
  + crypto_generichash_blake2b_state state;
  +
  +public:
  + int nType;
  + int nVersion;
  +
  + CBLAKE2bWriter(int nTypeIn, int nVersionIn, const unsigned char* personal) : nType(nTypeIn), nVersion(nVersionIn) {
  + assert(crypto_generichash_blake2b_init_salt_personal(
  + &state,
  + NULL, 0, // No key.
  + 32,
  + NULL, // No salt.
  + personal) == 0);
  + }
  +
  + CBLAKE2bWriter& write(const char *pch, size_t size) {
  + crypto_generichash_blake2b_update(&state, (const unsigned char*)pch, size);
  + return (*this);
  + }
  +
  + // invalidates the object
  + uint256 GetHash() {
  + uint256 result;
  + crypto_generichash_blake2b_final(&state, (unsigned char*)&result, 32);
  + return result;
  + }
  +
  + template<typename T>
  + CBLAKE2bWriter& operator<<(const T& obj) {
  + // Serialize to this stream
  + ::Serialize(*this, obj, nType, nVersion);
  + return (*this);
  + }
  +};
  +
  /** Compute the 256-bit hash of an object's serialization. */
  template <typename T>
  uint256 SerializeHash(const T& obj, int nType = SER_GETHASH, int nVersion = PROTOCOL_VERSION)
  