diff options
author | Werner Koch <wk@gnupg.org> | 1997-12-19 12:41:47 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1997-12-19 12:41:47 +0100 |
commit | ee8d92fefa5902f97e92856b9c657fb18d0dd93e (patch) | |
tree | cf86cf2d45d7dbeb3f8c01a53402435ac1257f88 /include | |
parent | added some stuff for signing keys (diff) | |
download | gnupg2-ee8d92fefa5902f97e92856b9c657fb18d0dd93e.tar.xz gnupg2-ee8d92fefa5902f97e92856b9c657fb18d0dd93e.zip |
better prime number generator. improved ELG key generation
Diffstat (limited to 'include')
-rw-r--r-- | include/cipher.h | 1 | ||||
-rw-r--r-- | include/iobuf.h | 1 | ||||
-rw-r--r-- | include/mpi.h | 1 | ||||
-rw-r--r-- | include/types.h | 61 |
4 files changed, 34 insertions, 30 deletions
diff --git a/include/cipher.h b/include/cipher.h index 2fab4daa2..ed553dcb2 100644 --- a/include/cipher.h +++ b/include/cipher.h @@ -113,6 +113,7 @@ extern ushort small_prime_numbers[]; /*-- primegen.c --*/ MPI generate_secret_prime( unsigned nbits ); MPI generate_public_prime( unsigned nbits ); +MPI generate_elg_prime( unsigned pbits, unsigned qbits, MPI g ); #endif /*G10_CIPHER_H*/ diff --git a/include/iobuf.h b/include/iobuf.h index 71819c805..d29e0a06e 100644 --- a/include/iobuf.h +++ b/include/iobuf.h @@ -65,6 +65,7 @@ IOBUF iobuf_temp(void); IOBUF iobuf_open( const char *fname ); IOBUF iobuf_create( const char *fname ); IOBUF iobuf_append( const char *fname ); +IOBUF iobuf_openrw( const char *fname ); int iobuf_close( IOBUF iobuf ); int iobuf_cancel( IOBUF iobuf ); diff --git a/include/mpi.h b/include/mpi.h index ce60f16a8..fd93f3075 100644 --- a/include/mpi.h +++ b/include/mpi.h @@ -148,6 +148,7 @@ unsigned mpi_trailing_zeros( MPI a ); unsigned mpi_get_nbits( MPI a ); int mpi_test_bit( MPI a, unsigned n ); void mpi_set_bit( MPI a, unsigned n ); +void mpi_set_highbit( MPI a, unsigned n ); void mpi_clear_bit( MPI a, unsigned n ); void mpi_set_bytes( MPI a, unsigned nbits, byte (*fnc)(int), int opaque ); void mpi_rshift( MPI x, MPI a, unsigned n ); diff --git a/include/types.h b/include/types.h index 7db849f41..575f15224 100644 --- a/include/types.h +++ b/include/types.h @@ -22,55 +22,56 @@ #define G10_TYPES_H #ifdef __linux__ + /* FIXME: add stuff to configure to detect for typedefs */ #include <linux/types.h> #define HAVE_ULONG_TYPEDEF #define HAVE_USHORT_TYPEDEF #endif - -/* Common code */ -#ifndef HAVE_ULONG_TYPEDEF - #define HAVE_ULONG_TYPEDEF - typedef unsigned long ulong; +#ifndef HAVE_BYTE_TYPEDEF + typedef unsigned char byte; + #define HAVE_BYTE_TYPEDEF #endif + #ifndef HAVE_USHORT_TYPEDEF - #define HAVE_USHORT_TYPEDEF typedef unsigned short ushort; + #define HAVE_USHORT_TYPEDEF #endif - -typedef struct string_list { - struct string_list *next; - char d[1]; -} *STRLIST; - - - -/**************************************** - ******** machine dependent stuff ******* - ****************************************/ - -#if defined(__hpux) - #define HAVE_BIG_ENDIAN 1 -#else - #define HAVE_LITTLE_ENDIAN 1 +#ifndef HAVE_ULONG_TYPEDEF + typedef unsigned long ulong; + #define HAVE_ULONG_TYPEDEF #endif - -/*** some defaults ***/ -#ifndef HAVE_BYTE_TYPEDEF - #define HAVE_BYTE_TYPEDEF - typedef unsigned char byte; -#endif #ifndef HAVE_U16_TYPEDEF + #if SIZEOF_UNSIGNED_INT == 2 + typedef unsigned int u16; + #elif SIZEOF_UNSIGNED_SHORT == 2 + typedef unsigned short u16; + #else + #error no typedef for u16 + #endif #define HAVE_U16_TYPEDEF - typedef unsigned short u16; #endif + #ifndef HAVE_U32_TYPEDEF + #if SIZEOF_UNSIGNED_INT == 4 + typedef unsigned long u32; + #elif SIZEOF_UNSIGNED_LONG == 4 + typedef unsigned int u32; + #else + #error no typedef for u32 + #endif #define HAVE_U32_TYPEDEF - typedef unsigned long u32; #endif + +typedef struct string_list { + struct string_list *next; + char d[1]; +} *STRLIST; + + #endif /*G10_TYPES_H*/ |