How to resolve this: invalid conversion from 'const char*' to 'const uint8_t*
<p>I installed this SHA library: <a href="https://github.com/Cathedrow/Cryptosuite" rel="nofollow">https://github.com/Cathedrow/Cryptosuite</a>. I want to implement HMAC256 using Arduino IDE 1.6.7 installed on Win. 10 and the controller is ATMEGA328. </p>

<p>I copied the example given in their webpage. I am still new and want to test and try. I wrote this code in Arduino IDE. </p>

<pre><code>#include "sha256.h"

void setup() {
    // put your setup code here, to run once:
    uint8_t *hash;
    //static const char hash[450]={};
    //const char *hash; hash={};
    Sha256.initHmac("hash key",8); // key, and length of key in bytes
    Sha256.print("This is a message to hash");
    hash = Sha256.resultHmac();
    //Serial.print(hash,HEX);
}

void loop() {
    // put your main code here, to run repeatedly:
}
</code></pre>

<p>I got this error:</p>

<blockquote>
  <p>invalid conversion from 'const char*' to 'const uint8_t* {aka const
  unsigned char*}' [-fpermissive]</p>
</blockquote>

<p>I do not know why this happens. The example is primitive taken as is from the library site. Can you help?</p>

<p><strong>EDIT:</strong>
I tried to change the line from:</p>

<pre><code>Sha256.initHmac((const uint8_t*)"hash key",8);
</code></pre>

<p>to:</p>

<pre><code>Sha256.initHmac((const uint8_t*)"hash key",8);
</code></pre>

<p>But again, the compilation fails. It says:</p>

<blockquote>
  <p>Arduino: 1.6.7 (Windows 10), Board: "Arduino/Genuino Uno"</p>
  
  <p>In file included from C:\Program Files
  (x86)\Arduino\hardware\arduino\avr\cores\arduino/arduino.h:28:0,</p>

<pre><code>             from C:\Users\e\Documents\Arduino\libraries\Sha\sha1_config.h:13,

             from C:\Users\e\Documents\Arduino\libraries\Sha\sha1.h:4,

             from C:\Users\e\Documents\Arduino\libraries\Sha\sha1.cpp:1:
</code></pre>
  
  <p>C:\Users\e\Documents\Arduino\libraries\Sha\sha1.cpp:8:25: error:
  variable 'sha1InitState' must be const in order to be put into
  read-only section by means of '<strong>attribute</strong>((progmem))'</p>
  
  <p>uint8_t sha1InitState[] PROGMEM = {</p>

<pre><code>                     ^
</code></pre>
  
  <p>exit status 1 Error compiling.</p>
  
  <p>This report would have more information with   "Show verbose output
  during compilation"   enabled in File > Preferences.</p>
</blockquote>