![JAR search and dependency download from the Maven repository](/logo.png)
org.bouncycastle.jcajce.spec.GOST28147ParameterSpec Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bc-fips-debug Show documentation
Show all versions of bc-fips-debug Show documentation
The FIPS 140-2 Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms certified to FIPS 140-2 level 1. This jar contains the debug version JCE provider and low-level API for the BC-FJA version 1.0.2.3, FIPS Certificate #3514. Please note the debug jar is not certified.
package org.bouncycastle.jcajce.spec;
import java.security.spec.AlgorithmParameterSpec;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.crypto.general.GOST28147;
import org.bouncycastle.util.Arrays;
/**
* A parameter spec for the GOST-28147 cipher.
*/
public class GOST28147ParameterSpec
implements AlgorithmParameterSpec
{
private final byte[] iv;
private final byte[] sBox;
public GOST28147ParameterSpec(
byte[] sBox)
{
this(sBox, null);
}
public GOST28147ParameterSpec(
byte[] sBox,
byte[] iv)
{
this.sBox = Arrays.clone(sBox);
this.iv = Arrays.clone(iv);
}
public GOST28147ParameterSpec(
String sBoxName)
{
this(sBoxName, null);
}
public GOST28147ParameterSpec(
String sBoxName,
byte[] iv)
{
this.sBox = GOST28147.getSBox(sBoxName);
this.iv = Arrays.clone(iv);
}
public GOST28147ParameterSpec(
ASN1ObjectIdentifier sBoxOID,
byte[] iv)
{
this.sBox = GOST28147.getSBox(sBoxOID);
this.iv = Arrays.clone(iv);
}
public byte[] getSBox()
{
return Arrays.clone(sBox);
}
/**
* Returns the IV or null if this parameter set does not contain an IV.
*
* @return the IV or null if this parameter set does not contain an IV.
*/
public byte[] getIV()
{
return Arrays.clone(iv);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy