5MP Motion Camera
1.1.1.1
A waterproof, low power, battery operated, motion activated, 5 mega-pixel, WiFi camera.
sha1.h
Go to the documentation of this file.
1
#ifndef Sha1_h
2
#define Sha1_h
3
4
#include <inttypes.h>
5
#include "Print.h"
6
7
#define HASH_LENGTH 20
8
#define BLOCK_LENGTH 64
9
10
union
_buffer
{
11
uint8_t
b
[
BLOCK_LENGTH
];
12
uint32_t
w
[
BLOCK_LENGTH
/4];
13
};
14
union
_state
{
15
uint8_t
b
[
HASH_LENGTH
];
16
uint32_t
w
[
HASH_LENGTH
/4];
17
};
18
19
class
Sha1Class
:
public
Print
20
{
21
public
:
22
void
init(
void
);
23
void
initHmac(
const
uint8_t* secret,
int
secretLength);
24
uint8_t* result(
void
);
25
uint8_t* resultHmac(
void
);
26
virtual
size_t
write(uint8_t);
27
using
Print::write;
28
private
:
29
void
pad();
30
void
addUncounted(uint8_t data);
31
void
hashBlock();
32
uint32_t rol32(uint32_t number, uint8_t bits);
33
_buffer
buffer
;
34
uint8_t
bufferOffset
;
35
_state
state
;
36
uint32_t
byteCount
;
37
uint8_t keyBuffer[
BLOCK_LENGTH
];
38
uint8_t innerHash[
HASH_LENGTH
];
39
40
};
41
extern
Sha1Class
Sha1
;
42
43
#endif
Sha1
Sha1Class Sha1
Definition:
sha1.cpp:153
HASH_LENGTH
#define HASH_LENGTH
Definition:
sha1.h:7
Sha1Class
Definition:
sha1.h:19
Sha1Class::bufferOffset
uint8_t bufferOffset
Definition:
sha1.h:34
Sha1Class::byteCount
uint32_t byteCount
Definition:
sha1.h:36
_buffer::b
uint8_t b[BLOCK_LENGTH]
Definition:
sha1.h:11
Sha1Class::buffer
_buffer buffer
Definition:
sha1.h:33
_state
Definition:
sha1.h:14
BLOCK_LENGTH
#define BLOCK_LENGTH
Definition:
sha1.h:8
Sha1Class::state
_state state
Definition:
sha1.h:35
_buffer
Definition:
sha1.h:10
_buffer::w
uint32_t w[BLOCK_LENGTH/4]
Definition:
sha1.h:12
lib
arduino-websocket-client
sha1.h
Generated by
1.8.13