summaryrefslogtreecommitdiff
path: root/mpi/mpi-internal.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1997-11-26 21:06:44 +0000
committerWerner Koch <wk@gnupg.org>1997-11-26 21:06:44 +0000
commit55aefe3378aea76c3bfe3bf290d8b7d74bed133a (patch)
treef7b025ec8697d87260c98c05415bf95f901fd099 /mpi/mpi-internal.h
parent7927452093826608e9e29f3ac13166415dabf46c (diff)
downloadlibgcrypt-55aefe3378aea76c3bfe3bf290d8b7d74bed133a.tar.gz
changed the dir layout
Diffstat (limited to 'mpi/mpi-internal.h')
-rw-r--r--mpi/mpi-internal.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/mpi/mpi-internal.h b/mpi/mpi-internal.h
index b5c00b6c..2748ddad 100644
--- a/mpi/mpi-internal.h
+++ b/mpi/mpi-internal.h
@@ -1,5 +1,6 @@
/* mpi-internal.h - Internal to the Multi Precision Integers
* Copyright (c) 1997 by Werner Koch (dd9jn)
+ * Copyright (C) 1994, 1996 Free Software Foundation, Inc.
*
* This file is part of G10.
*
@@ -16,6 +17,14 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *
+ * Note: This code is heavily based on the GNU MP Library.
+ * Actually it's the same code with only minor changes in the
+ * way the data is stored; this is to support the abstraction
+ * of an optional secure memory allocation which may be used
+ * to avoid revealing of sensitive data due to paging etc.
+ * The GNU MP Library itself is published under the LGPL;
+ * however I decided to publish this code under the plain GPL.
*/
#ifndef G10_MPI_INTERNAL_H
@@ -120,12 +129,12 @@ typedef int mpi_size_t; /* (must be a signed type) */
/*-- mpiutil.c --*/
#ifdef M_DEBUG
- #define mpi_alloc_limb_space(n) mpi_debug_alloc_limb_space((n), M_DBGINFO( __LINE__ ) )
+ #define mpi_alloc_limb_space(n,f) mpi_debug_alloc_limb_space((n),(f), M_DBGINFO( __LINE__ ) )
#define mpi_free_limb_space(n) mpi_debug_free_limb_space((n), M_DBGINFO( __LINE__ ) )
- mpi_ptr_t mpi_debug_alloc_limb_space( unsigned nlimbs, const char *info );
+ mpi_ptr_t mpi_debug_alloc_limb_space( unsigned nlimbs, int sec, const char *info );
void mpi_debug_free_limb_space( mpi_ptr_t a, const char *info );
#else
- mpi_ptr_t mpi_alloc_limb_space( unsigned nlimbs );
+ mpi_ptr_t mpi_alloc_limb_space( unsigned nlimbs, int sec );
void mpi_free_limb_space( mpi_ptr_t a );
#endif
void mpi_assign_limb_space( MPI a, mpi_ptr_t ap, unsigned nlimbs );
@@ -154,13 +163,15 @@ mpi_limb_t mpihelp_addmul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
mpi_size_t s1_size, mpi_limb_t s2_limb);
mpi_limb_t mpihelp_submul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
mpi_size_t s1_size, mpi_limb_t s2_limb);
-mpi_limb_t mpihelp_mul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
- mpi_size_t s1_size, mpi_limb_t s2_limb);
void mpihelp_mul_n( mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp,
mpi_size_t size);
mpi_limb_t mpihelp_mul( mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t usize,
mpi_ptr_t vp, mpi_size_t vsize);
+/*-- mpihelp-mul_1.c (or xxx/cpu/*.S) --*/
+mpi_limb_t mpihelp_mul_1( mpi_ptr_t res_ptr, mpi_ptr_t s1_ptr,
+ mpi_size_t s1_size, mpi_limb_t s2_limb);
+
/*-- mpihelp-div.c --*/
mpi_limb_t mpihelp_mod_1(mpi_ptr_t dividend_ptr, mpi_size_t dividend_size,
mpi_limb_t divisor_limb);
@@ -194,5 +205,8 @@ mpi_limb_t mpihelp_rshift( mpi_ptr_t wp, mpi_ptr_t up, mpi_size_t usize,
typedef unsigned long USItype;
#endif
+#ifdef __GNUC__
+ #include "mpi-inline.h"
+#endif
#endif /*G10_MPI_INTERNAL_H*/