summaryrefslogtreecommitdiffstats
path: root/RISCOS
Commit message (Expand)AuthorAgeFilesLines
* Remove rotor, xreadlines modulesAndrew M. Kuchling2004-08-311-8/+0
* Remove reference to pcre moduleAndrew M. Kuchling2004-06-021-5/+0
* remove support for missing ANSI C header files (limits.h, stddef.h, etc).Skip Montanaro2004-02-101-18/+5
* Remove support for --without-universal-newlines (see PEP 11).Skip Montanaro2004-02-071-3/+0
* Remove HAVE_STRPTIME - no longer necessary with the pure Python version ofSkip Montanaro2004-02-071-3/+0
* Remove support for SunOS 4.Skip Montanaro2004-01-171-4/+0
* Remove support for DYNIX, IRIX 4, --with-sgi-dl, --with-dl-dldSkip Montanaro2004-01-171-18/+0
* Remove support for minix.Skip Montanaro2004-01-171-3/+0
* Patch #734231: Update RiscOS support. In particular, correctMartin v. Löwis2003-05-107-25/+397
* Remove MALLOC_ZERO_RETURNS_NULL.Martin v. Löwis2002-11-231-3/+0
* Removed WITH_CYCLE_GC #ifdef-ery. Holes:Tim Peters2002-07-072-5/+0
* SF patch 568629 by Oren Tirosh: types made callable.Guido van Rossum2002-06-141-3/+0
* Patch #568235: Add posix.setpgid.Martin v. Löwis2002-06-131-0/+3
* Patch #568124: Add doc string macros.Martin v. Löwis2002-06-131-2/+2
* Patch #505375: Make doc strings optional.Martin v. Löwis2002-06-091-0/+3
* SF patch 493739 2 Bugfixes for 2.2c1 (RISC OS specific), fromTim Peters2001-12-151-1/+1
* Patch supplied by Burton Radons for his own SF bug #487390: ModifyingGuido van Rossum2001-12-081-1/+1
* Use strncpy() instead of sprintf() in calculate_path().Jeremy Hylton2001-11-281-15/+19
* Use PyOS_snprintf instead of sprintf.Jeremy Hylton2001-11-281-4/+3
* SF patch #475657 (Dietmar Schwertberger)Guido van Rossum2001-10-272-6/+10
* SF patch #474590 -- RISC OS supportGuido van Rossum2001-10-2412-72/+140
* SF patch #474590 -- RISC OS supportGuido van Rossum2001-10-242-108/+377
* SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.Guido van Rossum2001-10-181-17/+71
* Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774.Martin v. Löwis2001-07-261-0/+0
* Add -E command line switch (ignore environment variables like PYTHONHOMENeil Schemenauer2001-07-231-1/+1
* Updated version of RISCOS support. SF patch 411213 by Dietmar SchwertbergerGuido van Rossum2001-04-107-152/+205
* RISCOS files by dschwertbergerGuido van Rossum2001-03-0213-0/+2607
n value='core_8_5_branch_fix_1997007'>core_8_5_branch_fix_1997007 Tcl is a high-level, general-purpose, interpreted, dynamic programming language. It was designed with the goal of being very simple but powerful.
summaryrefslogtreecommitdiffstats
path: root/libtommath/bn_mp_shrink.c
blob: bfdf93a56ec6c58f10cc8734d1dd56b2dc518b7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <tommath.h>
#ifdef BN_MP_SHRINK_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 *
 * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com
 */

/* shrink a bignum */
int mp_shrink (mp_int * a)
{
  mp_digit *tmp;
  int used = 1;
  
  if(a->used > 0)
    used = a->used;
  
  if (a->alloc != used) {
    if ((tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * used)) == NULL) {
      return MP_MEM;
    }
    a->dp    = tmp;
    a->alloc = used;
  }
  return MP_OKAY;
}
#endif