diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-06-19 22:15:58 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-06-19 22:15:58 +0000 |
commit | 77d2929512ff62e421e9bfee659cc86973fc7df7 (patch) | |
tree | eaeaee2b6f7ef7498cc5aa12b340b11cb125638b /plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-bit.c | |
parent | 665935b0f99a4b9585f9afe9c9730931a3c94f85 (diff) |
files structure reorganization
git-svn-id: http://svn.miranda-ng.org/main/trunk@492 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-bit.c')
-rw-r--r-- | plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-bit.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-bit.c b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-bit.c index 5aeedbbf6d..32c820c291 100644 --- a/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-bit.c +++ b/plugins/MirOTR/libgcrypt-1.4.6/mpi/mpi-bit.c @@ -54,10 +54,10 @@ _gcry_clz_tab[] = void _gcry_mpi_normalize( gcry_mpi_t a ) { - if ( mpi_is_opaque(a) ) + if( mpi_is_opaque(a) ) return; - for ( ; a->nlimbs && !a->d[a->nlimbs-1]; a->nlimbs-- ) + for( ; a->nlimbs && !a->d[a->nlimbs-1]; a->nlimbs-- ) ; } @@ -71,14 +71,14 @@ gcry_mpi_get_nbits( gcry_mpi_t a ) { unsigned n; - if ( mpi_is_opaque(a) ) { + if( mpi_is_opaque(a) ) { return a->sign; /* which holds the number of bits */ } _gcry_mpi_normalize( a ); - if ( a->nlimbs ) { + if( a->nlimbs ) { mpi_limb_t alimb = a->d[a->nlimbs-1]; - if ( alimb ) + if( alimb ) count_leading_zeros( n, alimb ); else n = BITS_PER_MPI_LIMB; @@ -102,7 +102,7 @@ gcry_mpi_test_bit( gcry_mpi_t a, unsigned int n ) limbno = n / BITS_PER_MPI_LIMB; bitno = n % BITS_PER_MPI_LIMB; - if ( limbno >= a->nlimbs ) + if( limbno >= a->nlimbs ) return 0; /* too far left: this is a 0 */ limb = a->d[limbno]; return (limb & (A_LIMB_1 << bitno))? 1: 0; @@ -161,11 +161,11 @@ gcry_mpi_clear_highbit( gcry_mpi_t a, unsigned int n ) limbno = n / BITS_PER_MPI_LIMB; bitno = n % BITS_PER_MPI_LIMB; - if ( limbno >= a->nlimbs ) + if( limbno >= a->nlimbs ) return; /* not allocated, therefore no need to clear bits :-) */ - for ( ; bitno < BITS_PER_MPI_LIMB; bitno++ ) + for( ; bitno < BITS_PER_MPI_LIMB; bitno++ ) a->d[limbno] &= ~(A_LIMB_1 << bitno); a->nlimbs = limbno+1; } @@ -181,7 +181,7 @@ gcry_mpi_clear_bit( gcry_mpi_t a, unsigned int n ) limbno = n / BITS_PER_MPI_LIMB; bitno = n % BITS_PER_MPI_LIMB; - if ( limbno >= a->nlimbs ) + if( limbno >= a->nlimbs ) return; /* don't need to clear this bit, it's to far to left */ a->d[limbno] &= ~(A_LIMB_1 << bitno); } @@ -198,12 +198,12 @@ _gcry_mpi_rshift_limbs( gcry_mpi_t a, unsigned int count ) mpi_size_t n = a->nlimbs; unsigned int i; - if ( count >= n ) { + if( count >= n ) { a->nlimbs = 0; return; } - for ( i = 0; i < n - count; i++ ) + for( i = 0; i < n - count; i++ ) ap[i] = ap[i+count]; ap[i] = 0; a->nlimbs -= count; |