aboutsummaryrefslogtreecommitdiffstats
path: root/cipher
diff options
context:
space:
mode:
Diffstat (limited to 'cipher')
-rw-r--r--cipher/ChangeLog8
-rw-r--r--cipher/elgamal.c4
-rw-r--r--cipher/random.c6
3 files changed, 17 insertions, 1 deletions
diff --git a/cipher/ChangeLog b/cipher/ChangeLog
index b96925f33..c17028bdf 100644
--- a/cipher/ChangeLog
+++ b/cipher/ChangeLog
@@ -1,3 +1,11 @@
+Thu Oct 28 16:08:20 CEST 1999 Werner Koch <[email protected]>
+
+ * random.c (fast_random_poll): Check whether RUSAGE_SELF is defined;
+ this is not the case for some ESIX and Unixware, although they have
+ getrusage().
+
+ * elgamal.c (sign): Hugh found strange code here. Replaced by BUG().
+
Mon Oct 11 09:24:12 CEST 1999 Werner Koch <[email protected]>
* rndw32.c (gather_random): Handle PCP_SEEDER_TOO_SMALL.
diff --git a/cipher/elgamal.c b/cipher/elgamal.c
index bbf9c2782..9f98ce2e0 100644
--- a/cipher/elgamal.c
+++ b/cipher/elgamal.c
@@ -351,8 +351,10 @@ sign(MPI a, MPI b, MPI input, ELG_secret_key *skey )
mpi_powm( a, skey->g, k, skey->p );
mpi_mul(t, skey->x, a );
mpi_subm(t, input, t, p_1 );
- while( mpi_is_neg(t) )
+ while( mpi_is_neg(t) ) {
+ BUG(); /* That is nonsense code - left over from a very early test?*/
mpi_add(t, t, p_1);
+ }
mpi_invm(inv, k, p_1 );
mpi_mulm(b, t, inv, p_1 );
diff --git a/cipher/random.c b/cipher/random.c
index 8ade26c11..5af5349df 100644
--- a/cipher/random.c
+++ b/cipher/random.c
@@ -408,12 +408,18 @@ fast_random_poll()
#endif
#endif
#ifdef HAVE_GETRUSAGE
+ #ifndef RUSAGE_SELF
+ #ifdef __GCC__
+ #warning There is no RUSAGE_SELF on this system
+ #endif
+ #else
{ struct rusage buf;
if( getrusage( RUSAGE_SELF, &buf ) )
BUG();
add_randomness( &buf, sizeof buf, 1 );
memset( &buf, 0, sizeof buf );
}
+ #endif
#endif
}