adium 5721:5ef5fe5b5c05: libpurple @ c8e809dffa1d and updated a ...

commits at adium.im commits at adium.im
Wed Oct 23 18:10:37 UTC 2013


details:	http://hg.adium.im/adium/rev/5ef5fe5b5c05
revision:	5721:5ef5fe5b5c05
branch:		adium-1.5.9
author:		Thijs Alkemade <me at thijsalkema.de>
date:		Wed Oct 23 20:04:21 2013 +0200

libpurple @ c8e809dffa1d and updated a number of other dependencies. This includes the patch on https://developer.pidgin.im/ticket/15755.

Fixes #16352
Subject: adium 5722:4ae85ad012cd: More dateformatter fixes, add the required methods to AIAdiumURLProtocol.

details:	http://hg.adium.im/adium/rev/4ae85ad012cd
revision:	5722:4ae85ad012cd
branch:		adium-1.5.9
author:		Thijs Alkemade <me at thijsalkema.de>
date:		Wed Oct 23 20:05:40 2013 +0200

More dateformatter fixes, add the required methods to AIAdiumURLProtocol.
Subject: adium 5723:9b55ac14a8d7: It doesn't look like JSONKit is still maintained. Remove all direct ->isa accesses.

details:	http://hg.adium.im/adium/rev/9b55ac14a8d7
revision:	5723:9b55ac14a8d7
branch:		adium-1.5.9
author:		Thijs Alkemade <me at thijsalkema.de>
date:		Wed Oct 23 20:06:02 2013 +0200

It doesn't look like JSONKit is still maintained. Remove all direct ->isa accesses.

diffs (truncated from 415893 to 1000 lines):

diff -r e1dd334e97f0 -r 9b55ac14a8d7 Frameworks/AIUtilities Framework/Source/NSCalendarDate+ISO8601Unparsing.m
--- a/Frameworks/AIUtilities Framework/Source/NSCalendarDate+ISO8601Unparsing.m	Wed Oct 23 17:52:30 2013 +0200
+++ b/Frameworks/AIUtilities Framework/Source/NSCalendarDate+ISO8601Unparsing.m	Wed Oct 23 20:06:02 2013 +0200
@@ -107,6 +107,7 @@
 	NSString *timeString;
 	if(includeTime) {
 		NSDateFormatter *formatter = [[NSDateFormatter alloc] initWithDateFormat:[@"T%H:%M:%S%z" prepareDateFormatWithTimeSeparator:timeSep] allowNaturalLanguage:NO];
+		[formatter setFormatterBehavior:NSDateFormatterBehavior10_4];
 		timeString = [formatter stringForObjectValue:self];
 		[formatter release];
 	} else
@@ -118,6 +119,7 @@
 	NSString *timeString;
 	if(includeTime) {
 		NSDateFormatter *formatter = [[NSDateFormatter alloc] initWithDateFormat:[@"T%H:%M:%S%z" prepareDateFormatWithTimeSeparator:timeSep] allowNaturalLanguage:NO];
+		[formatter setFormatterBehavior:NSDateFormatterBehavior10_4];
 		timeString = [formatter stringForObjectValue:self];
 		[formatter release];
 	} else
diff -r e1dd334e97f0 -r 9b55ac14a8d7 Frameworks/JSONKit/JSONKit.m
--- a/Frameworks/JSONKit/JSONKit.m	Wed Oct 23 17:52:30 2013 +0200
+++ b/Frameworks/JSONKit/JSONKit.m	Wed Oct 23 20:06:02 2013 +0200
@@ -677,7 +677,7 @@
   NSCParameterAssert((objects != NULL) && (_JKArrayClass != NULL) && (_JKArrayInstanceSize > 0UL));
   JKArray *array = NULL;
   if(JK_EXPECT_T((array = (JKArray *)calloc(1UL, _JKArrayInstanceSize)) != NULL)) { // Directly allocate the JKArray instance via calloc.
-    array->isa      = _JKArrayClass;
+    object_setClass(array, _JKArrayClass);
     if((array = [array init]) == NULL) { return(NULL); }
     array->capacity = count;
     array->count    = count;
@@ -926,7 +926,7 @@
   NSCParameterAssert((keys != NULL) && (keyHashes != NULL) && (objects != NULL) && (_JKDictionaryClass != NULL) && (_JKDictionaryInstanceSize > 0UL));
   JKDictionary *dictionary = NULL;
   if(JK_EXPECT_T((dictionary = (JKDictionary *)calloc(1UL, _JKDictionaryInstanceSize)) != NULL)) { // Directly allocate the JKDictionary instance via calloc.
-    dictionary->isa      = _JKDictionaryClass;
+    object_setClass(dictionary, _JKDictionaryClass);
     if((dictionary = [dictionary init]) == NULL) { return(NULL); }
     dictionary->capacity = _JKDictionaryCapacityForCount(count);
     dictionary->count    = 0UL;
@@ -2560,53 +2560,11 @@
   BOOL rerunningAfterClassFormatter = NO;
  rerunAfterClassFormatter:;
 
-  // XXX XXX XXX XXX
-  //     
-  //     We need to work around a bug in 10.7, which breaks ABI compatibility with Objective-C going back not just to 10.0, but OpenStep and even NextStep.
-  //     
-  //     It has long been documented that "the very first thing that a pointer to an Objective-C object "points to" is a pointer to that objects class".
-  //     
-  //     This is euphemistically called "tagged pointers".  There are a number of highly technical problems with this, most involving long passages from
-  //     the C standard(s).  In short, one can make a strong case, couched from the perspective of the C standard(s), that that 10.7 "tagged pointers" are
-  //     fundamentally Wrong and Broken, and should have never been implemented.  Assuming those points are glossed over, because the change is very clearly
-  //     breaking ABI compatibility, this should have resulted in a minimum of a "minimum version required" bump in various shared libraries to prevent
-  //     causes code that used to work just fine to suddenly break without warning.
-  //
-  //     In fact, the C standard says that the hack below is "undefined behavior"- there is no requirement that the 10.7 tagged pointer hack of setting the
-  //     "lower, unused bits" must be preserved when casting the result to an integer type, but this "works" because for most architectures
-  //     `sizeof(long) == sizeof(void *)` and the compiler uses the same representation for both.  (note: this is informal, not meant to be
-  //     normative or pedantically correct).
-  //     
-  //     In other words, while this "works" for now, technically the compiler is not obligated to do "what we want", and a later version of the compiler
-  //     is not required in any way to produce the same results or behavior that earlier versions of the compiler did for the statement below.
-  //
-  //     Fan-fucking-tastic.
-  //     
-  //     Why not just use `object_getClass()`?  Because `object->isa` reduces to (typically) a *single* instruction.  Calling `object_getClass()` requires
-  //     that the compiler potentially spill registers, establish a function call frame / environment, and finally execute a "jump subroutine" instruction.
-  //     Then, the called subroutine must spend half a dozen instructions in its prolog, however many instructions doing whatever it does, then half a dozen
-  //     instructions in its prolog.  One instruction compared to dozens, maybe a hundred instructions.
-  //     
-  //     Yes, that's one to two orders of magnitude difference.  Which is compelling in its own right.  When going for performance, you're often happy with
-  //     gains in the two to three percent range.
-  //     
-  // XXX XXX XXX XXX
-
-  BOOL workAroundMacOSXABIBreakingBug = NO;
-  if(JK_EXPECT_F(((NSUInteger)object) & 0x1)) { workAroundMacOSXABIBreakingBug = YES; goto slowClassLookup; }
-
-       if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.stringClass))     { isClass = JKClassString;     }
-  else if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.numberClass))     { isClass = JKClassNumber;     }
-  else if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.dictionaryClass)) { isClass = JKClassDictionary; }
-  else if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.arrayClass))      { isClass = JKClassArray;      }
-  else if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.nullClass))       { isClass = JKClassNull;       }
-  else {
-  slowClassLookup:
-         if(JK_EXPECT_T([object isKindOfClass:[NSString     class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.stringClass     = object->isa; } isClass = JKClassString;     }
-    else if(JK_EXPECT_T([object isKindOfClass:[NSNumber     class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.numberClass     = object->isa; } isClass = JKClassNumber;     }
-    else if(JK_EXPECT_T([object isKindOfClass:[NSDictionary class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.dictionaryClass = object->isa; } isClass = JKClassDictionary; }
-    else if(JK_EXPECT_T([object isKindOfClass:[NSArray      class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.arrayClass      = object->isa; } isClass = JKClassArray;      }
-    else if(JK_EXPECT_T([object isKindOfClass:[NSNull       class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.nullClass       = object->isa; } isClass = JKClassNull;       }
+         if(JK_EXPECT_T([object isKindOfClass:[NSString     class]])) { isClass = JKClassString;     }
+    else if(JK_EXPECT_T([object isKindOfClass:[NSNumber     class]])) { isClass = JKClassNumber;     }
+    else if(JK_EXPECT_T([object isKindOfClass:[NSDictionary class]])) { isClass = JKClassDictionary; }
+    else if(JK_EXPECT_T([object isKindOfClass:[NSArray      class]])) { isClass = JKClassArray;      }
+    else if(JK_EXPECT_T([object isKindOfClass:[NSNull       class]])) { isClass = JKClassNull;       }
     else {
       if((rerunningAfterClassFormatter == NO) && (
 #ifdef __BLOCKS__
@@ -2617,7 +2575,6 @@
       if(rerunningAfterClassFormatter == NO) { jk_encode_error(encodeState, @"Unable to serialize object class %@.", NSStringFromClass([encodeCacheObject class])); return(1); }
       else { jk_encode_error(encodeState, @"Unable to serialize object class %@ that was returned by the unsupported class formatter.  Original object class was %@.", (object == NULL) ? @"NULL" : NSStringFromClass([object class]), NSStringFromClass([encodeCacheObject class])); return(1); }
     }
-  }
 
   // This is here for the benefit of the optimizer.  It allows the optimizer to do loop invariant code motion for the JKClassArray
   // and JKClassDictionary cases when printing simple, single characters via jk_encode_write(), which is actually a macro:
@@ -2788,7 +2745,7 @@
           for(id keyObject in enumerateObject) {
             if(JK_EXPECT_T(printComma)) { if(JK_EXPECT_F(jk_encode_write1(encodeState, 0L, ","))) { return(1); } }
             printComma = 1;
-            if(JK_EXPECT_F((keyObject->isa      != encodeState->fastClassLookup.stringClass)) && JK_EXPECT_F(([keyObject   isKindOfClass:[NSString class]] == NO))) { jk_encode_error(encodeState, @"Key must be a string object."); return(1); }
+            if(JK_EXPECT_F((object_getClass(keyObject)      != encodeState->fastClassLookup.stringClass)) && JK_EXPECT_F(([keyObject   isKindOfClass:[NSString class]] == NO))) { jk_encode_error(encodeState, @"Key must be a string object."); return(1); }
             if(JK_EXPECT_F(jk_encode_add_atom_to_buffer(encodeState, keyObject)))                                                        { return(1); }
             if(JK_EXPECT_F(jk_encode_write1(encodeState, 0L, ":")))                                                                      { return(1); }
             if(JK_EXPECT_F(jk_encode_add_atom_to_buffer(encodeState, (void *)CFDictionaryGetValue((CFDictionaryRef)object, keyObject)))) { return(1); }
@@ -2799,7 +2756,7 @@
           for(idx = 0L; idx < dictionaryCount; idx++) {
             if(JK_EXPECT_T(printComma)) { if(JK_EXPECT_F(jk_encode_write1(encodeState, 0L, ","))) { return(1); } }
             printComma = 1;
-            if(JK_EXPECT_F(((id)keys[idx])->isa != encodeState->fastClassLookup.stringClass) && JK_EXPECT_F([(id)keys[idx] isKindOfClass:[NSString class]] == NO)) { jk_encode_error(encodeState, @"Key must be a string object."); return(1); }
+            if(JK_EXPECT_F(object_getClass(((id)keys[idx])) != encodeState->fastClassLookup.stringClass) && JK_EXPECT_F([(id)keys[idx] isKindOfClass:[NSString class]] == NO)) { jk_encode_error(encodeState, @"Key must be a string object."); return(1); }
             if(JK_EXPECT_F(jk_encode_add_atom_to_buffer(encodeState, keys[idx])))    { return(1); }
             if(JK_EXPECT_F(jk_encode_write1(encodeState, 0L, ":")))                  { return(1); }
             if(JK_EXPECT_F(jk_encode_add_atom_to_buffer(encodeState, objects[idx]))) { return(1); }
diff -r e1dd334e97f0 -r 9b55ac14a8d7 Frameworks/libffi.framework/Versions/3.0.13/libffi
Binary file Frameworks/libffi.framework/Versions/3.0.13/libffi has changed
diff -r e1dd334e97f0 -r 9b55ac14a8d7 Frameworks/libgcrypt.framework/Headers
--- a/Frameworks/libgcrypt.framework/Headers	Wed Oct 23 17:52:30 2013 +0200
+++ b/Frameworks/libgcrypt.framework/Headers	Wed Oct 23 20:06:02 2013 +0200
@@ -1,1 +1,1 @@
-Versions/1.5.2/Headers
\ No newline at end of file
+Versions/1.5.3/Headers
\ No newline at end of file
diff -r e1dd334e97f0 -r 9b55ac14a8d7 Frameworks/libgcrypt.framework/Resources
--- a/Frameworks/libgcrypt.framework/Resources	Wed Oct 23 17:52:30 2013 +0200
+++ b/Frameworks/libgcrypt.framework/Resources	Wed Oct 23 20:06:02 2013 +0200
@@ -1,1 +1,1 @@
-Versions/1.5.2/Resources
\ No newline at end of file
+Versions/1.5.3/Resources
\ No newline at end of file
diff -r e1dd334e97f0 -r 9b55ac14a8d7 Frameworks/libgcrypt.framework/Versions/1.5.2/Headers/gcrypt-module.h
--- a/Frameworks/libgcrypt.framework/Versions/1.5.2/Headers/gcrypt-module.h	Wed Oct 23 17:52:30 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,240 +0,0 @@
-/* gcrypt-module.h - GNU Cryptographic Library Interface
-   Copyright (C) 2003, 2007 Free Software Foundation, Inc.
-
-   This file is part of Libgcrypt.
-
-   Libgcrypt is free software; you can redistribute it and/or modify
-   it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of
-   the License, or (at your option) any later version.
-
-   Libgcrypt is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-/*
-   This file contains the necessary declarations/definitions for
-   working with Libgcrypt modules.
- */
-
-#ifndef _GCRYPT_MODULE_H
-#define _GCRYPT_MODULE_H
-
-#ifdef __cplusplus
-extern "C" {
-#if 0 /* keep Emacsens's auto-indent happy */
-}
-#endif
-#endif
-
-/* The interfaces using the module system reserve a certain range of
-   IDs for application use.  These IDs are not valid within Libgcrypt
-   but Libgcrypt makes sure never to allocate such a module ID.  */
-#define GCRY_MODULE_ID_USER      1024
-#define GCRY_MODULE_ID_USER_LAST 4095
-
-
-/* This type represents a `module'.  */
-typedef struct gcry_module *gcry_module_t;
-
-/* Check that the library fulfills the version requirement.  */
-
-/* Type for the cipher_setkey function.  */
-typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c,
-						 const unsigned char *key,
-						 unsigned keylen);
-
-/* Type for the cipher_encrypt function.  */
-typedef void (*gcry_cipher_encrypt_t) (void *c,
-				       unsigned char *outbuf,
-				       const unsigned char *inbuf);
-
-/* Type for the cipher_decrypt function.  */
-typedef void (*gcry_cipher_decrypt_t) (void *c,
-				       unsigned char *outbuf,
-				       const unsigned char *inbuf);
-
-/* Type for the cipher_stencrypt function.  */
-typedef void (*gcry_cipher_stencrypt_t) (void *c,
-					 unsigned char *outbuf,
-					 const unsigned char *inbuf,
-					 unsigned int n);
-
-/* Type for the cipher_stdecrypt function.  */
-typedef void (*gcry_cipher_stdecrypt_t) (void *c,
-					 unsigned char *outbuf,
-					 const unsigned char *inbuf,
-					 unsigned int n);
-
-typedef struct gcry_cipher_oid_spec
-{
-  const char *oid;
-  int mode;
-} gcry_cipher_oid_spec_t;
-
-/* Module specification structure for ciphers.  */
-typedef struct gcry_cipher_spec
-{
-  const char *name;
-  const char **aliases;
-  gcry_cipher_oid_spec_t *oids;
-  size_t blocksize;
-  size_t keylen;
-  size_t contextsize;
-  gcry_cipher_setkey_t setkey;
-  gcry_cipher_encrypt_t encrypt;
-  gcry_cipher_decrypt_t decrypt;
-  gcry_cipher_stencrypt_t stencrypt;
-  gcry_cipher_stdecrypt_t stdecrypt;
-} gcry_cipher_spec_t;
-
-/* Register a new cipher module whose specification can be found in
-   CIPHER.  On success, a new algorithm ID is stored in ALGORITHM_ID
-   and a pointer representing this module is stored in MODULE.  */
-gcry_error_t gcry_cipher_register (gcry_cipher_spec_t *cipher,
-				   int *algorithm_id,
-				   gcry_module_t *module)
-  /* */  _GCRY_ATTR_INTERNAL;
-
-
-/* Unregister the cipher identified by MODULE, which must have been
-   registered with gcry_cipher_register.  */
-void gcry_cipher_unregister (gcry_module_t module)
-  /* */  _GCRY_ATTR_INTERNAL;
-
-/* ********************** */
-
-/* Type for the pk_generate function.  */
-typedef gcry_err_code_t (*gcry_pk_generate_t) (int algo,
-					       unsigned int nbits,
-					       unsigned long use_e,
-					       gcry_mpi_t *skey,
-					       gcry_mpi_t **retfactors);
-
-/* Type for the pk_check_secret_key function.  */
-typedef gcry_err_code_t (*gcry_pk_check_secret_key_t) (int algo,
-						       gcry_mpi_t *skey);
-
-/* Type for the pk_encrypt function.  */
-typedef gcry_err_code_t (*gcry_pk_encrypt_t) (int algo,
-					      gcry_mpi_t *resarr,
-					      gcry_mpi_t data,
-					      gcry_mpi_t *pkey,
-					      int flags);
-
-/* Type for the pk_decrypt function.  */
-typedef gcry_err_code_t (*gcry_pk_decrypt_t) (int algo,
-					      gcry_mpi_t *result,
-					      gcry_mpi_t *data,
-					      gcry_mpi_t *skey,
-					      int flags);
-
-/* Type for the pk_sign function.  */
-typedef gcry_err_code_t (*gcry_pk_sign_t) (int algo,
-					   gcry_mpi_t *resarr,
-					   gcry_mpi_t data,
-					   gcry_mpi_t *skey);
-
-/* Type for the pk_verify function.  */
-typedef gcry_err_code_t (*gcry_pk_verify_t) (int algo,
-					     gcry_mpi_t hash,
-					     gcry_mpi_t *data,
-					     gcry_mpi_t *pkey,
-					     int (*cmp) (void *, gcry_mpi_t),
-					     void *opaquev);
-
-/* Type for the pk_get_nbits function.  */
-typedef unsigned (*gcry_pk_get_nbits_t) (int algo, gcry_mpi_t *pkey);
-
-/* Module specification structure for message digests.  */
-typedef struct gcry_pk_spec
-{
-  const char *name;
-  const char **aliases;
-  const char *elements_pkey;
-  const char *elements_skey;
-  const char *elements_enc;
-  const char *elements_sig;
-  const char *elements_grip;
-  int use;
-  gcry_pk_generate_t generate;
-  gcry_pk_check_secret_key_t check_secret_key;
-  gcry_pk_encrypt_t encrypt;
-  gcry_pk_decrypt_t decrypt;
-  gcry_pk_sign_t sign;
-  gcry_pk_verify_t verify;
-  gcry_pk_get_nbits_t get_nbits;
-} gcry_pk_spec_t;
-
-/* Register a new pubkey module whose specification can be found in
-   PUBKEY.  On success, a new algorithm ID is stored in ALGORITHM_ID
-   and a pointer representhing this module is stored in MODULE.  */
-gcry_error_t gcry_pk_register (gcry_pk_spec_t *pubkey,
-			       unsigned int *algorithm_id,
-			       gcry_module_t *module)
-  /* */  _GCRY_ATTR_INTERNAL;
-
-/* Unregister the pubkey identified by ID, which must have been
-   registered with gcry_pk_register.  */
-void gcry_pk_unregister (gcry_module_t module)
-  /* */  _GCRY_ATTR_INTERNAL;
-
-/* ********************** */
-
-/* Type for the md_init function.  */
-typedef void (*gcry_md_init_t) (void *c);
-
-/* Type for the md_write function.  */
-typedef void (*gcry_md_write_t) (void *c, const void *buf, size_t nbytes);
-
-/* Type for the md_final function.  */
-typedef void (*gcry_md_final_t) (void *c);
-
-/* Type for the md_read function.  */
-typedef unsigned char *(*gcry_md_read_t) (void *c);
-
-typedef struct gcry_md_oid_spec
-{
-  const char *oidstring;
-} gcry_md_oid_spec_t;
-
-/* Module specification structure for message digests.  */
-typedef struct gcry_md_spec
-{
-  const char *name;
-  unsigned char *asnoid;
-  int asnlen;
-  gcry_md_oid_spec_t *oids;
-  int mdlen;
-  gcry_md_init_t init;
-  gcry_md_write_t write;
-  gcry_md_final_t final;
-  gcry_md_read_t read;
-  size_t contextsize; /* allocate this amount of context */
-} gcry_md_spec_t;
-
-/* Register a new digest module whose specification can be found in
-   DIGEST.  On success, a new algorithm ID is stored in ALGORITHM_ID
-   and a pointer representhing this module is stored in MODULE.  */
-gcry_error_t gcry_md_register (gcry_md_spec_t *digest,
-			       unsigned int *algorithm_id,
-			       gcry_module_t *module)
-  /* */  _GCRY_ATTR_INTERNAL;
-
-/* Unregister the digest identified by ID, which must have been
-   registered with gcry_digest_register.  */
-void gcry_md_unregister (gcry_module_t module)
-  /* */  _GCRY_ATTR_INTERNAL;
-
-#if 0 /* keep Emacsens's auto-indent happy */
-{
-#endif
-#ifdef __cplusplus
-}
-#endif
-#endif
diff -r e1dd334e97f0 -r 9b55ac14a8d7 Frameworks/libgcrypt.framework/Versions/1.5.2/Headers/gcrypt.h
--- a/Frameworks/libgcrypt.framework/Versions/1.5.2/Headers/gcrypt.h	Wed Oct 23 17:52:30 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1925 +0,0 @@
-/* gcrypt.h -  GNU Cryptographic Library Interface              -*- c -*-
-   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006
-                 2007, 2008, 2009, 2010, 2011,
-                 2012  Free Software Foundation, Inc.
-   Copyright (C) 2012, 2013  g10 Code GmbH
-
-   This file is part of Libgcrypt.
-
-   Libgcrypt is free software; you can redistribute it and/or modify
-   it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of
-   the License, or (at your option) any later version.
-
-   Libgcrypt is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this program; if not, see <http://www.gnu.org/licenses/>.
-
-   File: src/gcrypt.h.  Generated from gcrypt.h.in by configure. */
-
-#ifndef _GCRYPT_H
-#define _GCRYPT_H
-
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-
-#include <gpg-error.h>
-
-#include <sys/types.h>
-
-#if defined _WIN32 || defined __WIN32__
-# include <winsock2.h>
-# include <ws2tcpip.h>
-# include <time.h>
-# ifndef __GNUC__
-  typedef long ssize_t;
-  typedef int  pid_t;
-# endif /*!__GNUC__*/
-#else
-# include <sys/socket.h>
-# include <sys/time.h>
-# include <sys/select.h>
-#endif /*!_WIN32*/
-
-typedef socklen_t gcry_socklen_t;
-
-/* This is required for error code compatibility. */
-#define _GCRY_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_GCRYPT
-
-#ifdef __cplusplus
-extern "C" {
-#if 0 /* (Keep Emacsens' auto-indent happy.) */
-}
-#endif
-#endif
-
-/* The version of this header should match the one of the library. It
-   should not be used by a program because gcry_check_version() should
-   return the same version.  The purpose of this macro is to let
-   autoconf (using the AM_PATH_GCRYPT macro) check that this header
-   matches the installed library.  */
-#define GCRYPT_VERSION "1.5.2"
-
-/* The version number of this header.  It may be used to handle minor
-   API incompatibilities.  */
-#define GCRYPT_VERSION_NUMBER 0x010502
-
-
-/* Internal: We can't use the convenience macros for the multi
-   precision integer functions when building this library. */
-#ifdef _GCRYPT_IN_LIBGCRYPT
-#ifndef GCRYPT_NO_MPI_MACROS
-#define GCRYPT_NO_MPI_MACROS 1
-#endif
-#endif
-
-/* We want to use gcc attributes when possible.  Warning: Don't use
-   these macros in your programs: As indicated by the leading
-   underscore they are subject to change without notice. */
-#ifdef __GNUC__
-
-#define _GCRY_GCC_VERSION (__GNUC__ * 10000 \
-                             + __GNUC_MINOR__ * 100 \
-                             + __GNUC_PATCHLEVEL__)
-
-#if _GCRY_GCC_VERSION >= 30100
-#define _GCRY_GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__))
-#endif
-
-#if _GCRY_GCC_VERSION >= 29600
-#define _GCRY_GCC_ATTR_PURE  __attribute__ ((__pure__))
-#endif
-
-#if _GCRY_GCC_VERSION >= 30200
-#define _GCRY_GCC_ATTR_MALLOC  __attribute__ ((__malloc__))
-#endif
-
-#endif /*__GNUC__*/
-
-#ifndef _GCRY_GCC_ATTR_DEPRECATED
-#define _GCRY_GCC_ATTR_DEPRECATED
-#endif
-#ifndef _GCRY_GCC_ATTR_PURE
-#define _GCRY_GCC_ATTR_PURE
-#endif
-#ifndef _GCRY_GCC_ATTR_MALLOC
-#define _GCRY_GCC_ATTR_MALLOC
-#endif
-
-/* Make up an attribute to mark functions and types as deprecated but
-   allow internal use by Libgcrypt.  */
-#ifdef _GCRYPT_IN_LIBGCRYPT
-#define _GCRY_ATTR_INTERNAL
-#else
-#define _GCRY_ATTR_INTERNAL	_GCRY_GCC_ATTR_DEPRECATED
-#endif
-
-/* Wrappers for the libgpg-error library.  */
-
-typedef gpg_error_t gcry_error_t;
-typedef gpg_err_code_t gcry_err_code_t;
-typedef gpg_err_source_t gcry_err_source_t;
-
-static GPG_ERR_INLINE gcry_error_t
-gcry_err_make (gcry_err_source_t source, gcry_err_code_t code)
-{
-  return gpg_err_make (source, code);
-}
-
-/* The user can define GPG_ERR_SOURCE_DEFAULT before including this
-   file to specify a default source for gpg_error.  */
-#ifndef GCRY_ERR_SOURCE_DEFAULT
-#define GCRY_ERR_SOURCE_DEFAULT  GPG_ERR_SOURCE_USER_1
-#endif
-
-static GPG_ERR_INLINE gcry_error_t
-gcry_error (gcry_err_code_t code)
-{
-  return gcry_err_make (GCRY_ERR_SOURCE_DEFAULT, code);
-}
-
-static GPG_ERR_INLINE gcry_err_code_t
-gcry_err_code (gcry_error_t err)
-{
-  return gpg_err_code (err);
-}
-
-
-static GPG_ERR_INLINE gcry_err_source_t
-gcry_err_source (gcry_error_t err)
-{
-  return gpg_err_source (err);
-}
-
-/* Return a pointer to a string containing a description of the error
-   code in the error value ERR.  */
-const char *gcry_strerror (gcry_error_t err);
-
-/* Return a pointer to a string containing a description of the error
-   source in the error value ERR.  */
-const char *gcry_strsource (gcry_error_t err);
-
-/* Retrieve the error code for the system error ERR.  This returns
-   GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report
-   this).  */
-gcry_err_code_t gcry_err_code_from_errno (int err);
-
-/* Retrieve the system error for the error code CODE.  This returns 0
-   if CODE is not a system error code.  */
-int gcry_err_code_to_errno (gcry_err_code_t code);
-
-/* Return an error value with the error source SOURCE and the system
-   error ERR.  */
-gcry_error_t gcry_err_make_from_errno (gcry_err_source_t source, int err);
-
-/* Return an error value with the system error ERR.  */
-gcry_err_code_t gcry_error_from_errno (int err);
-
-
-/* This enum is deprecated; it is only declared for the sake of
-   complete API compatibility.  */
-enum gcry_thread_option
-  {
-    _GCRY_THREAD_OPTION_DUMMY
-  } _GCRY_GCC_ATTR_DEPRECATED;
-
-
-/* Constants defining the thread model to use.  Used with the OPTION
-   field of the struct gcry_thread_cbs.  */
-#define GCRY_THREAD_OPTION_DEFAULT  0
-#define GCRY_THREAD_OPTION_USER     1
-#define GCRY_THREAD_OPTION_PTH      2
-#define GCRY_THREAD_OPTION_PTHREAD  3
-
-/* The version number encoded in the OPTION field of the struct
-   gcry_thread_cbs.  */
-#define GCRY_THREAD_OPTION_VERSION  0
-
-/* Wrapper for struct ath_ops.  */
-struct gcry_thread_cbs
-{
-  /* The OPTION field encodes the thread model and the version number
-     of this structure.
-       Bits  7 - 0  are used for the thread model
-       Bits 15 - 8  are used for the version number.
-  */
-  unsigned int option;
-
-  int (*init) (void);
-  int (*mutex_init) (void **priv);
-  int (*mutex_destroy) (void **priv);
-  int (*mutex_lock) (void **priv);
-  int (*mutex_unlock) (void **priv);
-  ssize_t (*read) (int fd, void *buf, size_t nbytes);
-  ssize_t (*write) (int fd, const void *buf, size_t nbytes);
-#ifdef _WIN32
-  ssize_t (*select) (int nfd, void *rset, void *wset, void *eset,
-		     struct timeval *timeout);
-  ssize_t (*waitpid) (pid_t pid, int *status, int options);
-  int (*accept) (int s, void  *addr, int *length_ptr);
-  int (*connect) (int s, void *addr, gcry_socklen_t length);
-  int (*sendmsg) (int s, const void *msg, int flags);
-  int (*recvmsg) (int s, void *msg, int flags);
-#else
-  ssize_t (*select) (int nfd, fd_set *rset, fd_set *wset, fd_set *eset,
-		     struct timeval *timeout);
-  ssize_t (*waitpid) (pid_t pid, int *status, int options);
-  int (*accept) (int s, struct sockaddr *addr, gcry_socklen_t *length_ptr);
-  int (*connect) (int s, struct sockaddr *addr, gcry_socklen_t length);
-  int (*sendmsg) (int s, const struct msghdr *msg, int flags);
-  int (*recvmsg) (int s, struct msghdr *msg, int flags);
-#endif
-};
-
-#ifdef _WIN32
-# define _GCRY_THREAD_OPTION_PTH_IMPL_NET				      \
-static ssize_t gcry_pth_select (int nfd, void *rset, void *wset,	      \
-				void *eset, struct timeval *timeout)	      \
-  { return pth_select (nfd, rset, wset, eset, timeout); }		      \
-static ssize_t gcry_pth_waitpid (pid_t pid, int *status, int options)	      \
-  { return pth_waitpid (pid, status, options); }			      \
-static int gcry_pth_accept (int s, void *addr,                                \
-			    gcry_socklen_t *length_ptr)			      \
-  { return pth_accept (s, addr, length_ptr); }				      \
-static int gcry_pth_connect (int s, void *addr,		                      \
-			     gcry_socklen_t length)			      \
-  { return pth_connect (s, addr, length); }
-#else /*!_WIN32*/
-# define _GCRY_THREAD_OPTION_PTH_IMPL_NET				      \
-static ssize_t gcry_pth_select (int nfd, fd_set *rset, fd_set *wset,	      \
-				fd_set *eset, struct timeval *timeout)	      \
-  { return pth_select (nfd, rset, wset, eset, timeout); }		      \
-static ssize_t gcry_pth_waitpid (pid_t pid, int *status, int options)	      \
-  { return pth_waitpid (pid, status, options); }			      \
-static int gcry_pth_accept (int s, struct sockaddr *addr,		      \
-			    gcry_socklen_t *length_ptr)			      \
-  { return pth_accept (s, addr, length_ptr); }				      \
-static int gcry_pth_connect (int s, struct sockaddr *addr,		      \
-			     gcry_socklen_t length)			      \
-  { return pth_connect (s, addr, length); }
-#endif /*!_WIN32*/
-
-
-
-#define GCRY_THREAD_OPTION_PTH_IMPL					      \
-static int gcry_pth_init (void)						      \
-{ return (pth_init () == FALSE) ? errno : 0; }				      \
-static int gcry_pth_mutex_init (void **priv)				      \
-{									      \
-  int err = 0;								      \
-  pth_mutex_t *lock = malloc (sizeof (pth_mutex_t));			      \
-									      \
-  if (!lock)								      \
-    err = ENOMEM;							      \
-  if (!err)								      \
-    {									      \
-      err = pth_mutex_init (lock);					      \
-      if (err == FALSE)							      \
-	err = errno;							      \
-      else								      \
-	err = 0;							      \
-      if (err)								      \
-	free (lock);							      \
-      else								      \
-	*priv = lock;							      \
-    }									      \
-  return err;								      \
-}									      \
-static int gcry_pth_mutex_destroy (void **lock)				      \
-  { /* GNU Pth has no destructor function.  */ free (*lock); return 0; }      \
-static int gcry_pth_mutex_lock (void **lock)				      \
-  { return ((pth_mutex_acquire (*lock, 0, NULL)) == FALSE)		      \
-      ? errno : 0; }							      \
-static int gcry_pth_mutex_unlock (void **lock)				      \
-  { return ((pth_mutex_release (*lock)) == FALSE)			      \
-      ? errno : 0; }							      \
-static ssize_t gcry_pth_read (int fd, void *buf, size_t nbytes)		      \
-  { return pth_read (fd, buf, nbytes); }				      \
-static ssize_t gcry_pth_write (int fd, const void *buf, size_t nbytes)	      \
-  { return pth_write (fd, buf, nbytes); }				      \
-_GCRY_THREAD_OPTION_PTH_IMPL_NET                                              \
-									      \
-/* Note: GNU Pth is missing pth_sendmsg and pth_recvmsg.  */		      \
-static struct gcry_thread_cbs gcry_threads_pth = {                            \
-  (GCRY_THREAD_OPTION_PTH | (GCRY_THREAD_OPTION_VERSION << 8)),               \
-  gcry_pth_init, gcry_pth_mutex_init, gcry_pth_mutex_destroy,		      \
-  gcry_pth_mutex_lock, gcry_pth_mutex_unlock, gcry_pth_read, gcry_pth_write,  \
-  gcry_pth_select, gcry_pth_waitpid, gcry_pth_accept, gcry_pth_connect,       \
-  NULL, NULL }
-
-
-#define GCRY_THREAD_OPTION_PTHREAD_IMPL					      \
-static int gcry_pthread_mutex_init (void **priv)			      \
-{									      \
-  int err = 0;								      \
-  pthread_mutex_t *lock = (pthread_mutex_t*)malloc (sizeof (pthread_mutex_t));\
-									      \
-  if (!lock)								      \
-    err = ENOMEM;							      \
-  if (!err)								      \
-    {									      \
-      err = pthread_mutex_init (lock, NULL);				      \
-      if (err)								      \
-	free (lock);							      \
-      else								      \
-	*priv = lock;							      \
-    }									      \
-  return err;								      \
-}									      \
-static int gcry_pthread_mutex_destroy (void **lock)			      \
-  { int err = pthread_mutex_destroy ((pthread_mutex_t*)*lock);                \
-    free (*lock); return err; }                                               \
-static int gcry_pthread_mutex_lock (void **lock)			      \
-  { return pthread_mutex_lock ((pthread_mutex_t*)*lock); }		      \
-static int gcry_pthread_mutex_unlock (void **lock)			      \
-  { return pthread_mutex_unlock ((pthread_mutex_t*)*lock); }		      \
-									      \
-static struct gcry_thread_cbs gcry_threads_pthread = {			      \
-  (GCRY_THREAD_OPTION_PTHREAD | (GCRY_THREAD_OPTION_VERSION << 8)),           \
-  NULL, gcry_pthread_mutex_init, gcry_pthread_mutex_destroy,		      \
-  gcry_pthread_mutex_lock, gcry_pthread_mutex_unlock,                         \
-  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
-
-
-/* The data object used to hold a multi precision integer.  */
-struct gcry_mpi;
-typedef struct gcry_mpi *gcry_mpi_t;
-
-#ifndef GCRYPT_NO_DEPRECATED
-typedef struct gcry_mpi *GCRY_MPI _GCRY_GCC_ATTR_DEPRECATED;
-typedef struct gcry_mpi *GcryMPI _GCRY_GCC_ATTR_DEPRECATED;
-#endif
-
-
-
-/* Check that the library fulfills the version requirement.  */
-const char *gcry_check_version (const char *req_version);
-
-/* Codes for function dispatchers.  */
-
-/* Codes used with the gcry_control function. */
-enum gcry_ctl_cmds
-  {
-    GCRYCTL_SET_KEY  = 1,
-    GCRYCTL_SET_IV   = 2,
-    GCRYCTL_CFB_SYNC = 3,
-    GCRYCTL_RESET    = 4,   /* e.g. for MDs */
-    GCRYCTL_FINALIZE = 5,
-    GCRYCTL_GET_KEYLEN = 6,
-    GCRYCTL_GET_BLKLEN = 7,
-    GCRYCTL_TEST_ALGO = 8,
-    GCRYCTL_IS_SECURE = 9,
-    GCRYCTL_GET_ASNOID = 10,
-    GCRYCTL_ENABLE_ALGO = 11,
-    GCRYCTL_DISABLE_ALGO = 12,
-    GCRYCTL_DUMP_RANDOM_STATS = 13,
-    GCRYCTL_DUMP_SECMEM_STATS = 14,
-    GCRYCTL_GET_ALGO_NPKEY    = 15,
-    GCRYCTL_GET_ALGO_NSKEY    = 16,
-    GCRYCTL_GET_ALGO_NSIGN    = 17,
-    GCRYCTL_GET_ALGO_NENCR    = 18,
-    GCRYCTL_SET_VERBOSITY     = 19,
-    GCRYCTL_SET_DEBUG_FLAGS   = 20,
-    GCRYCTL_CLEAR_DEBUG_FLAGS = 21,
-    GCRYCTL_USE_SECURE_RNDPOOL= 22,
-    GCRYCTL_DUMP_MEMORY_STATS = 23,
-    GCRYCTL_INIT_SECMEM       = 24,
-    GCRYCTL_TERM_SECMEM       = 25,
-    GCRYCTL_DISABLE_SECMEM_WARN = 27,
-    GCRYCTL_SUSPEND_SECMEM_WARN = 28,
-    GCRYCTL_RESUME_SECMEM_WARN  = 29,
-    GCRYCTL_DROP_PRIVS          = 30,
-    GCRYCTL_ENABLE_M_GUARD      = 31,
-    GCRYCTL_START_DUMP          = 32,
-    GCRYCTL_STOP_DUMP           = 33,
-    GCRYCTL_GET_ALGO_USAGE      = 34,
-    GCRYCTL_IS_ALGO_ENABLED     = 35,
-    GCRYCTL_DISABLE_INTERNAL_LOCKING = 36,
-    GCRYCTL_DISABLE_SECMEM      = 37,
-    GCRYCTL_INITIALIZATION_FINISHED = 38,
-    GCRYCTL_INITIALIZATION_FINISHED_P = 39,
-    GCRYCTL_ANY_INITIALIZATION_P = 40,
-    GCRYCTL_SET_CBC_CTS = 41,
-    GCRYCTL_SET_CBC_MAC = 42,
-    GCRYCTL_SET_CTR = 43,
-    GCRYCTL_ENABLE_QUICK_RANDOM = 44,
-    GCRYCTL_SET_RANDOM_SEED_FILE = 45,
-    GCRYCTL_UPDATE_RANDOM_SEED_FILE = 46,
-    GCRYCTL_SET_THREAD_CBS = 47,
-    GCRYCTL_FAST_POLL = 48,
-    GCRYCTL_SET_RANDOM_DAEMON_SOCKET = 49,
-    GCRYCTL_USE_RANDOM_DAEMON = 50,
-    GCRYCTL_FAKED_RANDOM_P = 51,
-    GCRYCTL_SET_RNDEGD_SOCKET = 52,
-    GCRYCTL_PRINT_CONFIG = 53,
-    GCRYCTL_OPERATIONAL_P = 54,
-    GCRYCTL_FIPS_MODE_P = 55,
-    GCRYCTL_FORCE_FIPS_MODE = 56,
-    GCRYCTL_SELFTEST = 57,
-    /* Note: 58 .. 62 are used internally.  */
-    GCRYCTL_DISABLE_HWF = 63,
-    GCRYCTL_SET_ENFORCED_FIPS_FLAG = 64
-  };
-
-/* Perform various operations defined by CMD. */
-gcry_error_t gcry_control (enum gcry_ctl_cmds CMD, ...);
-
-
-/* S-expression management. */
-
-/* The object to represent an S-expression as used with the public key
-   functions.  */
-struct gcry_sexp;
-typedef struct gcry_sexp *gcry_sexp_t;
-
-#ifndef GCRYPT_NO_DEPRECATED
-typedef struct gcry_sexp *GCRY_SEXP _GCRY_GCC_ATTR_DEPRECATED;
-typedef struct gcry_sexp *GcrySexp _GCRY_GCC_ATTR_DEPRECATED;
-#endif
-
-/* The possible values for the S-expression format. */
-enum gcry_sexp_format
-  {
-    GCRYSEXP_FMT_DEFAULT   = 0,
-    GCRYSEXP_FMT_CANON     = 1,
-    GCRYSEXP_FMT_BASE64    = 2,
-    GCRYSEXP_FMT_ADVANCED  = 3
-  };
-
-/* Create an new S-expression object from BUFFER of size LENGTH and
-   return it in RETSEXP.  With AUTODETECT set to 0 the data in BUFFER
-   is expected to be in canonized format.  */
-gcry_error_t gcry_sexp_new (gcry_sexp_t *retsexp,
-                            const void *buffer, size_t length,
-                            int autodetect);
-
- /* Same as gcry_sexp_new but allows to pass a FREEFNC which has the
-    effect to transfer ownership of BUFFER to the created object.  */
-gcry_error_t gcry_sexp_create (gcry_sexp_t *retsexp,
-                               void *buffer, size_t length,
-                               int autodetect, void (*freefnc) (void *));
-
-/* Scan BUFFER and return a new S-expression object in RETSEXP.  This
-   function expects a printf like string in BUFFER.  */
-gcry_error_t gcry_sexp_sscan (gcry_sexp_t *retsexp, size_t *erroff,
-                              const char *buffer, size_t length);
-
-/* Same as gcry_sexp_sscan but expects a string in FORMAT and can thus
-   only be used for certain encodings.  */
-gcry_error_t gcry_sexp_build (gcry_sexp_t *retsexp, size_t *erroff,
-                              const char *format, ...);
-
-/* Like gcry_sexp_build, but uses an array instead of variable
-   function arguments.  */
-gcry_error_t gcry_sexp_build_array (gcry_sexp_t *retsexp, size_t *erroff,
-				    const char *format, void **arg_list);
-
-/* Release the S-expression object SEXP */
-void gcry_sexp_release (gcry_sexp_t sexp);
-
-/* Calculate the length of an canonized S-expresion in BUFFER and
-   check for a valid encoding. */
-size_t gcry_sexp_canon_len (const unsigned char *buffer, size_t length,
-                            size_t *erroff, gcry_error_t *errcode);
-
-/* Copies the S-expression object SEXP into BUFFER using the format
-   specified in MODE.  */
-size_t gcry_sexp_sprint (gcry_sexp_t sexp, int mode, void *buffer,
-                         size_t maxlength);
-
-/* Dumps the S-expression object A in a format suitable for debugging
-   to Libgcrypt's logging stream.  */
-void gcry_sexp_dump (const gcry_sexp_t a);
-
-gcry_sexp_t gcry_sexp_cons (const gcry_sexp_t a, const gcry_sexp_t b);
-gcry_sexp_t gcry_sexp_alist (const gcry_sexp_t *array);
-gcry_sexp_t gcry_sexp_vlist (const gcry_sexp_t a, ...);
-gcry_sexp_t gcry_sexp_append (const gcry_sexp_t a, const gcry_sexp_t n);
-gcry_sexp_t gcry_sexp_prepend (const gcry_sexp_t a, const gcry_sexp_t n);
-
-/* Scan the S-expression for a sublist with a type (the car of the
-   list) matching the string TOKEN.  If TOKLEN is not 0, the token is
-   assumed to be raw memory of this length.  The function returns a
-   newly allocated S-expression consisting of the found sublist or
-   `NULL' when not found.  */
-gcry_sexp_t gcry_sexp_find_token (gcry_sexp_t list,
-                                const char *tok, size_t toklen);
-/* Return the length of the LIST.  For a valid S-expression this
-   should be at least 1.  */
-int gcry_sexp_length (const gcry_sexp_t list);
-
-/* Create and return a new S-expression from the element with index
-   NUMBER in LIST.  Note that the first element has the index 0.  If
-   there is no such element, `NULL' is returned.  */
-gcry_sexp_t gcry_sexp_nth (const gcry_sexp_t list, int number);
-
-/* Create and return a new S-expression from the first element in
-   LIST; this called the "type" and should always exist and be a
-   string. `NULL' is returned in case of a problem.  */
-gcry_sexp_t gcry_sexp_car (const gcry_sexp_t list);
-
-/* Create and return a new list form all elements except for the first
-   one.  Note, that this function may return an invalid S-expression
-   because it is not guaranteed, that the type exists and is a string.
-   However, for parsing a complex S-expression it might be useful for
-   intermediate lists.  Returns `NULL' on error.  */
-gcry_sexp_t gcry_sexp_cdr (const gcry_sexp_t list);
-
-gcry_sexp_t gcry_sexp_cadr (const gcry_sexp_t list);
-
-
-/* This function is used to get data from a LIST.  A pointer to the
-   actual data with index NUMBER is returned and the length of this
-   data will be stored to DATALEN.  If there is no data at the given
-   index or the index represents another list, `NULL' is returned.
-   *Note:* The returned pointer is valid as long as LIST is not
-   modified or released.  */
-const char *gcry_sexp_nth_data (const gcry_sexp_t list, int number,
-                                size_t *datalen);
-
-/* This function is used to get and convert data from a LIST.  The
-   data is assumed to be a Nul terminated string.  The caller must
-   release the returned value using `gcry_free'.  If there is no data
-   at the given index, the index represents a list or the value can't
-   be converted to a string, `NULL' is returned.  */
-char *gcry_sexp_nth_string (gcry_sexp_t list, int number);
-
-/* This function is used to get and convert data from a LIST. This
-   data is assumed to be an MPI stored in the format described by
-   MPIFMT and returned as a standard Libgcrypt MPI.  The caller must
-   release this returned value using `gcry_mpi_release'.  If there is
-   no data at the given index, the index represents a list or the
-   value can't be converted to an MPI, `NULL' is returned.  */
-gcry_mpi_t gcry_sexp_nth_mpi (gcry_sexp_t list, int number, int mpifmt);
-
-
-
-/*******************************************
- *                                         *
- *  Multi Precision Integer Functions      *
- *                                         *
- *******************************************/
-
-/* Different formats of external big integer representation. */
-enum gcry_mpi_format
-  {
-    GCRYMPI_FMT_NONE= 0,
-    GCRYMPI_FMT_STD = 1,    /* Twos complement stored without length.  */
-    GCRYMPI_FMT_PGP = 2,    /* As used by OpenPGP (unsigned only).  */
-    GCRYMPI_FMT_SSH = 3,    /* As used by SSH (like STD but with length).  */
-    GCRYMPI_FMT_HEX = 4,    /* Hex format. */
-    GCRYMPI_FMT_USG = 5     /* Like STD but unsigned. */
-  };
-
-/* Flags used for creating big integers.  */
-enum gcry_mpi_flag
-  {
-    GCRYMPI_FLAG_SECURE = 1,  /* Allocate the number in "secure" memory.  */
-    GCRYMPI_FLAG_OPAQUE = 2   /* The number is not a real one but just
-                                 a way to store some bytes.  This is
-                                 useful for encrypted big integers.  */
-  };
-
-
-/* Allocate a new big integer object, initialize it with 0 and
-   initially allocate memory for a number of at least NBITS. */
-gcry_mpi_t gcry_mpi_new (unsigned int nbits);
-
-/* Same as gcry_mpi_new() but allocate in "secure" memory. */
-gcry_mpi_t gcry_mpi_snew (unsigned int nbits);
-
-/* Release the number A and free all associated resources. */
-void gcry_mpi_release (gcry_mpi_t a);
-
-/* Create a new number with the same value as A. */
-gcry_mpi_t gcry_mpi_copy (const gcry_mpi_t a);
-
-/* Store the big integer value U in W. */
-gcry_mpi_t gcry_mpi_set (gcry_mpi_t w, const gcry_mpi_t u);
-
-/* Store the unsigned integer value U in W. */
-gcry_mpi_t gcry_mpi_set_ui (gcry_mpi_t w, unsigned long u);
-
-/* Swap the values of A and B. */
-void gcry_mpi_swap (gcry_mpi_t a, gcry_mpi_t b);




More information about the commits mailing list