public class SettingsMLDSAAlgorithmParameterSpec extends Object implements AlgorithmParameterSpec
Use useRandomizedSigning(boolean)
to switch between randomized and deterministic signing.
Use setContext(byte[])
to set the context used for the sign/verify operation
Call Signature.setParameter(AlgorithmParameterSpec)
before the init() method
Signature mldsa = Signature.getInstance("MLDSA", IaikPq.getInstance()); mldsa.setParameter(new SettingsMLDSAAlgorithmParameterSpec()); mldsa.initSign(...);
Constructor and Description |
---|
SettingsMLDSAAlgorithmParameterSpec()
Creates a default parameter spec with randomized signing enabled and no context set.
|
SettingsMLDSAAlgorithmParameterSpec(boolean randomizedSigning)
Creates a parameter spec with the specified randomized signing setting.
|
SettingsMLDSAAlgorithmParameterSpec(byte[] context)
Creates a parameter spec with the specified context.
|
SettingsMLDSAAlgorithmParameterSpec(byte[] context,
boolean randomizedSigning)
Creates a parameter spec with both the specified context and randomized signing setting.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getContext()
Retrieves the currently set context.
|
boolean |
isRandomizedSigning()
Checks if the current configuration uses randomized signing.
|
void |
setContext(byte[] ctx)
Sets the context for MLDSA operations.
|
void |
useRandomizedSigning(boolean randomizedSigning)
Configures whether signatures should be randomized (true, default) or deterministic (false).
|
public SettingsMLDSAAlgorithmParameterSpec()
public SettingsMLDSAAlgorithmParameterSpec(byte[] context) throws PQException
context
- The context to be used during signing, up to 255 bytes.PQException
- If the context length exceeds 255 bytes or is null.public SettingsMLDSAAlgorithmParameterSpec(boolean randomizedSigning)
randomizedSigning
- Whether to use randomized signing (true, default) or deterministic (false).public SettingsMLDSAAlgorithmParameterSpec(byte[] context, boolean randomizedSigning) throws PQException
context
- The context to be used during signing, up to 255 bytes.randomizedSigning
- Whether to use randomized signing (true, default) or deterministic (false).PQException
- If the context length exceeds 255 bytes or is null.public void setContext(byte[] ctx) throws PQException
ctx
- The context to set, up to 255 bytes.PQException
- If the context is null or exceeds the maximum allowed length.public byte[] getContext()
public void useRandomizedSigning(boolean randomizedSigning)
randomizedSigning
- Whether to use randomized signing.public boolean isRandomizedSigning()
Copyright © 2020–2025 Stiftung SIC. All rights reserved.