ndn-lite
ndn-lite
security
ndn-lite-sec-config.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2018 Zhiyi Zhang, Edward Lu
3
*
4
* This file is subject to the terms and conditions of the GNU Lesser
5
* General Public License v3.0. See the file LICENSE in the top level
6
* directory for more details.
7
*/
8
9
#ifndef NDN_LITE_SEC_CONFIG_H
10
#define NDN_LITE_SEC_CONFIG_H
11
12
#ifdef __cplusplus
13
extern
"C"
{
14
#endif
15
35
#if defined NDN_LITE_SEC_BACKEND_DEFAULT
36
37
// SHA256 backend
38
#ifndef NDN_LITE_SEC_BACKEND_SHA256_DEFAULT
39
#define NDN_LITE_SEC_BACKEND_SHA256_DEFAULT
40
#endif
41
// RNG backend
42
#ifndef NDN_LITE_SEC_BACKEND_RANDOM_DEFAULT
43
#define NDN_LITE_SEC_BACKEND_RANDOM_DEFAULT
44
#endif
45
// AES backend
46
#ifndef NDN_LITE_SEC_BACKEND_AES_DEFAULT
47
#define NDN_LITE_SEC_BACKEND_AES_DEFAULT
48
#endif
49
// ECC backend
50
#ifndef NDN_LITE_SEC_BACKEND_ECC_DEFAULT
51
#define NDN_LITE_SEC_BACKEND_ECC_DEFAULT
52
#endif
53
// HMAC backend
54
#ifndef NDN_LITE_SEC_BACKEND_HMAC_DEFAULT
55
#define NDN_LITE_SEC_BACKEND_HMAC_DEFAULT
56
#endif
57
62
#elif defined NDN_LITE_SEC_BACKEND_NRF_CRYPTO
63
64
// SHA256 backend
65
#ifndef NDN_LITE_SEC_BACKEND_SHA256_DEFAULT
66
#define NDN_LITE_SEC_BACKEND_SHA256_DEFAULT
67
#endif
68
// RNG backend
69
#ifndef NDN_LITE_SEC_BACKEND_RANDOM_NRF_CRYPTO
70
#define NDN_LITE_SEC_BACKEND_RANDOM_NRF_CRYPTO
71
#endif
72
// AES backend
73
#ifndef NDN_LITE_SEC_BACKEND_AES_DEFAULT
74
#define NDN_LITE_SEC_BACKEND_AES_DEFAULT
75
#endif
76
// ECC backend
77
#ifndef NDN_LITE_SEC_BACKEND_ECC_DEFAULT
78
#define NDN_LITE_SEC_BACKEND_ECC_DEFAULT
79
#endif
80
// HMAC backend
81
#ifndef NDN_LITE_SEC_BACKEND_HMAC_DEFAULT
82
#define NDN_LITE_SEC_BACKEND_HMAC_DEFAULT
83
#endif
84
85
89
#else
90
91
#define NDN_LITE_SEC_BACKEND_DEFAULT
92
// SHA256 backend
93
#ifndef NDN_LITE_SEC_BACKEND_SHA256_DEFAULT
94
#define NDN_LITE_SEC_BACKEND_SHA256_DEFAULT
95
#endif
96
// RNG backend
97
#ifndef NDN_LITE_SEC_BACKEND_RANDOM_DEFAULT
98
#define NDN_LITE_SEC_BACKEND_RANDOM_DEFAULT
99
#endif
100
// AES backend
101
#ifndef NDN_LITE_SEC_BACKEND_AES_DEFAULT
102
#define NDN_LITE_SEC_BACKEND_AES_DEFAULT
103
#endif
104
// ECC backend
105
#ifndef NDN_LITE_SEC_BACKEND_ECC_DEFAULT
106
#define NDN_LITE_SEC_BACKEND_ECC_DEFAULT
107
#endif
108
// HMAC backend
109
#ifndef NDN_LITE_SEC_BACKEND_HMAC_DEFAULT
110
#define NDN_LITE_SEC_BACKEND_HMAC_DEFAULT
111
#endif
112
113
#endif
/* NDN_LITE_SEC_BACKEND_DEFAULT || NDN_LITE_SEC_BACKEND_NRF_CRYPTO */
114
115
119
// SHA256 backend
120
#if defined NDN_LITE_SEC_BACKEND_SHA256_DEFAULT
121
#include "
detail/default-backend/ndn-lite-default-sha-impl.h
"
122
#endif // NDN_LITE_SEC_BACKEND_SHA256_DEFAULT
123
124
// RNG backend
125
#if defined NDN_LITE_SEC_BACKEND_RANDOM_DEFAULT
126
// do nothing
127
#endif // NDN_LITE_SEC_BACKEND_RANDOM_DEFAULT
128
129
// AES backend
130
#if defined NDN_LITE_SEC_BACKEND_AES_DEFAULT
131
#include "
detail/default-backend/ndn-lite-default-aes-impl.h
"
132
#endif // NDN_LITE_SEC_BACKEND_AES_DEFAULT
133
134
// ECC backend
135
#if defined NDN_LITE_SEC_BACKEND_ECC_DEFAULT
136
#include "
detail/default-backend/ndn-lite-default-ecc-impl.h
"
137
#endif // NDN_LITE_SEC_BACKEND_ECC_DEFAULT
138
139
// HMAC backend
140
#if defined NDN_LITE_SEC_BACKEND_HMAC_DEFAULT
141
#include "
detail/default-backend/ndn-lite-default-hmac-impl.h
"
142
#endif
143
144
void
145
register_platform_security_init
(
void
(*init)(
void
));
146
147
void
148
ndn_security_init
(
void
);
149
150
#ifdef __cplusplus
151
};
152
#endif
153
154
#endif // NDN_LITE_SEC_CONFIG_H
ndn-lite-default-ecc-impl.h
ndn-lite-default-sha-impl.h
ndn_security_init
void ndn_security_init(void)
Definition:
ndn-lite-sec-config.c:19
register_platform_security_init
void register_platform_security_init(void(*init)(void))
Including corresponding header files.
Definition:
ndn-lite-sec-config.c:14
ndn-lite-default-aes-impl.h
ndn-lite-default-hmac-impl.h
Generated by
1.8.15