| 55 | } |
| 56 | |
| 57 | bool sha256hmac(const char *str, unsigned char out_hash[32], const char *secret, int secret_len) { |
| 58 | if (!str) return false; |
| 59 | |
| 60 | // SHA256_DIGEST_LENGTH is 32 |
| 61 | HMAC(EVP_sha256(), secret, secret_len, (unsigned char *)str, strlen(str), out_hash, NULL); |
| 62 | return true; |
| 63 | } |
| 64 | |
| 65 | bool sha256hmac_hex(const char *str, char out_hash_hex[65], const char *secret, int secret_len) { |
| 66 | if (!str) return false; |
no outgoing calls
no test coverage detected