Correct sign in modular exponentiation algorithm.

The modular exponentiation function  handled the sign
incorrectly. This commit fixes this and a test case which should have
caught it.
diff --git a/library/bignum.c b/library/bignum.c
index afde19b..211cb2a 100644
--- a/library/bignum.c
+++ b/library/bignum.c
@@ -1788,7 +1788,7 @@
      */
     mpi_montred( X, N, mm, &T );
 
-    if( neg )
+    if( neg && E->n != 0 && ( E->p[0] & 1 ) != 0 )
     {
         X->s = -1;
         MPI_CHK( mpi_add_mpi( X, N, X ) );