HMAC SHA 256 decode/encode issues

Hey all I am trying to figure out why my HAC-SHA-256 encryption and decryption is not matching up from my Arduino code to my .net code:

C# code:

Dim message As String = "Hi There"
Dim expectedHex As String = ""

TextBox1.Text = (Convert.ToString("Ref : ") & expectedHex)

'Test out the HMAC hash method
Dim key As String = "61574d6b157f757d02457573556645750e0341481b127a07476303136c005145436c7b46651c6e4f4f040e1569464a794e534309097258550c17616075060950"
Dim hashHMACHex__1 As String = HashHMACHex(key, message)

TextBox2.Text = (Convert.ToString("HMAC: ") & hashHMACHex__1)

' Test out the SHA hash method
Dim innerKey As String = "61574d6b157f757d02457573556645750e0341481b127a07476303136c005145436c7b46651c6e4f4f040e1569464a794e534309097258550c17616075060950"
Dim outerKey As String = "0b3d27017f151f17682f1f193f0c2f1f64692b227178106d2d096979066a3b2f2906112c0f760425256e647f032c2013243929636318323f667d0b0a1f6c633a"
Dim hashSHAHex__2 As String = HashSHAHex(innerKey, outerKey, message)

TextBox3.Text=(Convert.ToString("SHA : ") & hashSHAHex__2)

Arduino code:

char *myData = "61574d6b157f757d02457573556645750e0341481b127a07476303136c005145436c7b46651c6e4f4f040e1569464a794e534309097258550c17616075060950#(128)";

void printHash(uint8_t* hash) {
  int i;
  for (i=0; i<32; i++) {

uint8_t* hash;
  uint32_t a;
  unsigned long ms;
  Serial.println("Test: RFC4231 4.2");
  ms = micros();
  Sha256.initHmac((uint8_t *)myData,128);
  Sha256.print("Hi There");
  Serial.print(" Hash took : ");
  Serial.print((micros() - ms));
  Serial.println(" micros");

The output from the .net program is this:

HMAC: 2d484b68dae3866fbcbf182071c3bf5e86f40ab6c2f3bc72d69fe0d132bf771e
SHA : 5929bc8b6968e763c7f23090f7d6194c4f1377bd8f6e4b781a5ecdb8e8f91f8f

And the Arduino output:


I’m not sure what innerKey and outterKey is in the .net program. That may be the cause of me not getting the correct values?

Attached is the full code for both the .net program and the arduino sketch. (102 KB)