org.spongycastle.pqc.jcajce.spec.SPHINCS256KeyGenParameterSpec Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of prov Show documentation
Show all versions of prov Show documentation
Spongy Castle is a package-rename (org.bouncycastle.* to org.spongycastle.*) of Bouncy Castle
intended for the Android platform. Android unfortunately ships with a stripped-down version of
Bouncy Castle, which prevents easy upgrades - Spongy Castle overcomes this and provides a full,
up-to-date version of the Bouncy Castle cryptographic libs.
The newest version!
package org.spongycastle.pqc.jcajce.spec;
import java.security.spec.AlgorithmParameterSpec;
/**
* Key generation spec for SPHINCS-256 to allow specifying of tree hash.
*/
public class SPHINCS256KeyGenParameterSpec
implements AlgorithmParameterSpec
{
/**
* Use SHA512-256 for the tree generation function.
*/
public static final String SHA512_256 = "SHA512-256";
/**
* Use SHA3-256 for the tree generation function.
*/
public static final String SHA3_256 = "SHA3-256";
private final String treeHash;
/**
* Default constructor SHA512-256
*/
public SPHINCS256KeyGenParameterSpec()
{
this(SHA512_256);
}
/**
* Specify the treehash, one of SHA512-256, or SHA3-256.
*
* @param treeHash the hash for building the public key tree.
*/
public SPHINCS256KeyGenParameterSpec(String treeHash)
{
this.treeHash = treeHash;
}
public String getTreeDigest()
{
return treeHash;
}
}