public class DilithiumAlgorithmParametersSpi extends PQAlgorithmParameterSpi<DilithiumAlgorithmParameterSpec>
This class represents the opaque definition of parameters used in the Dilithium Algorithm[0]. The class extends AlgorithmParametersSpi as intended by the JCA.
A caller might request an instance of this class by calling the method AlgorithmParameters.getInstance(String), with the parameter "Dilithium". All necessary functionality for usage according to JCA is implemented.
References: [0] Bai, Ducas, Kiltz, Lepoint, Lyubashevsky, Schwabe, Seiler and Stehlé: "CRYSTALS-Dilithium" - 8 February, 2021
AlgorithmParameters
Constructor and Description |
---|
DilithiumAlgorithmParametersSpi() |
Modifier and Type | Method and Description |
---|---|
protected DilithiumAlgorithmParameterSpec |
createNewInstance(iaik.asn1.structures.AlgorithmID algorithmID) |
protected byte[] |
engineGetEncoded()
Encodes this object with default encoding, which is
ASN.1 . |
protected byte[] |
engineGetEncoded(String format)
Encodes this object with the provided parameters and encoding.
|
protected <T extends AlgorithmParameterSpec> |
engineGetParameterSpec(Class<T> paramSpec)
Creates a new instance of a transparent representation of this AlgorithmParameters-Class.
|
protected void |
engineInit(AlgorithmParameterSpec paramSpec)
Inits the object with the provided AlgorithmParameterSpec.
|
protected void |
engineInit(byte[] params)
Inits the object with the provided parameters in default encoding, which is
ASN.1 . |
protected void |
engineInit(byte[] params,
String format)
Inits the object with the provided parameters and encoding.
|
protected String |
engineToString()
Returns a string representation of this object.
|
getParams
public DilithiumAlgorithmParametersSpi() throws PQException
PQException
protected DilithiumAlgorithmParameterSpec createNewInstance(iaik.asn1.structures.AlgorithmID algorithmID) throws PQException
createNewInstance
in class PQAlgorithmParameterSpi<DilithiumAlgorithmParameterSpec>
PQException
protected void engineInit(AlgorithmParameterSpec paramSpec) throws InvalidParameterSpecException
engineInit
in class PQAlgorithmParameterSpi<DilithiumAlgorithmParameterSpec>
paramSpec
- an instance of DilithiumAlgorithmParameterSpec.InvalidParameterSpecException
- if provided parameters are not an instance of DilithiumAlgorithmParameterSpec.protected void engineInit(byte[] params) throws IOException
ASN.1
.engineInit
in class PQAlgorithmParameterSpi<DilithiumAlgorithmParameterSpec>
params
- the ASN.1
encoded parameters.IOException
- If the provided parameters are not encoded in ASN.1
or if
params are corrupted.protected void engineInit(byte[] params, String format) throws IOException
ASN.1
is
supported.engineInit
in class PQAlgorithmParameterSpi<DilithiumAlgorithmParameterSpec>
params
- the ASN.1
encoded parameters.format
- the format.IOException
- if format is not ASN.1
or if params are corrupted.protected <T extends AlgorithmParameterSpec> T engineGetParameterSpec(Class<T> paramSpec) throws InvalidParameterSpecException
engineGetParameterSpec
in class PQAlgorithmParameterSpi<DilithiumAlgorithmParameterSpec>
paramSpec
- The class that should be created (must be DilithiumAlgorithmParameterSpec).InvalidParameterSpecException
- if provided class is not DilithiumAlgorithmParameterSpec.protected byte[] engineGetEncoded() throws IOException
ASN.1
.engineGetEncoded
in class PQAlgorithmParameterSpi<DilithiumAlgorithmParameterSpec>
ASN.1
encoded parameters as byte array.IOException
- if is not possible to serialize the parameters.protected byte[] engineGetEncoded(String format) throws IOException
ASN.1
is supported.engineGetEncoded
in class PQAlgorithmParameterSpi<DilithiumAlgorithmParameterSpec>
ASN.1
encoded parameters as byte array.IOException
- if is not possible to serialize the parameters or format is not
ASN.1
.protected String engineToString()
engineToString
in class PQAlgorithmParameterSpi<DilithiumAlgorithmParameterSpec>
Copyright © 2020–2023 Stiftung SIC. All rights reserved.