Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include
File: gcrypt.h
/* gcrypt.h - GNU Cryptographic Library Interface -*- c -*-
[0] Fix | Delete
* Copyright (C) 1998-2017 Free Software Foundation, Inc.
[1] Fix | Delete
* Copyright (C) 2012-2017 g10 Code GmbH
[2] Fix | Delete
*
[3] Fix | Delete
* This file is part of Libgcrypt.
[4] Fix | Delete
*
[5] Fix | Delete
* Libgcrypt is free software; you can redistribute it and/or modify
[6] Fix | Delete
* it under the terms of the GNU Lesser General Public License as
[7] Fix | Delete
* published by the Free Software Foundation; either version 2.1 of
[8] Fix | Delete
* the License, or (at your option) any later version.
[9] Fix | Delete
*
[10] Fix | Delete
* Libgcrypt is distributed in the hope that it will be useful,
[11] Fix | Delete
* but WITHOUT ANY WARRANTY; without even the implied warranty of
[12] Fix | Delete
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
[13] Fix | Delete
* GNU Lesser General Public License for more details.
[14] Fix | Delete
*
[15] Fix | Delete
* You should have received a copy of the GNU Lesser General Public
[16] Fix | Delete
* License along with this program; if not, see <http://www.gnu.org/licenses/>.
[17] Fix | Delete
*
[18] Fix | Delete
* File: src/gcrypt.h. Generated from gcrypt.h.in by configure.
[19] Fix | Delete
*/
[20] Fix | Delete
[21] Fix | Delete
#ifndef _GCRYPT_H
[22] Fix | Delete
#define _GCRYPT_H
[23] Fix | Delete
[24] Fix | Delete
#include <stdlib.h>
[25] Fix | Delete
#include <stdarg.h>
[26] Fix | Delete
#include <string.h>
[27] Fix | Delete
[28] Fix | Delete
#include <gpg-error.h>
[29] Fix | Delete
[30] Fix | Delete
#include <sys/types.h>
[31] Fix | Delete
[32] Fix | Delete
#if defined _WIN32 || defined __WIN32__
[33] Fix | Delete
# include <winsock2.h>
[34] Fix | Delete
# include <ws2tcpip.h>
[35] Fix | Delete
# include <time.h>
[36] Fix | Delete
# ifndef __GNUC__
[37] Fix | Delete
typedef long ssize_t;
[38] Fix | Delete
typedef int pid_t;
[39] Fix | Delete
# endif /*!__GNUC__*/
[40] Fix | Delete
#else
[41] Fix | Delete
# include <sys/socket.h>
[42] Fix | Delete
# include <sys/time.h>
[43] Fix | Delete
# include <sys/select.h>
[44] Fix | Delete
#endif /*!_WIN32*/
[45] Fix | Delete
[46] Fix | Delete
typedef socklen_t gcry_socklen_t;
[47] Fix | Delete
[48] Fix | Delete
/* This is required for error code compatibility. */
[49] Fix | Delete
#define _GCRY_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_GCRYPT
[50] Fix | Delete
[51] Fix | Delete
#ifdef __cplusplus
[52] Fix | Delete
extern "C" {
[53] Fix | Delete
#if 0 /* (Keep Emacsens' auto-indent happy.) */
[54] Fix | Delete
}
[55] Fix | Delete
#endif
[56] Fix | Delete
#endif
[57] Fix | Delete
[58] Fix | Delete
/* The version of this header should match the one of the library. It
[59] Fix | Delete
should not be used by a program because gcry_check_version() should
[60] Fix | Delete
return the same version. The purpose of this macro is to let
[61] Fix | Delete
autoconf (using the AM_PATH_GCRYPT macro) check that this header
[62] Fix | Delete
matches the installed library. */
[63] Fix | Delete
#define GCRYPT_VERSION "1.8.5"
[64] Fix | Delete
[65] Fix | Delete
/* The version number of this header. It may be used to handle minor
[66] Fix | Delete
API incompatibilities. */
[67] Fix | Delete
#define GCRYPT_VERSION_NUMBER 0x010805
[68] Fix | Delete
[69] Fix | Delete
[70] Fix | Delete
/* Internal: We can't use the convenience macros for the multi
[71] Fix | Delete
precision integer functions when building this library. */
[72] Fix | Delete
#ifdef _GCRYPT_IN_LIBGCRYPT
[73] Fix | Delete
#ifndef GCRYPT_NO_MPI_MACROS
[74] Fix | Delete
#define GCRYPT_NO_MPI_MACROS 1
[75] Fix | Delete
#endif
[76] Fix | Delete
#endif
[77] Fix | Delete
[78] Fix | Delete
/* We want to use gcc attributes when possible. Warning: Don't use
[79] Fix | Delete
these macros in your programs: As indicated by the leading
[80] Fix | Delete
underscore they are subject to change without notice. */
[81] Fix | Delete
#ifdef __GNUC__
[82] Fix | Delete
[83] Fix | Delete
#define _GCRY_GCC_VERSION (__GNUC__ * 10000 \
[84] Fix | Delete
+ __GNUC_MINOR__ * 100 \
[85] Fix | Delete
+ __GNUC_PATCHLEVEL__)
[86] Fix | Delete
[87] Fix | Delete
#if _GCRY_GCC_VERSION >= 30100
[88] Fix | Delete
#define _GCRY_GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__))
[89] Fix | Delete
#endif
[90] Fix | Delete
[91] Fix | Delete
#if _GCRY_GCC_VERSION >= 29600
[92] Fix | Delete
#define _GCRY_GCC_ATTR_PURE __attribute__ ((__pure__))
[93] Fix | Delete
#endif
[94] Fix | Delete
[95] Fix | Delete
#if _GCRY_GCC_VERSION >= 30200
[96] Fix | Delete
#define _GCRY_GCC_ATTR_MALLOC __attribute__ ((__malloc__))
[97] Fix | Delete
#endif
[98] Fix | Delete
[99] Fix | Delete
#define _GCRY_GCC_ATTR_PRINTF(f,a) __attribute__ ((format (printf,f,a)))
[100] Fix | Delete
[101] Fix | Delete
#if _GCRY_GCC_VERSION >= 40000
[102] Fix | Delete
#define _GCRY_GCC_ATTR_SENTINEL(a) __attribute__ ((sentinel(a)))
[103] Fix | Delete
#endif
[104] Fix | Delete
[105] Fix | Delete
#endif /*__GNUC__*/
[106] Fix | Delete
[107] Fix | Delete
#ifndef _GCRY_GCC_ATTR_DEPRECATED
[108] Fix | Delete
#define _GCRY_GCC_ATTR_DEPRECATED
[109] Fix | Delete
#endif
[110] Fix | Delete
#ifndef _GCRY_GCC_ATTR_PURE
[111] Fix | Delete
#define _GCRY_GCC_ATTR_PURE
[112] Fix | Delete
#endif
[113] Fix | Delete
#ifndef _GCRY_GCC_ATTR_MALLOC
[114] Fix | Delete
#define _GCRY_GCC_ATTR_MALLOC
[115] Fix | Delete
#endif
[116] Fix | Delete
#ifndef _GCRY_GCC_ATTR_PRINTF
[117] Fix | Delete
#define _GCRY_GCC_ATTR_PRINTF(f,a)
[118] Fix | Delete
#endif
[119] Fix | Delete
#ifndef _GCRY_GCC_ATTR_SENTINEL
[120] Fix | Delete
#define _GCRY_GCC_ATTR_SENTINEL(a)
[121] Fix | Delete
#endif
[122] Fix | Delete
[123] Fix | Delete
/* Make up an attribute to mark functions and types as deprecated but
[124] Fix | Delete
allow internal use by Libgcrypt. */
[125] Fix | Delete
#ifdef _GCRYPT_IN_LIBGCRYPT
[126] Fix | Delete
#define _GCRY_ATTR_INTERNAL
[127] Fix | Delete
#else
[128] Fix | Delete
#define _GCRY_ATTR_INTERNAL _GCRY_GCC_ATTR_DEPRECATED
[129] Fix | Delete
#endif
[130] Fix | Delete
[131] Fix | Delete
/* Wrappers for the libgpg-error library. */
[132] Fix | Delete
[133] Fix | Delete
typedef gpg_error_t gcry_error_t;
[134] Fix | Delete
typedef gpg_err_code_t gcry_err_code_t;
[135] Fix | Delete
typedef gpg_err_source_t gcry_err_source_t;
[136] Fix | Delete
[137] Fix | Delete
static GPG_ERR_INLINE gcry_error_t
[138] Fix | Delete
gcry_err_make (gcry_err_source_t source, gcry_err_code_t code)
[139] Fix | Delete
{
[140] Fix | Delete
return gpg_err_make (source, code);
[141] Fix | Delete
}
[142] Fix | Delete
[143] Fix | Delete
/* The user can define GPG_ERR_SOURCE_DEFAULT before including this
[144] Fix | Delete
file to specify a default source for gpg_error. */
[145] Fix | Delete
#ifndef GCRY_ERR_SOURCE_DEFAULT
[146] Fix | Delete
#define GCRY_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_USER_1
[147] Fix | Delete
#endif
[148] Fix | Delete
[149] Fix | Delete
static GPG_ERR_INLINE gcry_error_t
[150] Fix | Delete
gcry_error (gcry_err_code_t code)
[151] Fix | Delete
{
[152] Fix | Delete
return gcry_err_make (GCRY_ERR_SOURCE_DEFAULT, code);
[153] Fix | Delete
}
[154] Fix | Delete
[155] Fix | Delete
static GPG_ERR_INLINE gcry_err_code_t
[156] Fix | Delete
gcry_err_code (gcry_error_t err)
[157] Fix | Delete
{
[158] Fix | Delete
return gpg_err_code (err);
[159] Fix | Delete
}
[160] Fix | Delete
[161] Fix | Delete
[162] Fix | Delete
static GPG_ERR_INLINE gcry_err_source_t
[163] Fix | Delete
gcry_err_source (gcry_error_t err)
[164] Fix | Delete
{
[165] Fix | Delete
return gpg_err_source (err);
[166] Fix | Delete
}
[167] Fix | Delete
[168] Fix | Delete
/* Return a pointer to a string containing a description of the error
[169] Fix | Delete
code in the error value ERR. */
[170] Fix | Delete
const char *gcry_strerror (gcry_error_t err);
[171] Fix | Delete
[172] Fix | Delete
/* Return a pointer to a string containing a description of the error
[173] Fix | Delete
source in the error value ERR. */
[174] Fix | Delete
const char *gcry_strsource (gcry_error_t err);
[175] Fix | Delete
[176] Fix | Delete
/* Retrieve the error code for the system error ERR. This returns
[177] Fix | Delete
GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report
[178] Fix | Delete
this). */
[179] Fix | Delete
gcry_err_code_t gcry_err_code_from_errno (int err);
[180] Fix | Delete
[181] Fix | Delete
/* Retrieve the system error for the error code CODE. This returns 0
[182] Fix | Delete
if CODE is not a system error code. */
[183] Fix | Delete
int gcry_err_code_to_errno (gcry_err_code_t code);
[184] Fix | Delete
[185] Fix | Delete
/* Return an error value with the error source SOURCE and the system
[186] Fix | Delete
error ERR. */
[187] Fix | Delete
gcry_error_t gcry_err_make_from_errno (gcry_err_source_t source, int err);
[188] Fix | Delete
[189] Fix | Delete
/* Return an error value with the system error ERR. */
[190] Fix | Delete
gcry_error_t gcry_error_from_errno (int err);
[191] Fix | Delete
[192] Fix | Delete
[193] Fix | Delete
/* NOTE: Since Libgcrypt 1.6 the thread callbacks are not anymore
[194] Fix | Delete
used. However we keep it to allow for some source code
[195] Fix | Delete
compatibility if used in the standard way. */
[196] Fix | Delete
[197] Fix | Delete
/* Constants defining the thread model to use. Used with the OPTION
[198] Fix | Delete
field of the struct gcry_thread_cbs. */
[199] Fix | Delete
#define GCRY_THREAD_OPTION_DEFAULT 0
[200] Fix | Delete
#define GCRY_THREAD_OPTION_USER 1
[201] Fix | Delete
#define GCRY_THREAD_OPTION_PTH 2
[202] Fix | Delete
#define GCRY_THREAD_OPTION_PTHREAD 3
[203] Fix | Delete
[204] Fix | Delete
/* The version number encoded in the OPTION field of the struct
[205] Fix | Delete
gcry_thread_cbs. */
[206] Fix | Delete
#define GCRY_THREAD_OPTION_VERSION 1
[207] Fix | Delete
[208] Fix | Delete
/* Wrapper for struct ath_ops. */
[209] Fix | Delete
struct gcry_thread_cbs
[210] Fix | Delete
{
[211] Fix | Delete
/* The OPTION field encodes the thread model and the version number
[212] Fix | Delete
of this structure.
[213] Fix | Delete
Bits 7 - 0 are used for the thread model
[214] Fix | Delete
Bits 15 - 8 are used for the version number. */
[215] Fix | Delete
unsigned int option;
[216] Fix | Delete
} _GCRY_ATTR_INTERNAL;
[217] Fix | Delete
[218] Fix | Delete
#define GCRY_THREAD_OPTION_PTH_IMPL \
[219] Fix | Delete
static struct gcry_thread_cbs gcry_threads_pth = { \
[220] Fix | Delete
(GCRY_THREAD_OPTION_PTH | (GCRY_THREAD_OPTION_VERSION << 8))}
[221] Fix | Delete
[222] Fix | Delete
#define GCRY_THREAD_OPTION_PTHREAD_IMPL \
[223] Fix | Delete
static struct gcry_thread_cbs gcry_threads_pthread = { \
[224] Fix | Delete
(GCRY_THREAD_OPTION_PTHREAD | (GCRY_THREAD_OPTION_VERSION << 8))}
[225] Fix | Delete
[226] Fix | Delete
[227] Fix | Delete
[228] Fix | Delete
/* A generic context object as used by some functions. */
[229] Fix | Delete
struct gcry_context;
[230] Fix | Delete
typedef struct gcry_context *gcry_ctx_t;
[231] Fix | Delete
[232] Fix | Delete
/* The data objects used to hold multi precision integers. */
[233] Fix | Delete
struct gcry_mpi;
[234] Fix | Delete
typedef struct gcry_mpi *gcry_mpi_t;
[235] Fix | Delete
struct gcry_mpi_point;
[236] Fix | Delete
typedef struct gcry_mpi_point *gcry_mpi_point_t;
[237] Fix | Delete
[238] Fix | Delete
#ifndef GCRYPT_NO_DEPRECATED
[239] Fix | Delete
typedef struct gcry_mpi *GCRY_MPI _GCRY_GCC_ATTR_DEPRECATED;
[240] Fix | Delete
typedef struct gcry_mpi *GcryMPI _GCRY_GCC_ATTR_DEPRECATED;
[241] Fix | Delete
#endif
[242] Fix | Delete
[243] Fix | Delete
/* A structure used for scatter gather hashing. */
[244] Fix | Delete
typedef struct
[245] Fix | Delete
{
[246] Fix | Delete
size_t size; /* The allocated size of the buffer or 0. */
[247] Fix | Delete
size_t off; /* Offset into the buffer. */
[248] Fix | Delete
size_t len; /* The used length of the buffer. */
[249] Fix | Delete
void *data; /* The buffer. */
[250] Fix | Delete
} gcry_buffer_t;
[251] Fix | Delete
[252] Fix | Delete
[253] Fix | Delete
[254] Fix | Delete
[255] Fix | Delete
/* Check that the library fulfills the version requirement. */
[256] Fix | Delete
const char *gcry_check_version (const char *req_version);
[257] Fix | Delete
[258] Fix | Delete
/* Codes for function dispatchers. */
[259] Fix | Delete
[260] Fix | Delete
/* Codes used with the gcry_control function. */
[261] Fix | Delete
enum gcry_ctl_cmds
[262] Fix | Delete
{
[263] Fix | Delete
/* Note: 1 .. 2 are not anymore used. */
[264] Fix | Delete
GCRYCTL_CFB_SYNC = 3,
[265] Fix | Delete
GCRYCTL_RESET = 4, /* e.g. for MDs */
[266] Fix | Delete
GCRYCTL_FINALIZE = 5,
[267] Fix | Delete
GCRYCTL_GET_KEYLEN = 6,
[268] Fix | Delete
GCRYCTL_GET_BLKLEN = 7,
[269] Fix | Delete
GCRYCTL_TEST_ALGO = 8,
[270] Fix | Delete
GCRYCTL_IS_SECURE = 9,
[271] Fix | Delete
GCRYCTL_GET_ASNOID = 10,
[272] Fix | Delete
GCRYCTL_ENABLE_ALGO = 11,
[273] Fix | Delete
GCRYCTL_DISABLE_ALGO = 12,
[274] Fix | Delete
GCRYCTL_DUMP_RANDOM_STATS = 13,
[275] Fix | Delete
GCRYCTL_DUMP_SECMEM_STATS = 14,
[276] Fix | Delete
GCRYCTL_GET_ALGO_NPKEY = 15,
[277] Fix | Delete
GCRYCTL_GET_ALGO_NSKEY = 16,
[278] Fix | Delete
GCRYCTL_GET_ALGO_NSIGN = 17,
[279] Fix | Delete
GCRYCTL_GET_ALGO_NENCR = 18,
[280] Fix | Delete
GCRYCTL_SET_VERBOSITY = 19,
[281] Fix | Delete
GCRYCTL_SET_DEBUG_FLAGS = 20,
[282] Fix | Delete
GCRYCTL_CLEAR_DEBUG_FLAGS = 21,
[283] Fix | Delete
GCRYCTL_USE_SECURE_RNDPOOL= 22,
[284] Fix | Delete
GCRYCTL_DUMP_MEMORY_STATS = 23,
[285] Fix | Delete
GCRYCTL_INIT_SECMEM = 24,
[286] Fix | Delete
GCRYCTL_TERM_SECMEM = 25,
[287] Fix | Delete
GCRYCTL_DISABLE_SECMEM_WARN = 27,
[288] Fix | Delete
GCRYCTL_SUSPEND_SECMEM_WARN = 28,
[289] Fix | Delete
GCRYCTL_RESUME_SECMEM_WARN = 29,
[290] Fix | Delete
GCRYCTL_DROP_PRIVS = 30,
[291] Fix | Delete
GCRYCTL_ENABLE_M_GUARD = 31,
[292] Fix | Delete
GCRYCTL_START_DUMP = 32,
[293] Fix | Delete
GCRYCTL_STOP_DUMP = 33,
[294] Fix | Delete
GCRYCTL_GET_ALGO_USAGE = 34,
[295] Fix | Delete
GCRYCTL_IS_ALGO_ENABLED = 35,
[296] Fix | Delete
GCRYCTL_DISABLE_INTERNAL_LOCKING = 36,
[297] Fix | Delete
GCRYCTL_DISABLE_SECMEM = 37,
[298] Fix | Delete
GCRYCTL_INITIALIZATION_FINISHED = 38,
[299] Fix | Delete
GCRYCTL_INITIALIZATION_FINISHED_P = 39,
[300] Fix | Delete
GCRYCTL_ANY_INITIALIZATION_P = 40,
[301] Fix | Delete
GCRYCTL_SET_CBC_CTS = 41,
[302] Fix | Delete
GCRYCTL_SET_CBC_MAC = 42,
[303] Fix | Delete
/* Note: 43 is not anymore used. */
[304] Fix | Delete
GCRYCTL_ENABLE_QUICK_RANDOM = 44,
[305] Fix | Delete
GCRYCTL_SET_RANDOM_SEED_FILE = 45,
[306] Fix | Delete
GCRYCTL_UPDATE_RANDOM_SEED_FILE = 46,
[307] Fix | Delete
GCRYCTL_SET_THREAD_CBS = 47,
[308] Fix | Delete
GCRYCTL_FAST_POLL = 48,
[309] Fix | Delete
GCRYCTL_SET_RANDOM_DAEMON_SOCKET = 49,
[310] Fix | Delete
GCRYCTL_USE_RANDOM_DAEMON = 50,
[311] Fix | Delete
GCRYCTL_FAKED_RANDOM_P = 51,
[312] Fix | Delete
GCRYCTL_SET_RNDEGD_SOCKET = 52,
[313] Fix | Delete
GCRYCTL_PRINT_CONFIG = 53,
[314] Fix | Delete
GCRYCTL_OPERATIONAL_P = 54,
[315] Fix | Delete
GCRYCTL_FIPS_MODE_P = 55,
[316] Fix | Delete
GCRYCTL_FORCE_FIPS_MODE = 56,
[317] Fix | Delete
GCRYCTL_SELFTEST = 57,
[318] Fix | Delete
/* Note: 58 .. 62 are used internally. */
[319] Fix | Delete
GCRYCTL_DISABLE_HWF = 63,
[320] Fix | Delete
GCRYCTL_SET_ENFORCED_FIPS_FLAG = 64,
[321] Fix | Delete
GCRYCTL_SET_PREFERRED_RNG_TYPE = 65,
[322] Fix | Delete
GCRYCTL_GET_CURRENT_RNG_TYPE = 66,
[323] Fix | Delete
GCRYCTL_DISABLE_LOCKED_SECMEM = 67,
[324] Fix | Delete
GCRYCTL_DISABLE_PRIV_DROP = 68,
[325] Fix | Delete
GCRYCTL_SET_CCM_LENGTHS = 69,
[326] Fix | Delete
GCRYCTL_CLOSE_RANDOM_DEVICE = 70,
[327] Fix | Delete
GCRYCTL_INACTIVATE_FIPS_FLAG = 71,
[328] Fix | Delete
GCRYCTL_REACTIVATE_FIPS_FLAG = 72,
[329] Fix | Delete
GCRYCTL_SET_SBOX = 73,
[330] Fix | Delete
GCRYCTL_DRBG_REINIT = 74,
[331] Fix | Delete
GCRYCTL_SET_TAGLEN = 75,
[332] Fix | Delete
GCRYCTL_GET_TAGLEN = 76,
[333] Fix | Delete
GCRYCTL_REINIT_SYSCALL_CLAMP = 77
[334] Fix | Delete
};
[335] Fix | Delete
[336] Fix | Delete
/* Perform various operations defined by CMD. */
[337] Fix | Delete
gcry_error_t gcry_control (enum gcry_ctl_cmds CMD, ...);
[338] Fix | Delete
[339] Fix | Delete
[340] Fix | Delete
/* S-expression management. */
[341] Fix | Delete
[342] Fix | Delete
/* The object to represent an S-expression as used with the public key
[343] Fix | Delete
functions. */
[344] Fix | Delete
struct gcry_sexp;
[345] Fix | Delete
typedef struct gcry_sexp *gcry_sexp_t;
[346] Fix | Delete
[347] Fix | Delete
#ifndef GCRYPT_NO_DEPRECATED
[348] Fix | Delete
typedef struct gcry_sexp *GCRY_SEXP _GCRY_GCC_ATTR_DEPRECATED;
[349] Fix | Delete
typedef struct gcry_sexp *GcrySexp _GCRY_GCC_ATTR_DEPRECATED;
[350] Fix | Delete
#endif
[351] Fix | Delete
[352] Fix | Delete
/* The possible values for the S-expression format. */
[353] Fix | Delete
enum gcry_sexp_format
[354] Fix | Delete
{
[355] Fix | Delete
GCRYSEXP_FMT_DEFAULT = 0,
[356] Fix | Delete
GCRYSEXP_FMT_CANON = 1,
[357] Fix | Delete
GCRYSEXP_FMT_BASE64 = 2,
[358] Fix | Delete
GCRYSEXP_FMT_ADVANCED = 3
[359] Fix | Delete
};
[360] Fix | Delete
[361] Fix | Delete
/* Create an new S-expression object from BUFFER of size LENGTH and
[362] Fix | Delete
return it in RETSEXP. With AUTODETECT set to 0 the data in BUFFER
[363] Fix | Delete
is expected to be in canonized format. */
[364] Fix | Delete
gcry_error_t gcry_sexp_new (gcry_sexp_t *retsexp,
[365] Fix | Delete
const void *buffer, size_t length,
[366] Fix | Delete
int autodetect);
[367] Fix | Delete
[368] Fix | Delete
/* Same as gcry_sexp_new but allows to pass a FREEFNC which has the
[369] Fix | Delete
effect to transfer ownership of BUFFER to the created object. */
[370] Fix | Delete
gcry_error_t gcry_sexp_create (gcry_sexp_t *retsexp,
[371] Fix | Delete
void *buffer, size_t length,
[372] Fix | Delete
int autodetect, void (*freefnc) (void *));
[373] Fix | Delete
[374] Fix | Delete
/* Scan BUFFER and return a new S-expression object in RETSEXP. This
[375] Fix | Delete
function expects a printf like string in BUFFER. */
[376] Fix | Delete
gcry_error_t gcry_sexp_sscan (gcry_sexp_t *retsexp, size_t *erroff,
[377] Fix | Delete
const char *buffer, size_t length);
[378] Fix | Delete
[379] Fix | Delete
/* Same as gcry_sexp_sscan but expects a string in FORMAT and can thus
[380] Fix | Delete
only be used for certain encodings. */
[381] Fix | Delete
gcry_error_t gcry_sexp_build (gcry_sexp_t *retsexp, size_t *erroff,
[382] Fix | Delete
const char *format, ...);
[383] Fix | Delete
[384] Fix | Delete
/* Like gcry_sexp_build, but uses an array instead of variable
[385] Fix | Delete
function arguments. */
[386] Fix | Delete
gcry_error_t gcry_sexp_build_array (gcry_sexp_t *retsexp, size_t *erroff,
[387] Fix | Delete
const char *format, void **arg_list);
[388] Fix | Delete
[389] Fix | Delete
/* Release the S-expression object SEXP */
[390] Fix | Delete
void gcry_sexp_release (gcry_sexp_t sexp);
[391] Fix | Delete
[392] Fix | Delete
/* Calculate the length of an canonized S-expression in BUFFER and
[393] Fix | Delete
check for a valid encoding. */
[394] Fix | Delete
size_t gcry_sexp_canon_len (const unsigned char *buffer, size_t length,
[395] Fix | Delete
size_t *erroff, gcry_error_t *errcode);
[396] Fix | Delete
[397] Fix | Delete
/* Copies the S-expression object SEXP into BUFFER using the format
[398] Fix | Delete
specified in MODE. */
[399] Fix | Delete
size_t gcry_sexp_sprint (gcry_sexp_t sexp, int mode, void *buffer,
[400] Fix | Delete
size_t maxlength);
[401] Fix | Delete
[402] Fix | Delete
/* Dumps the S-expression object A in a format suitable for debugging
[403] Fix | Delete
to Libgcrypt's logging stream. */
[404] Fix | Delete
void gcry_sexp_dump (const gcry_sexp_t a);
[405] Fix | Delete
[406] Fix | Delete
gcry_sexp_t gcry_sexp_cons (const gcry_sexp_t a, const gcry_sexp_t b);
[407] Fix | Delete
gcry_sexp_t gcry_sexp_alist (const gcry_sexp_t *array);
[408] Fix | Delete
gcry_sexp_t gcry_sexp_vlist (const gcry_sexp_t a, ...);
[409] Fix | Delete
gcry_sexp_t gcry_sexp_append (const gcry_sexp_t a, const gcry_sexp_t n);
[410] Fix | Delete
gcry_sexp_t gcry_sexp_prepend (const gcry_sexp_t a, const gcry_sexp_t n);
[411] Fix | Delete
[412] Fix | Delete
/* Scan the S-expression for a sublist with a type (the car of the
[413] Fix | Delete
list) matching the string TOKEN. If TOKLEN is not 0, the token is
[414] Fix | Delete
assumed to be raw memory of this length. The function returns a
[415] Fix | Delete
newly allocated S-expression consisting of the found sublist or
[416] Fix | Delete
`NULL' when not found. */
[417] Fix | Delete
gcry_sexp_t gcry_sexp_find_token (gcry_sexp_t list,
[418] Fix | Delete
const char *tok, size_t toklen);
[419] Fix | Delete
/* Return the length of the LIST. For a valid S-expression this
[420] Fix | Delete
should be at least 1. */
[421] Fix | Delete
int gcry_sexp_length (const gcry_sexp_t list);
[422] Fix | Delete
[423] Fix | Delete
/* Create and return a new S-expression from the element with index
[424] Fix | Delete
NUMBER in LIST. Note that the first element has the index 0. If
[425] Fix | Delete
there is no such element, `NULL' is returned. */
[426] Fix | Delete
gcry_sexp_t gcry_sexp_nth (const gcry_sexp_t list, int number);
[427] Fix | Delete
[428] Fix | Delete
/* Create and return a new S-expression from the first element in
[429] Fix | Delete
LIST; this called the "type" and should always exist and be a
[430] Fix | Delete
string. `NULL' is returned in case of a problem. */
[431] Fix | Delete
gcry_sexp_t gcry_sexp_car (const gcry_sexp_t list);
[432] Fix | Delete
[433] Fix | Delete
/* Create and return a new list form all elements except for the first
[434] Fix | Delete
one. Note, that this function may return an invalid S-expression
[435] Fix | Delete
because it is not guaranteed, that the type exists and is a string.
[436] Fix | Delete
However, for parsing a complex S-expression it might be useful for
[437] Fix | Delete
intermediate lists. Returns `NULL' on error. */
[438] Fix | Delete
gcry_sexp_t gcry_sexp_cdr (const gcry_sexp_t list);
[439] Fix | Delete
[440] Fix | Delete
gcry_sexp_t gcry_sexp_cadr (const gcry_sexp_t list);
[441] Fix | Delete
[442] Fix | Delete
[443] Fix | Delete
/* This function is used to get data from a LIST. A pointer to the
[444] Fix | Delete
actual data with index NUMBER is returned and the length of this
[445] Fix | Delete
data will be stored to DATALEN. If there is no data at the given
[446] Fix | Delete
index or the index represents another list, `NULL' is returned.
[447] Fix | Delete
*Note:* The returned pointer is valid as long as LIST is not
[448] Fix | Delete
modified or released. */
[449] Fix | Delete
const char *gcry_sexp_nth_data (const gcry_sexp_t list, int number,
[450] Fix | Delete
size_t *datalen);
[451] Fix | Delete
[452] Fix | Delete
/* This function is used to get data from a LIST. A malloced buffer to the
[453] Fix | Delete
data with index NUMBER is returned and the length of this
[454] Fix | Delete
data will be stored to RLENGTH. If there is no data at the given
[455] Fix | Delete
index or the index represents another list, `NULL' is returned. */
[456] Fix | Delete
void *gcry_sexp_nth_buffer (const gcry_sexp_t list, int number,
[457] Fix | Delete
size_t *rlength);
[458] Fix | Delete
[459] Fix | Delete
/* This function is used to get and convert data from a LIST. The
[460] Fix | Delete
data is assumed to be a Nul terminated string. The caller must
[461] Fix | Delete
release the returned value using `gcry_free'. If there is no data
[462] Fix | Delete
at the given index, the index represents a list or the value can't
[463] Fix | Delete
be converted to a string, `NULL' is returned. */
[464] Fix | Delete
char *gcry_sexp_nth_string (gcry_sexp_t list, int number);
[465] Fix | Delete
[466] Fix | Delete
/* This function is used to get and convert data from a LIST. This
[467] Fix | Delete
data is assumed to be an MPI stored in the format described by
[468] Fix | Delete
MPIFMT and returned as a standard Libgcrypt MPI. The caller must
[469] Fix | Delete
release this returned value using `gcry_mpi_release'. If there is
[470] Fix | Delete
no data at the given index, the index represents a list or the
[471] Fix | Delete
value can't be converted to an MPI, `NULL' is returned. */
[472] Fix | Delete
gcry_mpi_t gcry_sexp_nth_mpi (gcry_sexp_t list, int number, int mpifmt);
[473] Fix | Delete
[474] Fix | Delete
/* Extract MPIs from an s-expression using a list of parameters. The
[475] Fix | Delete
* names of these parameters are given by the string LIST. Some
[476] Fix | Delete
* special characters may be given to control the conversion:
[477] Fix | Delete
*
[478] Fix | Delete
* + :: Switch to unsigned integer format (default).
[479] Fix | Delete
* - :: Switch to standard signed format.
[480] Fix | Delete
* / :: Switch to opaque format.
[481] Fix | Delete
* & :: Switch to buffer descriptor mode - see below.
[482] Fix | Delete
* ? :: The previous parameter is optional.
[483] Fix | Delete
*
[484] Fix | Delete
* In general parameter names are single letters. To use a string for
[485] Fix | Delete
* a parameter name, enclose the name in single quotes.
[486] Fix | Delete
*
[487] Fix | Delete
* Unless in gcry_buffer_t mode for each parameter name a pointer to
[488] Fix | Delete
* an MPI variable is expected that must be set to NULL prior to
[489] Fix | Delete
* invoking this function, and finally a NULL is expected. Example:
[490] Fix | Delete
*
[491] Fix | Delete
* _gcry_sexp_extract_param (key, NULL, "n/x+ed",
[492] Fix | Delete
* &mpi_n, &mpi_x, &mpi_e, NULL)
[493] Fix | Delete
*
[494] Fix | Delete
* This stores the parameter "N" from KEY as an unsigned MPI into
[495] Fix | Delete
* MPI_N, the parameter "X" as an opaque MPI into MPI_X, and the
[496] Fix | Delete
* parameter "E" again as an unsigned MPI into MPI_E.
[497] Fix | Delete
*
[498] Fix | Delete
* If in buffer descriptor mode a pointer to gcry_buffer_t descriptor
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function