Changeset 9472 for lang/perl/Crypt-DH-GMP
- Timestamp:
- 04/15/08 13:25:45 (5 years ago)
- Files:
-
- 1 modified
-
lang/perl/Crypt-DH-GMP/trunk/GMP.xs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Crypt-DH-GMP/trunk/GMP.xs
r9471 r9472 59 59 mpz_init_set_str(ptr->priv_key, priv_key, 10); 60 60 } else { 61 mpz_init(ptr->priv_key); 62 DH_mpz_rand_set(&(ptr->priv_key), mpz_sizeinbase(ptr->p, 2)); 61 mpz_init_set_ui(ptr->priv_key, 0); 63 62 } 64 63 … … 73 72 if (mpz_cmp_ui(dh->priv_key, 0) == 0) { 74 73 /* not initialized, eh? */ 75 DH_mpz_rand_set(&(dh->priv_key), mpz_sizeinbase(dh->p, 2) );74 DH_mpz_rand_set(&(dh->priv_key), mpz_sizeinbase(dh->p, 2) - 1); 76 75 } 77 76
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)