@@ -37,12 +37,6 @@ public class NaccacheSternTest
37
37
static readonly NaccacheSternEngine cryptEng = new NaccacheSternEngine ( ) ;
38
38
static readonly NaccacheSternEngine decryptEng = new NaccacheSternEngine ( ) ;
39
39
40
- static NaccacheSternTest ( )
41
- {
42
- cryptEng . Debug = debug ;
43
- decryptEng . Debug = debug ;
44
- }
45
-
46
40
// Values from NaccacheStern paper
47
41
static readonly BigInteger a = BigInteger . ValueOf ( 101 ) ;
48
42
static readonly BigInteger u1 = BigInteger . ValueOf ( 3 ) ;
@@ -82,6 +76,22 @@ static readonly BigInteger phi_n
82
76
//
83
77
static readonly string edgeInput = "ff6f77206973207468652074696d6520666f7220616c6c20676f6f64206d656e" ;
84
78
79
+ static NaccacheSternTest ( )
80
+ {
81
+ cryptEng . Debug = debug ;
82
+ decryptEng . Debug = debug ;
83
+
84
+ // First the Parameters from the NaccacheStern Paper
85
+ // (see http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf )
86
+
87
+ smallPrimes . Add ( u1 ) ;
88
+ smallPrimes . Add ( u2 ) ;
89
+ smallPrimes . Add ( u3 ) ;
90
+ smallPrimes . Add ( v1 ) ;
91
+ smallPrimes . Add ( v2 ) ;
92
+ smallPrimes . Add ( v3 ) ;
93
+ }
94
+
85
95
public override string Name
86
96
{
87
97
get { return "NaccacheStern" ; }
@@ -91,16 +101,6 @@ public override void PerformTest()
91
101
{
92
102
// Test with given key from NaccacheSternPaper (totally insecure)
93
103
94
- // First the Parameters from the NaccacheStern Paper
95
- // (see http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf )
96
-
97
- smallPrimes . Add ( u1 ) ;
98
- smallPrimes . Add ( u2 ) ;
99
- smallPrimes . Add ( u3 ) ;
100
- smallPrimes . Add ( v1 ) ;
101
- smallPrimes . Add ( v2 ) ;
102
- smallPrimes . Add ( v3 ) ;
103
-
104
104
NaccacheSternKeyParameters pubParameters = new NaccacheSternKeyParameters ( false , g , n , sigma . BitLength ) ;
105
105
106
106
NaccacheSternPrivateKeyParameters privParameters = new NaccacheSternPrivateKeyParameters ( g , n , sigma
0 commit comments