Advertisement
AnthonyCagliano

Untitled

Oct 8th, 2022
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. const uint8_t* msg, size_t len){
  2. hashlib_Sha256Update(&hmac->sha256_ctx, msg, len);
  3. }
  4.  
  5. void hashlib_HMACSha256Final(hmac_ctx* hmac, uint8_t *output){
  6. uint8_t tmpbuf[32];
  7. hmac_ctx tmp;
  8. memcpy(&tmp, hmac, sizeof(tmp));
  9. hashlib_Sha256Final( &tmp.sha256_ctx, tmpbuf );
  10.  
  11. hashlib_Sha256Init( &tmp.sha256_ctx);
  12. hashlib_Sha256Update( &tmp.sha256_ctx, hmac->opad, 64 );
  13. hashlib_Sha256Update( &tmp.sha256_ctx, tmpbuf, 32);
  14. hashlib_Sha256Final( &tmp.sha256_ctx, output );
  15. }
  16.  
  17. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement