mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
See ChangeLog: Sun Apr 18 10:11:28 CEST 1999 Werner Koch
This commit is contained in:
parent
02d018f9c8
commit
1feae2011c
50 changed files with 547 additions and 502 deletions
|
@ -1,3 +1,8 @@
|
|||
Sun Apr 18 10:11:28 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
|
||||
|
||||
* mpih-mul.c (mpihelp_mul_n): Fixed use of memory region.
|
||||
(mpihelp_mul): Ditto.
|
||||
|
||||
Wed Apr 7 20:51:39 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
|
||||
|
||||
* Makefile.am: Explicit rules to invoke cpp on *.S
|
||||
|
|
|
@ -52,7 +52,8 @@ mpi_powm( MPI res, MPI base, MPI exp, MPI mod)
|
|||
mpi_ptr_t xp_marker=NULL;
|
||||
int assign_rp=0;
|
||||
mpi_ptr_t tspace = NULL;
|
||||
mpi_size_t tsize=0; /* to avoid compiler warning, fixme: check */
|
||||
mpi_size_t tsize=0; /* to avoid compiler warning */
|
||||
/* fixme: we should check that the warning is void*/
|
||||
|
||||
esize = exp->nlimbs;
|
||||
msize = mod->nlimbs;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* mpihelp-mul.c - MPI helper functions
|
||||
* Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
* Copyright (C) 1994, 1996 Free Software Foundation, Inc.
|
||||
* Copyright (C) 1994, 1996, 1998, 1999 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
|
@ -346,14 +345,15 @@ mpih_sqr_n( mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t size, mpi_ptr_t tspace)
|
|||
void
|
||||
mpihelp_mul_n( mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp, mpi_size_t size)
|
||||
{
|
||||
/* FIXME: mpi_alloc_limb_space, secure arg is wrong! */
|
||||
int secure;
|
||||
|
||||
if( up == vp ) {
|
||||
if( size < KARATSUBA_THRESHOLD )
|
||||
mpih_sqr_n_basecase( prodp, up, size );
|
||||
else {
|
||||
mpi_ptr_t tspace;
|
||||
tspace = mpi_alloc_limb_space( 2 * size, 0 );
|
||||
secure = m_is_secure( up );
|
||||
tspace = mpi_alloc_limb_space( 2 * size, secure );
|
||||
mpih_sqr_n( prodp, up, size, tspace );
|
||||
mpi_free_limb_space( tspace );
|
||||
}
|
||||
|
@ -363,7 +363,8 @@ mpihelp_mul_n( mpi_ptr_t prodp, mpi_ptr_t up, mpi_ptr_t vp, mpi_size_t size)
|
|||
mul_n_basecase( prodp, up, vp, size );
|
||||
else {
|
||||
mpi_ptr_t tspace;
|
||||
tspace = mpi_alloc_limb_space( 2 * size, 0 );
|
||||
secure = m_is_secure( up ) || m_is_secure( vp );
|
||||
tspace = mpi_alloc_limb_space( 2 * size, secure );
|
||||
mul_n (prodp, up, vp, size, tspace);
|
||||
mpi_free_limb_space( tspace );
|
||||
}
|
||||
|
@ -436,16 +437,16 @@ mpihelp_mul( mpi_ptr_t prodp, mpi_ptr_t up, mpi_size_t usize,
|
|||
return cy;
|
||||
}
|
||||
|
||||
/* FIXME: mpi_alloc_limb_space, secure arg is wrong! */
|
||||
tspace = mpi_alloc_limb_space( 2 * vsize, 0 );
|
||||
tspace = mpi_alloc_limb_space( 2 * vsize,
|
||||
m_is_secure( up ) || m_is_secure( vp ) );
|
||||
MPN_MUL_N_RECURSE( prodp, up, vp, vsize, tspace );
|
||||
|
||||
prodp += vsize;
|
||||
up += vsize;
|
||||
usize -= vsize;
|
||||
if( usize >= vsize ) {
|
||||
/* FIXME: mpi_alloc_limb_space, secure arg is wrong! */
|
||||
mpi_ptr_t tp = mpi_alloc_limb_space( 2 * vsize, 0 );
|
||||
mpi_ptr_t tp = mpi_alloc_limb_space( 2 * vsize, m_is_secure( up )
|
||||
|| m_is_secure( vp ) );
|
||||
do {
|
||||
MPN_MUL_N_RECURSE( tp, up, vp, vsize, tspace );
|
||||
cy = mpihelp_add_n( prodp, prodp, tp, vsize );
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#endif
|
||||
|
||||
/****************
|
||||
* fixme: It was a bad idea to use the number of limbs to allocate
|
||||
* Note: It was a bad idea to use the number of limbs to allocate
|
||||
* because on a alpha the limbs are large but we normally need
|
||||
* integers of n bits - So we should chnage this to bits (or bytes).
|
||||
*
|
||||
|
@ -159,7 +159,11 @@ mpi_resize( MPI a, unsigned nlimbs )
|
|||
{
|
||||
if( nlimbs <= a->alloced )
|
||||
return; /* no need to do it */
|
||||
/* FIXME: add realloc_secure based on a->secure */
|
||||
/* Note: a->secure is not used - instead the realloc functions
|
||||
* take care of it. Maybe we should drop a->secure completely
|
||||
* and rely on a mpi_is_secure function, which would be
|
||||
* a wrapper around m_is_secure
|
||||
*/
|
||||
#ifdef M_DEBUG
|
||||
if( a->d )
|
||||
a->d = m_debug_realloc(a->d, nlimbs * sizeof(mpi_limb_t), info );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue