| OpenZWave Library 1.6.0

ZWSecurity.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 //
3 // ZWSecurity.h
4 //
5 // Common Security/Encryption Routines
6 //
7 // Copyright (c) 2015 Justin Hammond <justin@dynam.ac>
8 //
9 // SOFTWARE NOTICE AND LICENSE
10 //
11 // This file is part of OpenZWave.
12 //
13 // OpenZWave is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU Lesser General Public License as published
15 // by the Free Software Foundation, either version 3 of the License,
16 // or (at your option) any later version.
17 //
18 // OpenZWave is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU Lesser General Public License for more details.
22 //
23 // You should have received a copy of the GNU Lesser General Public License
24 // along with OpenZWave. If not, see <http://www.gnu.org/licenses/>.
25 //
26 //-----------------------------------------------------------------------------
27
28 #ifndef SECURITY_H_
29 #define SECURITY_H_
30
31
32 #include <cstdio>
33 #include <string>
34 #include <string.h>
35 #include "Defs.h"
36 #include "Driver.h"
37
38 namespace OpenZWave
39 {
40 bool EncyrptBuffer( uint8 *m_buffer, uint8 m_length, Driver *driver, uint8 const _sendingNode, uint8 const _receivingNode, uint8 const m_nonce[8], uint8* e_buffer);
41 bool DecryptBuffer( uint8 *e_buffer, uint8 e_length, Driver *driver, uint8 const _sendingNode, uint8 const _receivingNode, uint8 const m_nonce[8], uint8* m_buffer );
42 bool GenerateAuthentication( uint8 const* _data, uint32 const _length, Driver *driver, uint8 const _sendingNode, uint8 const _receivingNode, uint8 *iv, uint8* _authentication);
43 enum SecurityStrategy
44 {
45 SecurityStrategy_Essential = 0,
46 SecurityStrategy_Supported
47 };
48 SecurityStrategy ShouldSecureCommandClass(uint8 CommandClass);
49
50 }
51
52
53 #endif /* SECURITY_H_ */
uint32
unsigned int uint32
Definition: Defs.h:95
Driver.h
uint8
unsigned char uint8
Definition: Defs.h:89
OpenZWave::DecryptBuffer
bool DecryptBuffer(uint8 *e_buffer, uint8 e_length, Driver *driver, uint8 const _sendingNode, uint8 const _receivingNode, uint8 const m_nonce[8], uint8 *m_buffer)
Definition: ZWSecurity.cpp:271
OpenZWave::ShouldSecureCommandClass
SecurityStrategy ShouldSecureCommandClass(uint8 CommandClass)
Definition: ZWSecurity.cpp:357
OpenZWave::SecurityStrategy
SecurityStrategy
Definition: ZWSecurity.h:44
OpenZWave::SecurityStrategy_Essential
@ SecurityStrategy_Essential
Definition: ZWSecurity.h:45
OpenZWave::EncyrptBuffer
bool EncyrptBuffer(uint8 *m_buffer, uint8 m_length, Driver *driver, uint8 const _sendingNode, uint8 const _receivingNode, uint8 const m_nonce[8], uint8 *e_buffer)
Definition: ZWSecurity.cpp:132
OpenZWave::GenerateAuthentication
bool GenerateAuthentication(uint8 const *_data, uint32 const _length, Driver *driver, uint8 const _sendingNode, uint8 const _receivingNode, uint8 *iv, uint8 *_authentication)
Definition: ZWSecurity.cpp:48
OpenZWave::SecurityStrategy_Supported
@ SecurityStrategy_Supported
Definition: ZWSecurity.h:46
Defs.h
OpenZWave
Definition: Bitfield.h:35