1
<!-- gcryptref-digest.sgml - libgcrypt reference (digests)
2
Copyright (C) 2000 Free Software Foundation, Inc.
4
This file is part of GnuPG.
6
GnuPG is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
11
GnuPG is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
23
<refname>gcry_check_version</refname>
24
<refpurpose>get or check the version of libgcrypt</refpurpose>
30
#include <gcrypt.h>
33
<funcdef>const char *<function>gcry_check_version</function></funcdef>
34
<paramdef>const char *<parameter>req_version</parameter></paramdef>
39
<refsect1><title>Description</title>
41
<indexterm><primary>gcry_check_version</primary>
43
<function>gcry_check_version</function> checks
44
that the version of the library is at minimum the requested one
45
and return the version string; NULL is returned if the condition is
46
not met. You may pass NULL as reqy_version to simply get the version
47
string back without any checking.
53
<refname>gcry_errno</refname>
54
<refname>gcry_strerror</refname>
55
<refpurpose>Get the last error</refpurpose>
61
#include <gcrypt.h>
64
<funcdef>int <function>gcry_errno</function></funcdef>
67
<funcdef>const char *<function>gcry_strerror</function></funcdef>
68
<paramdef>int<parameter>no</parameter></paramdef>
73
<refsect1><title>Description</title>
75
<indexterm><primary>gcry_errno</primary></indexterm>
76
<indexterm><primary>gcry_strerror</primary></indexterm>
77
Both function are to be used like there Standard-C
78
counterparts. However <function>gcry_errno</function> is a function
79
and not just a global variable. If -1 is passed to
80
<function>gcry_strerror</>, <function>gcry_errno</> is implictly used.
87
<refname>gcry_control</refname>
88
<refpurpose>Multi purpose control function</refpurpose>
94
#include <gcrypt.h>
97
<funcdef>int <function>gcry_control</function></funcdef>
98
<paramdef>enum gcry_ctl_cmds<parameter>cmd</parameter></paramdef>
99
<paramdef><parameter>...</parameter></paramdef>
104
<refsect1><title>Description</title>
106
<indexterm><primary>gcry_control</primary></indexterm>
107
This function is used to control various aspects of &libgcrypt;
108
FIXME: Explain all commands here.
118
<refname>gcry_set_allocation_handler</refname>
119
<refname>gcry_set_outofcore_handler</refname>
120
<refpurpose>Use application defined malloc functions</refpurpose>
126
#include <gcrypt.h>
129
<funcdef>void <function>gcry_set_allocation_handler</></funcdef>
130
<paramdef>void *(*<parameter>alloc_func</>)(size_t n)</paramdef>
131
<paramdef>void *(*<parameter>alloc_secure_func</>)(size_t n)</paramdef>
132
<paramdef>int (*<parameter>is_secure_func</>)(const void *p)</paramdef>
133
<paramdef>void *(*<parameter>realloc_func</>)(void *p, size_t n)</paramdef>
134
<paramdef>void (*<parameter>free_func</>)(void *p)</paramdef>
137
<funcdef>void <function>gcry_set_outofcore_handler</></funcdef>
139
<paramdef>int (*<parameter>h</>)( void*, size_t, unsigned int ),
140
void *opaque )</paramdef>
145
<refsect1><title>Description</title>
147
<indexterm><primary>gcry_set_allocation_handler</primary></indexterm>
148
<indexterm><primary>gcry_set_outofcore_handler</primary></indexterm>
157
<refname>gcry_set_fatalerror_handler</refname>
158
<refpurpose>change the default fatal error handler</refpurpose>
164
#include <gcrypt.h>
167
<funcdef>void <function>gcry_set_fatalerror_handler</></funcdef>
168
<paramdef>void (*<parameter>func</>)(
169
void *, int, const char*)</paramdef>
170
<paramdef>void *<parameter>opaque</></paramdef>
175
<refsect1><title>Description</title>
177
<indexterm><primary>gcry_set_fatalerror_handler</primary></indexterm>
178
At certain places the &libgcrypt; may need to call a fatal error fucntion
179
which does terminate the process. To allow an application to do
180
some emergency cleanup, it may register a fatal error handler with
181
the library. This handler is assumed to terminate the application;
182
however if it returns &libgcrypt; will abort anyway.
185
The handler is called with the opaque value registered here, an
186
errorcode from &libgcrypt; and some descriptive text string.
193
<refname>gcry_set_gettext_handler</refname>
194
<refpurpose>Change the default gettext function</refpurpose>
200
#include <gcrypt.h>
203
<funcdef>void <function>gcry_set_gettext_handler</></funcdef>
204
<paramdef>const char *(*<parameter>func</>)(const char*)</paramdef>
205
<paramdef>void *<parameter>opaque</></paramdef>
210
<refsect1><title>Description</title>
212
<indexterm><primary>gcry_set_log_handler</primary></indexterm>
220
void gcry_set_log_handler( void (*f)(void*,int, const char*, va_list ),
224
<refname>gcry_set_log_handler</refname>
225
<refpurpose>Change the default logging function</refpurpose>
231
#include <gcrypt.h>
234
<funcdef>void <function>gcry_set_log_handler</></funcdef>
235
<paramdef>void (*<parameter>func</>)
236
(void*, int, const char*, va_list)</paramdef>
237
<paramdef>void *<parameter>opaque</></paramdef>
242
<refsect1><title>Description</title>
244
<indexterm><primary>gcry_set_log_handler</primary></indexterm>
245
&libgcrypt; has it;s own logging functions. Applications which
246
need to use their own, should provide a log function to &libgcrypt;
247
so that it will use this function instead.
249
Fixme: Describe how this is intended to work.
254
void *gcry_malloc( size_t n );
255
void *gcry_calloc( size_t n, size_t m );
256
void *gcry_malloc_secure( size_t n );
257
void *gcry_calloc_secure( size_t n, size_t m );
258
void *gcry_realloc( void *a, size_t n );
259
void *gcry_xmalloc( size_t n );
260
void *gcry_xcalloc( size_t n, size_t m );
261
void *gcry_xmalloc_secure( size_t n );
262
void *gcry_xcalloc_secure( size_t n, size_t m );
263
void *gcry_xrealloc( void *a, size_t n );
264
char *gcry_xstrdup( const char * a);
265
void gcry_free( void *a );
266
int gcry_is_secure( const void *a );
270
<refname>gcry_malloc</refname>
271
<refname>gcry_calloc</refname>
272
<refname>gcry_malloc_secure</refname>
273
<refname>gcry_calloc_secure</refname>
274
<refname>gcry_realloc</refname>
275
<refname>gcry_xmalloc</refname>
276
<refname>gcry_xcalloc</refname>
277
<refname>gcry_xmalloc_secure</refname>
278
<refname>gcry_xcalloc_secure</refname>
279
<refname>gcry_xrealloc</refname>
280
<refname>gcry_xstrdup</refname>
283
<refname>gcry_malloc</refname>
284
<refname>gcry_malloc</refname>
286
<refpurpose>Change the default logging function</refpurpose>
292
#include <gcrypt.h>
295
<funcdef>void <function>gcry_set_log_handler</></funcdef>
296
<paramdef>void (*<parameter>func</>)
297
(void*, int, const char*, va_list)</paramdef>
298
<paramdef>void *<parameter>opaque</></paramdef>
303
<refsect1><title>Description</title>
305
<indexterm><primary>gcry_set_log_handler</primary></indexterm>
306
&libgcrypt; has it;s own logging functions. Applications which
307
need to use their own, should provide a log function to &libgcrypt;
308
so that it will use this function instead.
310
Fixme: Describe how this is intended to work.
316
void gcry_randomize( byte *buffer, size_t length,
317
enum gcry_random_level level );
318
void *gcry_random_bytes( size_t nbytes, enum gcry_random_level level );
319
void *gcry_random_bytes_secure( size_t nbytes, enum gcry_random_level level );