blob: 6d70435ec95d73a1b08c94f722a15215a8ff4a62 [file] [log] [blame]
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <stdint.h>
#include <stdlib.h>
#include "sha256.h"
#ifdef GOOGLE3_BLAZE_BUILD // Redefine functions which collide with other third-party libs
#define hmac_sha256 systemd_hmac_sha256
#endif // GOOGLE3_BLAZE_BUILD
/* Unoptimized implementation based on FIPS 198. 'res' has to be allocated by
* the caller. Prefer external OpenSSL functions, and use this only when
* linking to OpenSSL is not desirable (eg: libsystemd.so). */
void hmac_sha256(const void *key, size_t key_size, const void *input, size_t input_size, uint8_t res[static SHA256_DIGEST_SIZE]);