supla-device
Toggle main menu visibility
Loading...
Searching...
No Matches
src
supla
sha256.h
1
/*
2
Copyright (C) AC SOFTWARE SP. Z O.O.
3
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public License
6
as published by the Free Software Foundation; either version 2
7
of the License, or (at your option) any later version.
8
This program is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15
*/
16
17
#ifndef SRC_SUPLA_SHA256_H_
18
#define SRC_SUPLA_SHA256_H_
19
20
#include <stdint.h>
21
22
/*
23
* Simple platform SHA256 wrapper without exposing platform-specific types.
24
*/
25
26
namespace
Supla {
27
28
class
Sha256 {
29
public
:
30
Sha256();
31
~Sha256();
32
void
update(
const
uint8_t *data,
const
int
size);
33
void
digest(uint8_t *output,
int
length = 32);
34
35
protected
:
36
#ifndef SUPLA_TEST
37
void
*ctx;
38
#else
39
uint8_t state[32];
40
uint32_t offset;
41
#endif
42
};
43
44
};
// namespace Supla
45
46
#endif
// SRC_SUPLA_SHA256_H_
Generated by
1.17.0