]> gitweb.factorcode.org Git - factor.git/blob - basis/openssl/libcrypto/libcrypto.factor
factor: remove extra whitespace
[factor.git] / basis / openssl / libcrypto / libcrypto.factor
1 ! Copyright (C) 2007 Elie CHAFTARI, 2009 Maxim Savchenko
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: alien alien.c-types alien.destructors alien.libraries
4 alien.syntax classes.struct combinators system ;
5
6 IN: openssl.libcrypto
7
8 << "libcrypto" {
9     { [ os windows? ] [ "libcrypto-37.dll" ] }
10     { [ os macosx? ] [ "libcrypto.35.dylib" ] }
11     { [ os unix? ] [ "libcrypto.so" ] }
12 } cond cdecl add-library >>
13
14 STRUCT: bio-method
15     { type int }
16     { name void* }
17     { bwrite void* }
18     { bread void* }
19     { bputs void* }
20     { bgets void* }
21     { ctrl void* }
22     { create void* }
23     { destroy void* }
24     { callback-ctrl void* } ;
25
26 CONSTANT: BIO_NOCLOSE       0x00
27 CONSTANT: BIO_CLOSE         0x01
28
29 CONSTANT: RSA_3             0x3
30 CONSTANT: RSA_F4            0x10001
31
32 CONSTANT: BIO_C_SET_CONNECT         100
33 CONSTANT: BIO_C_DO_STATE_MACHINE    101
34 CONSTANT: BIO_C_SET_NBIO            102
35 CONSTANT: BIO_C_SET_PROXY_PARAM     103
36 CONSTANT: BIO_C_SET_FD              104
37 CONSTANT: BIO_C_GET_FD              105
38 CONSTANT: BIO_C_SET_FILE_PTR        106
39 CONSTANT: BIO_C_GET_FILE_PTR        107
40 CONSTANT: BIO_C_SET_FILENAME        108
41 CONSTANT: BIO_C_SET_SSL             109
42 CONSTANT: BIO_C_GET_SSL             110
43
44 LIBRARY: libcrypto
45
46 ! ===============================================
47 ! crypto.h
48 ! ===============================================
49 STRUCT: crypto_ex_data_st
50     { sk void* }
51     { dummy int } ;
52 TYPEDEF: crypto_ex_data_st CRYPTO_EX_DATA
53
54 ! ===============================================
55 ! bio.h
56 ! ===============================================
57 STRUCT: bio_method_st
58     { type int }
59     { name c-string }
60     { bwrite void* }
61     { bread void* }
62     { bputs void* }
63     { bgets void* }
64     { ctrl void* }
65     { create void* }
66     { destroy void* }
67     { callback_ctrl void* } ;
68 TYPEDEF: bio_method_st BIO_METHOD
69
70 STRUCT: bio_st
71     { method BIO_METHOD* }
72     { callback void* }
73     { cb_arg c-string }
74     { init int }
75     { shutdown int }
76     { flags int }
77     { retry-reason int }
78     { num int }
79     { ptr void* }
80     { next-bio bio_st* }
81     { prev-bio bio_st* }
82     { references int }
83     { num-read ulong }
84     { num-write ulong }
85     { ex-data CRYPTO_EX_DATA } ;
86 TYPEDEF: bio_st BIO
87
88 FUNCTION: BIO* BIO_new_file ( c-string filename, c-string mode )
89
90 FUNCTION: int BIO_printf ( BIO* bio, c-string format )
91
92 FUNCTION: long BIO_ctrl ( void* bio, int cmd, long larg, void* parg )
93
94 FUNCTION: BIO* BIO_new_socket ( int fd, int close-flag )
95
96 FUNCTION: BIO* BIO_new_connect ( c-string name )
97
98 FUNCTION: void* BIO_new ( void* method )
99
100 FUNCTION: int BIO_set ( void* bio, void* method )
101
102 FUNCTION: int BIO_free ( void* bio )
103
104 FUNCTION: void* BIO_push ( void* bio, void* append )
105
106 FUNCTION: int BIO_read ( BIO* bio, void* buf, int len )
107
108 FUNCTION: int BIO_gets ( void* b, c-string buf, int size )
109
110 FUNCTION: int BIO_write ( void* b, void* buf, int len )
111
112 FUNCTION: int BIO_puts ( BIO* bio, c-string buf )
113
114 FUNCTION: ulong ERR_get_error ( )
115
116 FUNCTION: void ERR_clear_error ( )
117
118 FUNCTION: c-string ERR_error_string ( ulong e, void* buf )
119
120 FUNCTION: void* BIO_f_buffer ( )
121
122 ! ===============================================
123 ! evp.h
124 ! ===============================================
125
126 CONSTANT: EVP_MAX_MD_SIZE 64
127
128 C-TYPE: EVP_MD
129 C-TYPE: ENGINE
130
131 STRUCT: EVP_MD_CTX
132     { digest EVP_MD* }
133     { engine ENGINE* }
134     { flags ulong }
135     { md_data void* } ;
136
137 ! ------------------------------------------------------------------------------
138 ! API >= 1.1.0
139 ! ------------------------------------------------------------------------------
140 FUNCTION: ulong OpenSSL_version_num ( )
141 FUNCTION: EVP_MD_CTX* EVP_MD_CTX_new ( )
142 FUNCTION: void EVP_MD_CTX_free ( EVP_MD_CTX* ctx )
143
144 ! ------------------------------------------------------------------------------
145 ! API < 1.1.0, removed in new versions
146 ! ------------------------------------------------------------------------------
147 FUNCTION: void OpenSSL_add_all_ciphers ( )
148 FUNCTION: void OpenSSL_add_all_digests ( )
149 FUNCTION: EVP_MD_CTX* EVP_MD_CTX_create ( )
150 FUNCTION: void EVP_MD_CTX_destroy ( EVP_MD_CTX* ctx )
151 ! ------------------------------------------------------------------------------
152
153 ! Clean them up before exiting
154 FUNCTION: void EVP_cleanup ( )
155
156 FUNCTION: EVP_MD* EVP_get_digestbyname ( c-string name )
157
158 FUNCTION: void EVP_MD_CTX_init ( EVP_MD* ctx )
159
160 FUNCTION: int EVP_MD_CTX_cleanup ( EVP_MD_CTX* ctx )
161 FUNCTION: int EVP_MD_CTX_copy_ex ( EVP_MD_CTX* out, EVP_MD_CTX* in )
162
163 FUNCTION: int EVP_DigestInit_ex ( EVP_MD_CTX* ctx, EVP_MD* type, ENGINE* impl )
164
165 FUNCTION: int EVP_DigestUpdate ( EVP_MD_CTX* ctx, void* d, uint cnt )
166
167 FUNCTION: int EVP_DigestFinal_ex ( EVP_MD_CTX* ctx, void* md, uint* s )
168
169 FUNCTION: int EVP_Digest ( void* data, uint count, void* md, uint* size, EVP_MD* type, ENGINE* impl )
170
171 FUNCTION: int EVP_MD_CTX_copy ( EVP_MD_CTX* out, EVP_MD_CTX* in )
172
173 FUNCTION: int EVP_DigestInit ( EVP_MD_CTX* ctx, EVP_MD* type )
174
175 FUNCTION: int EVP_DigestFinal ( EVP_MD_CTX* ctx, void* md, uint* s )
176
177 FUNCTION: void* PEM_read_bio_DHparams ( void* bp, void* x, void* cb,
178                                         void* u )
179
180 ! ===============================================
181 ! rsa.h
182 ! ===============================================
183
184 FUNCTION: void* RSA_new ( )
185
186 FUNCTION: int RSA_generate_key_ex ( void* rsa int bits, void* e, void* cb )
187
188 FUNCTION: int RSA_check_key ( void* rsa )
189
190 FUNCTION: void RSA_free ( void* rsa )
191
192 FUNCTION: int RSA_print_fp ( void* fp, void* x, int offset )
193
194 ! ===============================================
195 ! objects.h
196 ! ===============================================
197
198 FUNCTION: int OBJ_sn2nid ( c-string s )
199
200 ! ===============================================
201 ! bn.h
202 ! ===============================================
203
204 FUNCTION: int BN_num_bits ( void* a )
205
206 FUNCTION: void* BN_bin2bn ( void* s, int len, void* ret )
207
208 FUNCTION: int BN_bn2bin ( void* a, void* to )
209
210 FUNCTION: void BN_clear_free ( void* a )
211 DESTRUCTOR: BN_clear_free
212
213 ! ===============================================
214 ! ec.h
215 ! ===============================================
216
217 CONSTANT: POINT_CONVERSION_COMPRESSED 2
218 CONSTANT: POINT_CONVERSION_UNCOMPRESSED 4
219 CONSTANT: POINT_CONVERSION_HYBRID 6
220
221 FUNCTION: int EC_GROUP_get_degree ( void* group )
222
223 FUNCTION: void* EC_POINT_new ( void* group )
224
225 FUNCTION: void EC_POINT_clear_free ( void* point )
226
227 FUNCTION: int EC_POINT_point2oct ( void* group, void* point, int form, void* buf, int len, void* ctx )
228
229 FUNCTION: int EC_POINT_oct2point ( void* group, void* point, void* buf, int len, void* ctx )
230
231 FUNCTION: void* EC_KEY_new_by_curve_name ( int nid )
232
233 FUNCTION: void EC_KEY_free ( void* r )
234
235 FUNCTION: int EC_KEY_set_private_key ( void* key, void* priv_key )
236
237 FUNCTION: int EC_KEY_set_public_key ( void* key, void* pub_key )
238
239 FUNCTION: int EC_KEY_generate_key ( void* eckey )
240
241 FUNCTION: void* EC_KEY_get0_group ( void* key )
242
243 FUNCTION: void* EC_KEY_get0_private_key ( void* key )
244
245 FUNCTION: void* EC_KEY_get0_public_key ( void* key )
246
247 ! ===============================================
248 ! ecdsa.h
249 ! ===============================================
250
251 FUNCTION: int ECDSA_size ( void* eckey )
252
253 FUNCTION: int ECDSA_sign ( int type, void* dgst, int dgstlen, void* sig, void* siglen, void* eckey )
254
255 FUNCTION: int ECDSA_verify ( int type, void* dgst, int dgstlen, void* sig, int siglen, void* eckey )