Debian Codegraph @

lib/hcrypto/evp-pkcs11.h

raw
1 /*
2 * Copyright (c) 2015, Secure Endpoints Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * - Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
15 * distribution.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28 * OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31 /* $Id$ */
32
33 #ifndef HEIM_EVP_PKCS11_H
34 #define HEIM_EVP_PKCS11_H 1
35
36 /* symbol renaming */
37
38 #define EVP_pkcs11_md4() hc_EVP_pkcs11_md4()
39 #define EVP_pkcs11_md5() hc_EVP_pkcs11_md5()
40 #define EVP_pkcs11_sha1() hc_EVP_pkcs11_sha1()
41 #define EVP_pkcs11_sha256() hc_EVP_pkcs11_sha256()
42 #define EVP_pkcs11_sha384() hc_EVP_pkcs11_sha384()
43 #define EVP_pkcs11_sha512() hc_EVP_pkcs11_sha512()
44 #define EVP_pkcs11_des_cbc() hc_EVP_pkcs11_des_cbc()
45 #define EVP_pkcs11_des_ede3_cbc() hc_EVP_pkcs11_des_ede3_cbc()
46 #define EVP_pkcs11_aes_128_cbc() hc_EVP_pkcs11_aes_128_cbc()
47 #define EVP_pkcs11_aes_192_cbc() hc_EVP_pkcs11_aes_192_cbc()
48 #define EVP_pkcs11_aes_256_cbc() hc_EVP_pkcs11_aes_256_cbc()
49 #define EVP_pkcs11_aes_128_cfb8() hc_EVP_pkcs11_aes_128_cfb8()
50 #define EVP_pkcs11_aes_192_cfb8() hc_EVP_pkcs11_aes_192_cfb8()
51 #define EVP_pkcs11_aes_256_cfb8() hc_EVP_pkcs11_aes_256_cfb8()
52 #define EVP_pkcs11_rc4() hc_EVP_pkcs11_rc4()
53 #define EVP_pkcs11_rc4_40() hc_EVP_pkcs11_rc4_40()
54 #define EVP_pkcs11_rc2_40_cbc() hc_EVP_pkcs11_rc2_40_cbc()
55 #define EVP_pkcs11_rc2_64_cbc() hc_EVP_pkcs11_rc2_64_cbc()
56 #define EVP_pkcs11_rc2_cbc() hc_EVP_pkcs11_rc2_cbc()
57 #define EVP_pkcs11_camellia_128_cbc() hc_EVP_pkcs11_camellia_128_cbc()
58 #define EVP_pkcs11_camellia_192_cbc() hc_EVP_pkcs11_camellia_192_cbc()
59 #define EVP_pkcs11_camellia_256_cbc() hc_EVP_pkcs11_camellia_256_cbc()
60
61 #define EVP_pkcs11_hcrypto_md4() hc_EVP_pkcs11_hcrypto_md4()
62 #define EVP_pkcs11_hcrypto_md5() hc_EVP_pkcs11_hcrypto_md5()
63 #define EVP_pkcs11_hcrypto_sha1() hc_EVP_pkcs11_hcrypto_sha1()
64 #define EVP_pkcs11_hcrypto_sha256() hc_EVP_pkcs11_hcrypto_sha256()
65 #define EVP_pkcs11_hcrypto_sha384() hc_EVP_pkcs11_hcrypto_sha384()
66 #define EVP_pkcs11_hcrypto_sha512() hc_EVP_pkcs11_hcrypto_sha512()
67 #define EVP_pkcs11_hcrypto_des_cbc() hc_EVP_pkcs11_hcrypto_des_cbc()
68 #define EVP_pkcs11_hcrypto_des_ede3_cbc() hc_EVP_pkcs11_hcrypto_des_ede3_cbc()
69 #define EVP_pkcs11_hcrypto_aes_128_cbc() hc_EVP_pkcs11_hcrypto_aes_128_cbc()
70 #define EVP_pkcs11_hcrypto_aes_192_cbc() hc_EVP_pkcs11_hcrypto_aes_192_cbc()
71 #define EVP_pkcs11_hcrypto_aes_256_cbc() hc_EVP_pkcs11_hcrypto_aes_256_cbc()
72 #define EVP_pkcs11_hcrypto_aes_128_cfb8() hc_EVP_pkcs11_hcrypto_aes_128_cfb8()
73 #define EVP_pkcs11_hcrypto_aes_192_cfb8() hc_EVP_pkcs11_hcrypto_aes_192_cfb8()
74 #define EVP_pkcs11_hcrypto_aes_256_cfb8() hc_EVP_pkcs11_hcrypto_aes_256_cfb8()
75 #define EVP_pkcs11_hcrypto_rc4() hc_EVP_pkcs11_hcrypto_rc4()
76 #define EVP_pkcs11_hcrypto_rc4_40() hc_EVP_pkcs11_hcrypto_rc4_40()
77 #define EVP_pkcs11_hcrypto_rc2_40_cbc() hc_EVP_pkcs11_hcrypto_rc2_40_cbc()
78 #define EVP_pkcs11_hcrypto_rc2_64_cbc() hc_EVP_pkcs11_hcrypto_rc2_64_cbc()
79 #define EVP_pkcs11_hcrypto_rc2_cbc() hc_EVP_pkcs11_hcrypto_rc2_cbc()
80 #define EVP_pkcs11_hcrypto_camellia_128_cbc() hc_EVP_pkcs11_hcrypto_camellia_128_cbc()
81 #define EVP_pkcs11_hcrypto_camellia_192_cbc() hc_EVP_pkcs11_hcrypto_camellia_192_cbc()
82 #define EVP_pkcs11_hcrypto_camellia_256_cbc() hc_EVP_pkcs11_hcrypto_camellia_256_cbc()
83
84 HC_CPP_BEGIN
85
86 /*
87 * Strict PKCS#11 implementations (these will return NULL if the underlying
88 * PKCS#11 implementation does not implement the cipher or hash).
89 */
90 const EVP_MD * hc_EVP_pkcs11_md4(void);
91 const EVP_MD * hc_EVP_pkcs11_md5(void);
92 const EVP_MD * hc_EVP_pkcs11_sha1(void);
93 const EVP_MD * hc_EVP_pkcs11_sha256(void);
94 const EVP_MD * hc_EVP_pkcs11_sha384(void);
95 const EVP_MD * hc_EVP_pkcs11_sha512(void);
96
97 const EVP_CIPHER * hc_EVP_pkcs11_rc2_cbc(void);
98 const EVP_CIPHER * hc_EVP_pkcs11_rc2_40_cbc(void);
99 const EVP_CIPHER * hc_EVP_pkcs11_rc2_64_cbc(void);
100
101 const EVP_CIPHER * hc_EVP_pkcs11_rc4(void);
102 const EVP_CIPHER * hc_EVP_pkcs11_rc4_40(void);
103
104 const EVP_CIPHER * hc_EVP_pkcs11_des_cbc(void);
105 const EVP_CIPHER * hc_EVP_pkcs11_des_ede3_cbc(void);
106
107 const EVP_CIPHER * hc_EVP_pkcs11_aes_128_cbc(void);
108 const EVP_CIPHER * hc_EVP_pkcs11_aes_192_cbc(void);
109 const EVP_CIPHER * hc_EVP_pkcs11_aes_256_cbc(void);
110
111 const EVP_CIPHER * hc_EVP_pkcs11_aes_128_cfb8(void);
112 const EVP_CIPHER * hc_EVP_pkcs11_aes_192_cfb8(void);
113 const EVP_CIPHER * hc_EVP_pkcs11_aes_256_cfb8(void);
114
115 const EVP_CIPHER * hc_EVP_pkcs11_camellia_128_cbc(void);
116 const EVP_CIPHER * hc_EVP_pkcs11_camellia_192_cbc(void);
117 const EVP_CIPHER * hc_EVP_pkcs11_camellia_256_cbc(void);
118
119 /*
120 * PKCS#11 implementations with fallback to hcrypto.
121 */
122 const EVP_MD * hc_EVP_pkcs11_hcrypto_md4(void);
123 const EVP_MD * hc_EVP_pkcs11_hcrypto_md5(void);
124 const EVP_MD * hc_EVP_pkcs11_hcrypto_sha1(void);
125 const EVP_MD * hc_EVP_pkcs11_hcrypto_sha256(void);
126 const EVP_MD * hc_EVP_pkcs11_hcrypto_sha384(void);
127 const EVP_MD * hc_EVP_pkcs11_hcrypto_sha512(void);
128
129 const EVP_CIPHER * hc_EVP_pkcs11_hcrypto_rc2_cbc(void);
130 const EVP_CIPHER * hc_EVP_pkcs11_hcrypto_rc2_40_cbc(void);
131 const EVP_CIPHER * hc_EVP_pkcs11_hcrypto_rc2_64_cbc(void);
132
133 const EVP_CIPHER * hc_EVP_pkcs11_hcrypto_rc4(void);
134 const EVP_CIPHER * hc_EVP_pkcs11_hcrypto_rc4_40(void);
135
136 const EVP_CIPHER * hc_EVP_pkcs11_hcrypto_des_cbc(void);
137 const EVP_CIPHER * hc_EVP_pkcs11_hcrypto_des_ede3_cbc(void);
138
139 const EVP_CIPHER * hc_EVP_pkcs11_hcrypto_aes_128_cbc(void);
140 const EVP_CIPHER * hc_EVP_pkcs11_hcrypto_aes_192_cbc(void);
141 const EVP_CIPHER * hc_EVP_pkcs11_hcrypto_aes_256_cbc(void);
142
143 const EVP_CIPHER * hc_EVP_pkcs11_hcrypto_aes_128_cfb8(void);
144 const EVP_CIPHER * hc_EVP_pkcs11_hcrypto_aes_192_cfb8(void);
145 const EVP_CIPHER * hc_EVP_pkcs11_hcrypto_aes_256_cfb8(void);
146
147 const EVP_CIPHER * hc_EVP_pkcs11_hcrypto_camellia_128_cbc(void);
148 const EVP_CIPHER * hc_EVP_pkcs11_hcrypto_camellia_192_cbc(void);
149 const EVP_CIPHER * hc_EVP_pkcs11_hcrypto_camellia_256_cbc(void);
150
151 HC_CPP_END
152
153 #endif /* HEIM_EVP_PKCS11_H */