diff options
author | Werner Koch <wk@gnupg.org> | 1998-08-07 10:53:38 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1998-08-07 10:53:38 +0200 |
commit | 6d21f2838dcfee933f4c430fba68ba8ada3abd50 (patch) | |
tree | ecf44aec40a55d3fd46fc6a6d96bb3afa7901029 /mpi | |
parent | add salted and iterated mode (diff) | |
download | gnupg2-6d21f2838dcfee933f4c430fba68ba8ada3abd50.tar.xz gnupg2-6d21f2838dcfee933f4c430fba68ba8ada3abd50.zip |
chnages done at the train
Diffstat (limited to 'mpi')
-rw-r--r-- | mpi/ChangeLog | 4 | ||||
-rw-r--r-- | mpi/g10m.c | 6 | ||||
-rw-r--r-- | mpi/mpi-bit.c | 50 | ||||
-rw-r--r-- | mpi/mpicoder.c | 1 |
4 files changed, 4 insertions, 57 deletions
diff --git a/mpi/ChangeLog b/mpi/ChangeLog index 3fc0b3329..aa9406f5a 100644 --- a/mpi/ChangeLog +++ b/mpi/ChangeLog @@ -1,3 +1,7 @@ +Thu Aug 6 16:39:28 1998 Werner Koch,mobil,,, (wk@tobold) + + * mpi-bit.c (mpi_set_bytes): Removed. + Wed Aug 5 15:11:12 1998 Werner Koch (wk@(none)) * mpicoder.c (mpi_read_from_buffer): New. diff --git a/mpi/g10m.c b/mpi/g10m.c index 28feaf08c..5c23f0ae7 100644 --- a/mpi/g10m.c +++ b/mpi/g10m.c @@ -57,12 +57,6 @@ void g10m_swap( MPI a, MPI b) { mpi_swap( a, b ); } void g10m_set( MPI w, MPI u) { mpi_set( w, u ); } void g10m_set_ui( MPI w, ulong u ) { mpi_set_ui( w, u ); } -void -g10m_set_bytes( MPI a, unsigned nbits, byte (*fnc)(int), int opaque ) -{ - mpi_set_bytes( a, nbits, fnc, opaque ); -} - int g10m_cmp( MPI u, MPI v ) { return mpi_cmp( u, v ); } int g10m_cmp_ui( MPI u, ulong v ) { return mpi_cmp_ui( u, v ); } diff --git a/mpi/mpi-bit.c b/mpi/mpi-bit.c index 2e420875b..f60d5e3b9 100644 --- a/mpi/mpi-bit.c +++ b/mpi/mpi-bit.c @@ -177,56 +177,6 @@ mpi_clear_bit( MPI a, unsigned n ) } -void -mpi_set_bytes( MPI a, unsigned nbits, byte (*fnc)(int), int opaque ) -{ - byte *p; - unsigned nlimbs, nlimbs2, xbits, xbytes; - unsigned n; - int i; - - nlimbs = nbits / BITS_PER_MPI_LIMB; - xbits = nbits % BITS_PER_MPI_LIMB; - nlimbs2 = xbits? (nlimbs+1):nlimbs; - xbytes = xbits / 8; - xbits = xbits % 8; - if( a->alloced < nlimbs2 ) - mpi_resize(a, nlimbs2 ); - a->nlimbs = nlimbs2; - for(n=0; n < nlimbs; n++ ) { - p = (byte*)(a->d+n); - #ifdef LITTLE_ENDIAN_HOST - for(i=0; i < BYTES_PER_MPI_LIMB; i++ ) - p[i] = fnc(opaque); - #else - for(i=BYTES_PER_MPI_LIMB-1; i>=0; i-- ) - p[i] = fnc(opaque); - #endif - } - if( xbytes ) { - p = (byte*)(a->d+n); - #ifdef LITTLE_ENDIAN_HOST - for(i=0; i < xbytes; i++ ) - p[i] = fnc(opaque); - #else - for(i=xbytes-1; i>=0; i-- ) - p[i] = fnc(opaque); - #endif - } - #if 0 /* fixme: set complete random byte and clear out the unwanted ones*/ - if( xbits ) { - p = (byte*)(a->d+n); - #ifdef LITTLE_ENDIAN_HOST - for(i=0; i < xbytes; i++ ) - p[i] = fnc(opaque); - #else - for(i=xbytes-1; i>=0; i-- ) - p[i] = fnc(opaque); - #endif - } - #endif -} - /**************** * Shift A by N bits to the right * FIXME: should use alloc_limb if X and A are same. diff --git a/mpi/mpicoder.c b/mpi/mpicoder.c index 2775f5be8..1fab786f5 100644 --- a/mpi/mpicoder.c +++ b/mpi/mpicoder.c @@ -397,7 +397,6 @@ mpi_set_buffer( MPI a, const byte *buffer, unsigned nbytes, int sign ) alimb |= *p-- << 16 ; alimb |= *p-- << 24 ; #elif BYTES_PER_MPI_LIMB == 8 - /* cast due to egc's "left shift count >= width of type" warning*/ alimb = (mpi_limb_t)*p-- ; alimb |= (mpi_limb_t)*p-- << 8 ; alimb |= (mpi_limb_t)*p-- << 16 ; |