use of com.github.zhenwei.core.crypto.generators.GOST3410ParametersGenerator in project LinLong-Java by zhenwei1108.
the class AlgorithmParameterGeneratorSpi method engineGenerateParameters.
protected AlgorithmParameters engineGenerateParameters() {
GOST3410ParametersGenerator pGen = new GOST3410ParametersGenerator();
if (random != null) {
pGen.init(strength, 2, random);
} else {
pGen.init(strength, 2, CryptoServicesRegistrar.getSecureRandom());
}
GOST3410Parameters p = pGen.generateParameters();
AlgorithmParameters params;
try {
params = createParametersInstance("GOST3410");
params.init(new GOST3410ParameterSpec(new GOST3410PublicKeyParameterSetSpec(p.getP(), p.getQ(), p.getA())));
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
return params;
}
Aggregations