message: add more crypto apis to wasm interface
diff: #include <boost/core/ignore_unused.hpp>
  #include <eosio/chain/wasm_interface_private.hpp>
  #include <fc/exception/exception.hpp>
  +#include <fc/crypto/sha1.hpp>
  #include <fc/io/raw.hpp>
  #include <fc/utf8.hpp>
  @@ -534,14 +535,57 @@ class crypto_api : public context_aware_api {
  public:
  using context_aware_api::context_aware_api;
  + /**
  + * This method can be optimized out during replay as it has
  + * no possible side effects other than "passing".
  + */
  + void assert_recover_key( fc::sha256& digest,
  + array_ptr<char> sig, size_t siglen,
  + array_ptr<char> pub, size_t publen ) {
  + fc::crypto::signature s;
  + fc::crypto::public_key p;
  + datastream<const char*> ds( sig, siglen );
  + datastream<const char*> pubds( pub, publen );
  +
  + fc::raw::unpack(ds, s);
  + fc::raw::unpack(ds, p);
  +
  + auto check = fc::crypto::public_key( s, digest, false );
  + FC_ASSERT( check == p, "Error expected key different than recovered key" );
  + }
  +
  + int recover_key( fc::sha256& digest,
  + array_ptr<char> sig, size_t siglen,
  + array_ptr<char> pub, size_t publen ) {
  + fc::crypto::signature s;
  + datastream<const char*> ds( sig, siglen );
  + datastream<char*> pubds( pub, publen );
  +
  + fc::raw::unpack(ds, s);
  + fc::raw::pack( pubds, fc::crypto::public_key( s, digest, false ) );
  + return pubds.tellp();
  + }
  +
  void assert_sha256(array_ptr<char> data, size_t datalen, const fc::sha256& hash_val) {
  auto result = fc::sha256::hash( data, datalen );
  FC_ASSERT( result == hash_val, "hash miss match" );
  }
  + void sha1(array_ptr<char> data, size_t datalen, fc::sha1& hash_val) {
  + hash_val = fc::sha1::hash( data, datalen );
  + }
  +
  void sha256(array_ptr<char> data, size_t datalen, fc::sha256& hash_val) {
  hash_val = fc::sha256::hash( data, datalen );
  }
  +
  + void sha512(array_ptr<char> data, size_t datalen, fc::sha512& hash_val) {
  + hash_val = fc::sha512::hash( data, datalen );
  + }
  +
  + void ripemd160(array_ptr<char> data, size_t datalen, fc::ripemd160& hash_val) {
  + hash_val = fc::ripemd160::hash( data, datalen );
  + }
  };
  class string_api : public context_aware_api {
  @@ -862,8 +906,13 @@ REGISTER_INTRINSICS(producer_api,
  );
  REGISTER_INTRINSICS(crypto_api,
  + (assert_recover_key, void(int, int, int, int, int))
  + (recover_key, int(int, int, int, int, int))
  (assert_sha256, void(int, int, int))
  + (sha1, void(int, int, int))
  (sha256, void(int, int, int))
  + (sha512, void(int, int, int))
  + (ripemd160, void(int, int, int))
  );
  REGISTER_INTRINSICS(string_api,
  