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