supla-device
Loading...
Searching...
No Matches
crypto.h
1// SPDX-FileCopyrightText: AC SOFTWARE SP. Z O.O.
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#ifndef SRC_SUPLA_CRYPTO_H_
5#define SRC_SUPLA_CRYPTO_H_
6
7/*
8 * Simple wrapper for cryptographic functions.
9 */
10
11#include <stdint.h>
12#include <stddef.h>
13
14namespace Supla {
15
16namespace Crypto {
17
30bool pbkdf2Sha256(const char *password,
31 const uint8_t *salt, size_t saltLen, uint32_t iterations,
32 uint8_t *derivedKey, size_t derivedKeyLen);
33
34bool hmacSha256Hex(const char *key, size_t keyLen,
35 const char *data, size_t dataLen,
36 char *output, size_t outputLen);
37
38}; // namespace Crypto
39}; // namespace Supla
40
41
42
43#endif // SRC_SUPLA_CRYPTO_H_