View | Details | Raw Unified | Return to bug 850
Collapse All | Expand All

(-)openssh-3.8p1.orig/moduli.c (-5 / +5 lines)
Lines 58-64 Link Here
58
#define QTYPE_UNSTRUCTURED      (1)
58
#define QTYPE_UNSTRUCTURED      (1)
59
#define QTYPE_SAFE              (2)
59
#define QTYPE_SAFE              (2)
60
#define QTYPE_SCHNOOR           (3)
60
#define QTYPE_SCHNOOR           (3)
61
#define QTYPE_SOPHIE_GERMAINE   (4)
61
#define QTYPE_SOPHIE_GERMAIN    (4)
62
#define QTYPE_STRONG            (5)
62
#define QTYPE_STRONG            (5)
63
63
64
/* Tests: decimal (bit field).
64
/* Tests: decimal (bit field).
Lines 219-225 Link Here
219
}
219
}
220
220
221
/*
221
/*
222
 * list candidates for Sophie-Germaine primes (where q = (p-1)/2)
222
 * list candidates for Sophie-Germain primes (where q = (p-1)/2)
223
 * to standard output.
223
 * to standard output.
224
 * The list is checked against small known primes (less than 2**30).
224
 * The list is checked against small known primes (less than 2**30).
225
 */
225
 */
Lines 403-409 Link Here
403
		debug2("test q = largebase+%u", 2 * j);
403
		debug2("test q = largebase+%u", 2 * j);
404
		BN_set_word(q, 2 * j);
404
		BN_set_word(q, 2 * j);
405
		BN_add(q, q, largebase);
405
		BN_add(q, q, largebase);
406
		if (qfileout(out, QTYPE_SOPHIE_GERMAINE, QTEST_SIEVE,
406
		if (qfileout(out, QTYPE_SOPHIE_GERMAIN, QTEST_SIEVE,
407
		    largetries, (power - 1) /* MSB */, (0), q) == -1) {
407
		    largetries, (power - 1) /* MSB */, (0), q) == -1) {
408
			ret = -1;
408
			ret = -1;
409
			break;
409
			break;
Lines 490-497 Link Here
490
490
491
		/* modulus (hex) */
491
		/* modulus (hex) */
492
		switch (in_type) {
492
		switch (in_type) {
493
		case QTYPE_SOPHIE_GERMAINE:
493
		case QTYPE_SOPHIE_GERMAIN:
494
			debug2("%10u: (%u) Sophie-Germaine", count_in, in_type);
494
			debug2("%10u: (%u) Sophie-Germain", count_in, in_type);
495
			a = q;
495
			a = q;
496
			BN_hex2bn(&a, cp);
496
			BN_hex2bn(&a, cp);
497
			/* p = 2*q + 1 */
497
			/* p = 2*q + 1 */

Return to bug 850