moduli.c (137015) | moduli.c (146998) |
---|---|
1/* $OpenBSD: moduli.c,v 1.9 2004/07/11 17:48:47 deraadt Exp $ */ | 1/* $OpenBSD: moduli.c,v 1.10 2005/01/17 03:25:46 dtucker Exp $ */ |
2/* 3 * Copyright 1994 Phil Karn <karn@qualcomm.com> 4 * Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com> 5 * Copyright 2000 Niels Provos <provos@citi.umich.edu> 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 41 unchanged lines hidden (view full) --- 51#define QLINESIZE (100+8192) 52 53/* Type: decimal. 54 * Specifies the internal structure of the prime modulus. 55 */ 56#define QTYPE_UNKNOWN (0) 57#define QTYPE_UNSTRUCTURED (1) 58#define QTYPE_SAFE (2) | 2/* 3 * Copyright 1994 Phil Karn <karn@qualcomm.com> 4 * Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com> 5 * Copyright 2000 Niels Provos <provos@citi.umich.edu> 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 41 unchanged lines hidden (view full) --- 51#define QLINESIZE (100+8192) 52 53/* Type: decimal. 54 * Specifies the internal structure of the prime modulus. 55 */ 56#define QTYPE_UNKNOWN (0) 57#define QTYPE_UNSTRUCTURED (1) 58#define QTYPE_SAFE (2) |
59#define QTYPE_SCHNOOR (3) | 59#define QTYPE_SCHNORR (3) |
60#define QTYPE_SOPHIE_GERMAIN (4) 61#define QTYPE_STRONG (5) 62 63/* Tests: decimal (bit field). 64 * Specifies the methods used in checking for primality. 65 * Usually, more than one test is used. 66 */ 67#define QTEST_UNTESTED (0x00) --- 457 unchanged lines hidden (view full) --- 525 /* p = 2*q + 1 */ 526 BN_lshift(p, q, 1); 527 BN_add_word(p, 1); 528 in_size += 1; 529 generator_known = 0; 530 break; 531 case QTYPE_UNSTRUCTURED: 532 case QTYPE_SAFE: | 60#define QTYPE_SOPHIE_GERMAIN (4) 61#define QTYPE_STRONG (5) 62 63/* Tests: decimal (bit field). 64 * Specifies the methods used in checking for primality. 65 * Usually, more than one test is used. 66 */ 67#define QTEST_UNTESTED (0x00) --- 457 unchanged lines hidden (view full) --- 525 /* p = 2*q + 1 */ 526 BN_lshift(p, q, 1); 527 BN_add_word(p, 1); 528 in_size += 1; 529 generator_known = 0; 530 break; 531 case QTYPE_UNSTRUCTURED: 532 case QTYPE_SAFE: |
533 case QTYPE_SCHNOOR: | 533 case QTYPE_SCHNORR: |
534 case QTYPE_STRONG: 535 case QTYPE_UNKNOWN: 536 debug2("%10u: (%u)", count_in, in_type); 537 a = p; 538 BN_hex2bn(&a, cp); 539 /* q = (p-1) / 2 */ 540 BN_rshift(q, p, 1); 541 break; --- 113 unchanged lines hidden --- | 534 case QTYPE_STRONG: 535 case QTYPE_UNKNOWN: 536 debug2("%10u: (%u)", count_in, in_type); 537 a = p; 538 BN_hex2bn(&a, cp); 539 /* q = (p-1) / 2 */ 540 BN_rshift(q, p, 1); 541 break; --- 113 unchanged lines hidden --- |