title: How to use sha256 in c++ from cryptopp
body: <p>First of all thank you for reading my question.</p>
  <p>I am trying to reproduce what i recieved in python. So bsically I have two numbers and I am trying to make a hash out of them. But with crypto++ library i am a bit confused.</p>
  <p>Basically I dont get how to use the update and calculate part.</p>
  <p>My <code>codes</code> are</p>
  <pre><code>    vHash(uint8_t *X,uint8_t *Y)
  {
      CryptoPP::SHA256 hash;
      byte digest[ CryptoPP::SHA256::DIGESTSIZE ];
  
      hash.CalculateDigest( digest, (byte*) X, 32 );
      hash.CalculateDigest( digest, (byte*) y, 32 );
  
  
      CryptoPP::HexEncoder encoder;
      std::string output;
      encoder.Attach( new CryptoPP::StringSink( output ) );
      encoder.Put( digest, sizeof(digest) );
      encoder.MessageEnd();
  
      std::cout &lt;&lt; output &lt;&lt; std::endl;
  
  }
  </code></pre>
  <p>and from <strong>main function</strong> i am passing</p>
  <pre><code>std::string expTA = &quot;67950298974562277680845951570422977358023181305748156081323854942335052287978&quot;;
  std::string expTB = &quot;43115149028018416730354385099369257625840461867770683759285196743048111210215&quot;;
  
  HexDecoder decoder;
  decoder.Put((byte*)&amp;exp1[0], expTA.size());
  decoder.MessageEnd();
  
  Integer testA;
  testA.Decode(decoder, decoder.MaxRetrievable());
  
  HexDecoder decoder1;
  decoder1.Put((byte*)&amp;exp1[0], expTB.size());
  decoder1.MessageEnd();
  
  Integer testB;
  testB.Decode(decoder1, decoder1.MaxRetrievable());
  
  
  vHash((uint8_t *)&amp;(testA),(uint8_t *)&amp;(testB));
  </code></pre>