Problem with test

Brad Hards bradh at frogmouth.net
Sat Aug 26 01:52:56 CEST 2006


On Saturday 26 August 2006 00:34, Werner Koch wrote:
> --- mpi-bit.c   (revision 1172)
> +++ mpi-bit.c   (working copy)
> @@ -256,7 +256,17 @@
>        x->nlimbs = xsize;
>        
>        if ( xsize )
> -        _gcry_mpih_rshift (x->d, a->d, x->nlimbs, nbits );
> +        {
> +          if (nbits )
> +            _gcry_mpih_rshift (x->d, a->d, x->nlimbs, nbits );
> +          else
> +            {
> +              /* The rshift helper function is not specified for
> +                 NBITS==0, thus we do a plain copy here. */
> +              for (i=0; i < x->nlimbs; i++ )
> +                x->d[i] = a->d[i];
> +            }
> +        }
>      }
>    MPN_NORMALIZE (x->d, x->nlimbs);
>  }
Now good:

$ ./t-mpi-bit --verbose
t-mpi-bit: checking that set_bit does only set one bit
t-mpi-bit: 
r=0000000000000000000000000000000000000000000000000000000000000000000000
t-mpi-bit: checking that set_highbit does only set one bit
t-mpi-bit: 
r=0000000000000000000000000000000000000000000000000000000000000000000000
t-mpi-bit: checking that rshift works as expected (pass 0)
inp= CD570A538852236914
inp= CD570A538852236914
out= CD570A538852236914
t-mpi-bit: checking that rshift works as expected (pass 1)
inp= A52197ED49D19C620A
inp= A52197ED49D19C620A
out= A52197ED49D19C620A
t-mpi-bit: checking that rshift works as expected (pass 2)
inp= 36DB517C8E2EAE0296
inp= 36DB517C8E2EAE0296
out= 36DB517C8E2EAE0296
t-mpi-bit: checking that rshift works as expected (pass 3)
inp= B61E2D1C7A2A7FD12E
inp= B61E2D1C7A2A7FD12E
out= B61E2D1C7A2A7FD12E
t-mpi-bit: checking that rshift works as expected (pass 4)
inp= D30FC4FB1F415A5F8B
inp= D30FC4FB1F415A5F8B
out= D30FC4FB1F415A5F8B
t-mpi-bit: All tests completed. Errors: 0

Thanks.

Brad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : /pipermail/attachments/20060826/d308a64b/attachment.pgp


More information about the Gcrypt-devel mailing list