JCE: move rng.init() into initialize() methods of WolfCryptKeyPairGenerator
parent
947db4345a
commit
5f382e244d
|
@ -91,9 +91,6 @@ public class WolfCryptKeyPairGenerator extends KeyPairGeneratorSpi {
|
||||||
|
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
|
||||||
this.rng = new Rng();
|
|
||||||
this.rng.init();
|
|
||||||
|
|
||||||
if (debug.DEBUG)
|
if (debug.DEBUG)
|
||||||
algString = typeToString(type);
|
algString = typeToString(type);
|
||||||
}
|
}
|
||||||
|
@ -114,6 +111,13 @@ public class WolfCryptKeyPairGenerator extends KeyPairGeneratorSpi {
|
||||||
this.publicExponent = Rsa.getDefaultRsaExponent();
|
this.publicExponent = Rsa.getDefaultRsaExponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
synchronized (rngLock) {
|
||||||
|
if (this.rng == null) {
|
||||||
|
this.rng = new Rng();
|
||||||
|
this.rng.init();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (debug.DEBUG)
|
if (debug.DEBUG)
|
||||||
log("init with keysize: " + keysize);
|
log("init with keysize: " + keysize);
|
||||||
}
|
}
|
||||||
|
@ -127,6 +131,13 @@ public class WolfCryptKeyPairGenerator extends KeyPairGeneratorSpi {
|
||||||
"AlgorithmParameterSpec must not be null");
|
"AlgorithmParameterSpec must not be null");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
synchronized (rngLock) {
|
||||||
|
if (this.rng == null) {
|
||||||
|
this.rng = new Rng();
|
||||||
|
this.rng.init();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|
||||||
case WC_RSA:
|
case WC_RSA:
|
||||||
|
|
Loading…
Reference in New Issue