public final class DeterministicSigning extends Object implements AlgorithmParameterSpec
Signature.setParameter(AlgorithmParameterSpec)
:
Signature ecdsa = Signature.getInstance("...", ECCelerate.getInstance()); ecdsa.setParameter(new DeterministicSigning()); ecdsa.initSign(...);Note that when using deterministic signing together with raw ECDSA signatures, the hash algorithm to used for building the PRNG to derive the ephemeral keys has to be specified explicitly.
References:
[1] T. Pornin, "Deterministic Usage of the Digital Signature Algorithm (DSA) and Elliptic Curve Digital Signature Algorithm (ECDSA)", https://tools.ietf.org/html/rfc6979
Constructor and Description |
---|
DeterministicSigning()
Enable deterministic signing.
|
DeterministicSigning(iaik.asn1.structures.AlgorithmID hash)
Enable/disable deterministic signing.
|
DeterministicSigning(iaik.asn1.structures.AlgorithmID hash,
boolean enableDeterministic)
Enable/disable deterministic signing.
|
Modifier and Type | Method and Description |
---|---|
static void |
setECDSASignatureCheckEnabled(boolean enable)
Decides whether to verify an ECDSA signature immediately after having been
created.
|
public DeterministicSigning(iaik.asn1.structures.AlgorithmID hash, boolean enableDeterministic)
hash
- hash algorithm to use for deterministic signing when using raw
ECDSA signaturesenableDeterministic
- flag indicating whether deterministic signing should be enabledpublic DeterministicSigning()
public DeterministicSigning(iaik.asn1.structures.AlgorithmID hash)
hash
- hash algorithm to use for deterministic signing when using raw
ECDSA signaturespublic static void setECDSASignatureCheckEnabled(boolean enable)
Verification of an ECDSA signature maybe appropriate as countermeasure
against fault attacks on signatures (one that is correct and a
second that has a fault) that are produced with the same nonce value.
Verifying a signature immediately after creation may be appropriate
especially when ECDSA is used in deterministic
mode. For that reason this implementation by default verifies
deterministic ECDSA signatures immediately after creation and (for performance reasons)
does not verify non-deterministic ECDSA signatures.
An application can change the default behavior by either enabling automatic ECDSA signature verification for all (deterministic and non-deterministic) signatures (for the sake of security):
ECCelerate.setECDSASignatureCheckEnabled(true);or by disabling it for all (deterministic and non-deterministic) signatures (for the sake of performance):
ECCelerate.setECDSASignatureCheckEnabled(false);
enable
- true
to verify any ECDSA signature immediately after creation,
false
to not verify any ECDSA signature immediately after creationCopyright © 2011–2022 Stiftung SIC. All rights reserved.