Advertisement
AnthonyCagliano

Untitled

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