use of org.bouncycastle.pqc.crypto.sphincsplus.SPHINCSPlusKeyGenerationParameters in project jmulticard by ctt-gob-es.
the class SPHINCSPlusKeyPairGeneratorSpi method initialize.
public void initialize(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException {
if (!(params instanceof SPHINCSPlusParameterSpec)) {
throw new InvalidAlgorithmParameterException("parameter object not a CMCEParameterSpec");
}
param = new SPHINCSPlusKeyGenerationParameters(random, (SPHINCSPlusParameters) parameters.get(getNameFromParams(params)));
engine.init(param);
initialised = true;
}
use of org.bouncycastle.pqc.crypto.sphincsplus.SPHINCSPlusKeyGenerationParameters in project jmulticard by ctt-gob-es.
the class SPHINCSPlusKeyPairGeneratorSpi method generateKeyPair.
public KeyPair generateKeyPair() {
if (!initialised) {
param = new SPHINCSPlusKeyGenerationParameters(random, SPHINCSPlusParameters.sha256_256s);
engine.init(param);
initialised = true;
}
AsymmetricCipherKeyPair pair = engine.generateKeyPair();
SPHINCSPlusPublicKeyParameters pub = (SPHINCSPlusPublicKeyParameters) pair.getPublic();
SPHINCSPlusPrivateKeyParameters priv = (SPHINCSPlusPrivateKeyParameters) pair.getPrivate();
return new KeyPair(new BCSPHINCSPlusPublicKey(pub), new BCSPHINCSPlusPrivateKey(priv));
}
Aggregations