File tree Expand file tree Collapse file tree 1 file changed +1
-18
lines changed
core/src/main/java/org/bouncycastle/crypto/signers Expand file tree Collapse file tree 1 file changed +1
-18
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ public BigInteger[] generateSignature(byte[] message)
9191 {
9292 do
9393 {
94- e = generateRandomInteger ( n , random );
94+ e = BigIntegers . createRandomInRange ( BigInteger . ONE , n . subtract ( BigInteger . ONE ) , random );
9595 Fe = basePointMultiplier .multiply (ec .getG (), e ).normalize ().getAffineXCoord ();
9696 }
9797 while (Fe .isZero ());
@@ -148,23 +148,6 @@ protected ECMultiplier createBasePointMultiplier()
148148 return new FixedPointCombMultiplier ();
149149 }
150150
151- /**
152- * Generates random integer such that its value is less than that of n
153- */
154- private static BigInteger generateRandomInteger (BigInteger n , SecureRandom random )
155- {
156- int nBitLength = n .bitLength ();
157-
158- BigInteger k ;
159- do
160- {
161- k = BigIntegers .createRandomBigInteger (nBitLength , random );
162- }
163- while (k .equals (BigIntegers .ZERO ) || k .compareTo (n ) >= 0 );
164-
165- return k ;
166- }
167-
168151 private static ECFieldElement hash2FieldElement (ECCurve curve , byte [] hash )
169152 {
170153 byte [] data = Arrays .reverse (hash );
You can’t perform that action at this time.
0 commit comments