diff options
author | Werner Koch <wk@gnupg.org> | 2001-05-31 14:16:54 +0000 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2001-05-31 14:16:54 +0000 |
commit | 8bfa2df2135a1bd9823067debf0c8799bac4a936 (patch) | |
tree | b91075d39633de4f762dca14ae2323053ded62c8 /mpi/mpi-mpow.c | |
parent | 08e3fbb986bed2f39cc5dca806faca9654c3a6df (diff) | |
download | libgcrypt-8bfa2df2135a1bd9823067debf0c8799bac4a936.tar.gz |
The first libgcrypt only release.V1-1-3
Diffstat (limited to 'mpi/mpi-mpow.c')
-rw-r--r-- | mpi/mpi-mpow.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/mpi/mpi-mpow.c b/mpi/mpi-mpow.c index 9414844d..9df505e3 100644 --- a/mpi/mpi-mpow.c +++ b/mpi/mpi-mpow.c @@ -1,5 +1,5 @@ /* mpi-mpow.c - MPI functions - * Copyright (C) 1998, 1999 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. * * This file is part of Libgcrypt. * @@ -23,8 +23,10 @@ #include <stdlib.h> #include "mpi-internal.h" #include "longlong.h" +#include "g10lib.h" #include <assert.h> + /* Barrett is slower than the classical way. It can be tweaked by * using partial multiplications */ @@ -37,7 +39,7 @@ static void barrett_mulm( MPI w, MPI u, MPI v, MPI m, MPI y, int k, MPI r1, MPI static MPI init_barrett( MPI m, int *k, MPI *r1, MPI *r2 ); static int calc_barrett( MPI r, MPI x, MPI m, MPI y, int k, MPI r1, MPI r2 ); #else -#define barrett_mulm( w, u, v, m, y, k, r1, r2 ) mpi_mulm( (w), (u), (v), (m) ) +#define barrett_mulm( w, u, v, m, y, k, r1, r2 ) gcry_mpi_mulm( (w), (u), (v), (m) ) #endif @@ -61,7 +63,7 @@ build_index( MPI *exparray, int k, int i, int t ) * RES = (BASE[0] ^ EXP[0]) * (BASE[1] ^ EXP[1]) * ... * mod M */ void -mpi_mulpowm( MPI res, MPI *basearray, MPI *exparray, MPI m) +_gcry_mpi_mulpowm( MPI res, MPI *basearray, MPI *exparray, MPI m) { int k; /* number of elements */ int t; /* bit size of largest exponent */ @@ -87,7 +89,7 @@ mpi_mulpowm( MPI res, MPI *basearray, MPI *exparray, MPI m) assert(t); assert( k < 10 ); - G = g10_xcalloc( (1<<k) , sizeof *G ); + G = gcry_xcalloc( (1<<k) , sizeof *G ); #ifdef USE_BARRETT barrett_y = init_barrett( m, &barrett_k, &barrett_r1, &barrett_r2 ); #endif @@ -128,7 +130,7 @@ mpi_mulpowm( MPI res, MPI *basearray, MPI *exparray, MPI m) #endif for(i=0; i < (1<<k); i++ ) mpi_free(G[i]); - g10_free(G); + gcry_free(G); } |