net.i2p.crypto
Class YKGenerator
java.lang.Object
net.i2p.crypto.YKGenerator
class YKGenerator
- extends java.lang.Object
Precalculate the Y and K for ElGamal encryption operations.
This class precalcs a set of values on its own thread, using those transparently
when a new instance is created. By default, the minimum threshold for creating
new values for the pool is 5, and the max pool size is 10. Whenever the pool has
less than the minimum, it fills it up again to the max. There is a delay after
each precalculation so that the CPU isn't hosed during startup (defaulting to 10 seconds).
These three parameters are controlled by java environmental variables and
can be adjusted via:
-Dcrypto.yk.precalc.min=40 -Dcrypto.yk.precalc.max=100 -Dcrypto.yk.precalc.delay=60000
(delay is milliseconds)
To disable precalculation, set min to 0
- Author:
- jrandom
Method Summary |
static java.math.BigInteger[] |
getNextYK()
|
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PROP_YK_PRECALC_MIN
public static final java.lang.String PROP_YK_PRECALC_MIN
- See Also:
- Constant Field Values
PROP_YK_PRECALC_MAX
public static final java.lang.String PROP_YK_PRECALC_MAX
- See Also:
- Constant Field Values
PROP_YK_PRECALC_DELAY
public static final java.lang.String PROP_YK_PRECALC_DELAY
- See Also:
- Constant Field Values
DEFAULT_YK_PRECALC_MIN
public static final java.lang.String DEFAULT_YK_PRECALC_MIN
- See Also:
- Constant Field Values
DEFAULT_YK_PRECALC_MAX
public static final java.lang.String DEFAULT_YK_PRECALC_MAX
- See Also:
- Constant Field Values
DEFAULT_YK_PRECALC_DELAY
public static final java.lang.String DEFAULT_YK_PRECALC_DELAY
- See Also:
- Constant Field Values
YKGenerator
YKGenerator()
getNextYK
public static java.math.BigInteger[] getNextYK()
main
public static void main(java.lang.String[] args)