Z-Wave Protocol Controller Reference
zwave_s2_keystore_int.h
Go to the documentation of this file.
1/******************************************************************************
2 * # License
3 * <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
4 ******************************************************************************
5 * The licensor of this software is Silicon Laboratories Inc. Your use of this
6 * software is governed by the terms of Silicon Labs Master Software License
7 * Agreement (MSLA) available at
8 * www.silabs.com/about-us/legal/master-software-license-agreement. This
9 * software is distributed to you in Source Code format and is governed by the
10 * sections of the MSLA applicable to Source Code.
11 *
12 *****************************************************************************/
13
22#ifndef ZWAVE_S2_KEYSTORE_INT_H
23#define ZWAVE_S2_KEYSTORE_INT_H
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29#include <stdint.h>
30#include "zwave_s2_keystore.h"
31#include "zwapi_protocol_mem.h"
32
33// NVM magic value, this is the same a ZGW
34#define NVM_MAGIC 0xa11d1900
35typedef struct nvm_config {
36 uint32_t magic;
37 uint8_t filler1[41];
38 uint8_t security_netkey[16];
39 uint8_t filler2[23];
40 /*S2 Network keys */
41 uint8_t assigned_keys; //Bitmask of keys which are assigned
42 uint8_t security2_key[3][16];
43 uint8_t ecdh_priv_key[32];
44 uint8_t security2_lr_key[2][16];
45} __attribute__((__packed__)) nvm_config_t;
46
47#define nvm_config_get(par_name, dst) \
48 zwapi_memory_get_buffer(offsetof(struct nvm_config, par_name), \
49 (uint8_t*)dst, \
50 sizeof(((struct nvm_config *)0)->par_name))
51#define nvm_config_set(par_name, src) \
52 zwapi_memory_put_buffer(offsetof(struct nvm_config, par_name), \
53 (uint8_t*)src, \
54 sizeof(((struct nvm_config *)0)->par_name), \
55 NULL)
56
64
70
78
79
80#ifdef __cplusplus
81}
82#endif
83
84#endif //ZWAVE_S2_KEYSTORE_INT_H
void zwave_s2_keystore_set_ecdh_key_mode(zwave_s2_keystore_ecdh_key_mode_t mode)
Set ecdh key mode for use in zwave_s2_keystore.
Definition: zwave_s2_keystore.c:329
struct nvm_config __attribute__((__packed__)) nvm_config_t
void zwave_s2_create_new_dynamic_ecdh_key()
Definition: zwave_s2_keystore.c:348
void zwave_s2_keystore_init()
Initialize the keystore.
Definition: zwave_s2_keystore.c:377
zwave_s2_keystore_ecdh_key_mode_t
ECDH key mode types.
Definition: zwave_s2_keystore.h:38
Definition: zwave_s2_keystore_int.h:35
uint32_t magic
Definition: zwave_s2_keystore_int.h:36
uint8_t assigned_keys
Definition: zwave_s2_keystore_int.h:41
uint8_t ecdh_priv_key[32]
Definition: zwave_s2_keystore_int.h:43
uint8_t security2_key[3][16]
Definition: zwave_s2_keystore_int.h:42
uint8_t filler2[23]
Definition: zwave_s2_keystore_int.h:39
uint8_t security2_lr_key[2][16]
Definition: zwave_s2_keystore_int.h:44
uint8_t security_netkey[16]
Definition: zwave_s2_keystore_int.h:38
uint8_t filler1[41]
Definition: zwave_s2_keystore_int.h:37
Z-Wave API for module memory manipulation.