Changeset d2d5a46


Ignore:
Timestamp:
Jan 27, 2016 1:42:58 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
c6136b5
Parents:
6ab814a
Message:

KeyGenerator?: Check that dsax is greater than zero

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/crypto/KeyGenerator.java

    r6ab814a rd2d5a46  
    209209        BigInteger x = null;
    210210
    211         // make sure the random key is less than the DSA q
     211        // make sure the random key is less than the DSA q and greater than zero
    212212        do {
    213213            x = new NativeBigInteger(160, _context.random());
    214         } while (x.compareTo(CryptoConstants.dsaq) >= 0);
     214        } while (x.compareTo(CryptoConstants.dsaq) >= 0 || x.equals(BigInteger.ZERO));
    215215
    216216        BigInteger y = CryptoConstants.dsag.modPow(x, CryptoConstants.dsap);
Note: See TracChangeset for help on using the changeset viewer.