summaryrefslogtreecommitdiff
path: root/mpi/mpi-bit.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1998-08-07 08:53:38 +0000
committerWerner Koch <wk@gnupg.org>1998-08-07 08:53:38 +0000
commitc355eb5c4e0e6578ff9cda30e83ab9adcacd913a (patch)
tree84805acea517b8ccaec96c428aae5228956fee3a /mpi/mpi-bit.c
parente7d8ce5405e6bf9d4f340a0f5fd137bc3bdde8c9 (diff)
downloadlibgcrypt-c355eb5c4e0e6578ff9cda30e83ab9adcacd913a.tar.gz
chnages done at the train
Diffstat (limited to 'mpi/mpi-bit.c')
-rw-r--r--mpi/mpi-bit.c50
1 files changed, 0 insertions, 50 deletions
diff --git a/mpi/mpi-bit.c b/mpi/mpi-bit.c
index 2e420875..f60d5e3b 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.