aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/c_src/atoms.h
blob: 9ddf0131ac5f0916463d5cd23dfc287a773a8a6d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*
 * %CopyrightBegin%
 *
 * Copyright Ericsson AB 2010-2018. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * %CopyrightEnd%
 */

#ifndef E_ATOMS_H__
#define E_ATOMS_H__ 1

#include <erl_nif.h>
#include "openssl_config.h"

extern ERL_NIF_TERM atom_true;
extern ERL_NIF_TERM atom_false;
extern ERL_NIF_TERM atom_sha;
extern ERL_NIF_TERM atom_error;
extern ERL_NIF_TERM atom_rsa_pkcs1_padding;
extern ERL_NIF_TERM atom_rsa_pkcs1_oaep_padding;
extern ERL_NIF_TERM atom_rsa_no_padding;
extern ERL_NIF_TERM atom_signature_md;
extern ERL_NIF_TERM atom_undefined;

extern ERL_NIF_TERM atom_ok;
extern ERL_NIF_TERM atom_not_prime;
extern ERL_NIF_TERM atom_not_strong_prime;
extern ERL_NIF_TERM atom_unable_to_check_generator;
extern ERL_NIF_TERM atom_not_suitable_generator;
extern ERL_NIF_TERM atom_check_failed;
extern ERL_NIF_TERM atom_unknown;
extern ERL_NIF_TERM atom_none;
extern ERL_NIF_TERM atom_notsup;
extern ERL_NIF_TERM atom_digest;
#ifdef FIPS_SUPPORT
extern ERL_NIF_TERM atom_enabled;
extern ERL_NIF_TERM atom_not_enabled;
#else
extern ERL_NIF_TERM atom_not_supported;
#endif

#if defined(HAVE_EC)
extern ERL_NIF_TERM atom_ec;
extern ERL_NIF_TERM atom_prime_field;
extern ERL_NIF_TERM atom_characteristic_two_field;
extern ERL_NIF_TERM atom_tpbasis;
extern ERL_NIF_TERM atom_ppbasis;
extern ERL_NIF_TERM atom_onbasis;
#endif

extern ERL_NIF_TERM atom_aes_cfb8;
extern ERL_NIF_TERM atom_aes_cfb128;
#ifdef HAVE_GCM
extern ERL_NIF_TERM atom_aes_gcm;
#endif
#ifdef HAVE_CCM
extern ERL_NIF_TERM atom_aes_ccm;
#endif
#ifdef HAVE_CHACHA20_POLY1305
extern ERL_NIF_TERM atom_chacha20_poly1305;
#endif
#ifdef HAVE_ECB_IVEC_BUG
extern ERL_NIF_TERM atom_aes_ecb;
extern ERL_NIF_TERM atom_des_ecb;
extern ERL_NIF_TERM atom_blowfish_ecb;
#endif

extern ERL_NIF_TERM atom_rsa;
extern ERL_NIF_TERM atom_dss;
extern ERL_NIF_TERM atom_ecdsa;

#ifdef HAVE_ED_CURVE_DH
extern ERL_NIF_TERM atom_x25519;
extern ERL_NIF_TERM atom_x448;
#endif

extern ERL_NIF_TERM atom_eddsa;
#ifdef HAVE_EDDSA
extern ERL_NIF_TERM atom_ed25519;
extern ERL_NIF_TERM atom_ed448;
#endif

extern ERL_NIF_TERM atom_rsa_mgf1_md;
extern ERL_NIF_TERM atom_rsa_oaep_label;
extern ERL_NIF_TERM atom_rsa_oaep_md;
extern ERL_NIF_TERM atom_rsa_pad; /* backwards compatibility */
extern ERL_NIF_TERM atom_rsa_padding;
extern ERL_NIF_TERM atom_rsa_pkcs1_pss_padding;
#ifdef HAVE_RSA_SSLV23_PADDING
extern ERL_NIF_TERM atom_rsa_sslv23_padding;
#endif
extern ERL_NIF_TERM atom_rsa_x931_padding;
extern ERL_NIF_TERM atom_rsa_pss_saltlen;
extern ERL_NIF_TERM atom_sha224;
extern ERL_NIF_TERM atom_sha256;
extern ERL_NIF_TERM atom_sha384;
extern ERL_NIF_TERM atom_sha512;
extern ERL_NIF_TERM atom_sha3_224;
extern ERL_NIF_TERM atom_sha3_256;
extern ERL_NIF_TERM atom_sha3_384;
extern ERL_NIF_TERM atom_sha3_512;
extern ERL_NIF_TERM atom_md5;
extern ERL_NIF_TERM atom_ripemd160;

#ifdef HAS_ENGINE_SUPPORT
extern ERL_NIF_TERM atom_bad_engine_method;
extern ERL_NIF_TERM atom_bad_engine_id;
extern ERL_NIF_TERM atom_ctrl_cmd_failed;
extern ERL_NIF_TERM atom_engine_init_failed;
extern ERL_NIF_TERM atom_register_engine_failed;
extern ERL_NIF_TERM atom_add_engine_failed;
extern ERL_NIF_TERM atom_remove_engine_failed;
extern ERL_NIF_TERM atom_engine_method_not_supported;

extern ERL_NIF_TERM atom_engine_method_rsa;
extern ERL_NIF_TERM atom_engine_method_dsa;
extern ERL_NIF_TERM atom_engine_method_dh;
extern ERL_NIF_TERM atom_engine_method_rand;
extern ERL_NIF_TERM atom_engine_method_ecdh;
extern ERL_NIF_TERM atom_engine_method_ecdsa;
extern ERL_NIF_TERM atom_engine_method_ciphers;
extern ERL_NIF_TERM atom_engine_method_digests;
extern ERL_NIF_TERM atom_engine_method_store;
extern ERL_NIF_TERM atom_engine_method_pkey_meths;
extern ERL_NIF_TERM atom_engine_method_pkey_asn1_meths;
extern ERL_NIF_TERM atom_engine_method_ec;

extern ERL_NIF_TERM atom_engine;
extern ERL_NIF_TERM atom_key_id;
extern ERL_NIF_TERM atom_password;
#endif

int init_atoms(ErlNifEnv *env, const ERL_NIF_TERM fips_mode, const ERL_NIF_TERM load_info);

#endif /* E_ATOMS_H__ */