summaryrefslogtreecommitdiff
path: root/mpi/mpi-internal.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2003-12-19 19:50:04 +0000
committerWerner Koch <wk@gnupg.org>2003-12-19 19:50:04 +0000
commit942783ba87c8d36cd0fb1e040c7ed78d0a6dce58 (patch)
tree0dd63136838e63c6ae773027d0ecb81d8b3ea47a /mpi/mpi-internal.h
parent87ab67996b2d67322fdeaf1753010130d5942af6 (diff)
downloadlibgcrypt-942783ba87c8d36cd0fb1e040c7ed78d0a6dce58.tar.gz
* mpi-internal.h [M_DEBUG]: Removed this unused code.
(struct karatsuba_ctx): Added TSPACE_NLIMBS and TP_NLIMBS. * mpiutil.c (_gcry_mpi_free_limb_space): Add arg NLIMBS and wipe out the memory. Changed all callers. * mpih-mul.c (_gcry_mpih_mul_karatsuba_case): Keep track of allocated limbs. * mpi-div.c (_gcry_mpi_tdiv_qr): Keep track of allocated limbs. * mpi-mul.c (gcry_mpi_mul): Ditto. * mpi-pow.c (gcry_mpi_powm): Ditto. * mpiutil.c (gcry_mpi_randomize): Use gcry_create_nonce if WEAK random has been requested.
Diffstat (limited to 'mpi/mpi-internal.h')
-rw-r--r--mpi/mpi-internal.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/mpi/mpi-internal.h b/mpi/mpi-internal.h
index 22699c63..d78c1809 100644
--- a/mpi/mpi-internal.h
+++ b/mpi/mpi-internal.h
@@ -1,6 +1,6 @@
/* mpi-internal.h - Internal to the Multi Precision Integers
- * Copyright (C) 1998 Free Software Foundation, Inc.
- * Copyright (C) 1994, 1996, 2000, 2002, 2003 Free Software Foundation, Inc.
+ * Copyright (C) 1994, 1996, 1998, 2000, 2002,
+ * 2003 Free Software Foundation, Inc.
*
* This file is part of Libgcrypt.
*
@@ -169,17 +169,9 @@ typedef int mpi_size_t; /* (must be a signed type) */
/*-- mpiutil.c --*/
-#ifdef M_DEBUG
-#define mpi_alloc_limb_space(n,f) _gcry_mpi_debug_alloc_limb_space((n),(f), M_DBGINFO( __LINE__ ) )
-#define mpi_free_limb_space(n) _gcry_mpi_debug_free_limb_space((n), M_DBGINFO( __LINE__ ) )
- mpi_ptr_t _gcry_mpi_debug_alloc_limb_space( unsigned nlimbs, int sec, const char *info );
- void _gcry_mpi_debug_free_limb_space( mpi_ptr_t a, const char *info );
-#else
#define mpi_alloc_limb_space(n,f) _gcry_mpi_alloc_limb_space((n),(f))
-#define mpi_free_limb_space(n) _gcry_mpi_free_limb_space((n))
- mpi_ptr_t _gcry_mpi_alloc_limb_space( unsigned nlimbs, int sec );
- void _gcry_mpi_free_limb_space( mpi_ptr_t a );
-#endif
+mpi_ptr_t _gcry_mpi_alloc_limb_space( unsigned nlimbs, int sec );
+void _gcry_mpi_free_limb_space( mpi_ptr_t a, unsigned int nlimbs );
void _gcry_mpi_assign_limb_space( gcry_mpi_t a, mpi_ptr_t ap, unsigned nlimbs );
/*-- mpi-bit.c --*/
@@ -211,8 +203,10 @@ int _gcry_mpih_cmp( mpi_ptr_t op1_ptr, mpi_ptr_t op2_ptr, mpi_size_t size );
struct karatsuba_ctx {
struct karatsuba_ctx *next;
mpi_ptr_t tspace;
+ unsigned int tspace_nlimbs;
mpi_size_t tspace_size;
mpi_ptr_t tp;
+ unsigned int tp_nlimbs;
mpi_size_t tp_size;
};