[BACK]Return to moduli.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/moduli.c between version 1.32 and 1.33

version 1.32, 2017/12/08 03:45:52 version 1.33, 2019/01/20 02:01:59
Line 576 
Line 576 
         u_int32_t generator_known, in_tests, in_tries, in_type, in_size;          u_int32_t generator_known, in_tests, in_tries, in_type, in_size;
         unsigned long last_processed = 0, end_lineno;          unsigned long last_processed = 0, end_lineno;
         time_t time_start, time_stop;          time_t time_start, time_stop;
         int res;          int res, is_prime;
   
         if (trials < TRIAL_MINIMUM) {          if (trials < TRIAL_MINIMUM) {
                 error("Minimum primality trials is %d", TRIAL_MINIMUM);                  error("Minimum primality trials is %d", TRIAL_MINIMUM);
Line 747 
Line 747 
                  * that p is also prime. A single pass will weed out the                   * that p is also prime. A single pass will weed out the
                  * vast majority of composite q's.                   * vast majority of composite q's.
                  */                   */
                 if (BN_is_prime_ex(q, 1, ctx, NULL) <= 0) {                  is_prime = BN_is_prime_ex(q, 1, ctx, NULL);
                   if (is_prime < 0)
                           fatal("BN_is_prime_ex failed");
                   if (is_prime == 0) {
                         debug("%10u: q failed first possible prime test",                          debug("%10u: q failed first possible prime test",
                             count_in);                              count_in);
                         continue;                          continue;
Line 760 
Line 763 
                  * will show up on the first Rabin-Miller iteration so it                   * will show up on the first Rabin-Miller iteration so it
                  * doesn't hurt to specify a high iteration count.                   * doesn't hurt to specify a high iteration count.
                  */                   */
                 if (!BN_is_prime_ex(p, trials, ctx, NULL)) {                  is_prime = BN_is_prime_ex(p, trials, ctx, NULL);
                   if (is_prime < 0)
                           fatal("BN_is_prime_ex failed");
                   if (is_prime == 0) {
                         debug("%10u: p is not prime", count_in);                          debug("%10u: p is not prime", count_in);
                         continue;                          continue;
                 }                  }
                 debug("%10u: p is almost certainly prime", count_in);                  debug("%10u: p is almost certainly prime", count_in);
   
                 /* recheck q more rigorously */                  /* recheck q more rigorously */
                 if (!BN_is_prime_ex(q, trials - 1, ctx, NULL)) {                  is_prime = BN_is_prime_ex(q, trials - 1, ctx, NULL);
                   if (is_prime < 0)
                           fatal("BN_is_prime_ex failed");
                   if (is_prime == 0) {
                         debug("%10u: q is not prime", count_in);                          debug("%10u: q is not prime", count_in);
                         continue;                          continue;
                 }                  }

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33