diff options
Diffstat (limited to 'core/src/main/java/org/spongycastle/crypto/params/DSAValidationParameters.java')
-rw-r--r-- | core/src/main/java/org/spongycastle/crypto/params/DSAValidationParameters.java | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/core/src/main/java/org/spongycastle/crypto/params/DSAValidationParameters.java b/core/src/main/java/org/spongycastle/crypto/params/DSAValidationParameters.java new file mode 100644 index 00000000..ca7c6cf6 --- /dev/null +++ b/core/src/main/java/org/spongycastle/crypto/params/DSAValidationParameters.java @@ -0,0 +1,65 @@ +package org.spongycastle.crypto.params; + +import org.spongycastle.util.Arrays; + +public class DSAValidationParameters +{ + private int usageIndex; + private byte[] seed; + private int counter; + + public DSAValidationParameters( + byte[] seed, + int counter) + { + this(seed, counter, -1); + } + + public DSAValidationParameters( + byte[] seed, + int counter, + int usageIndex) + { + this.seed = seed; + this.counter = counter; + this.usageIndex = usageIndex; + } + + public int getCounter() + { + return counter; + } + + public byte[] getSeed() + { + return seed; + } + + public int getUsageIndex() + { + return usageIndex; + } + + public int hashCode() + { + return counter ^ Arrays.hashCode(seed); + } + + public boolean equals( + Object o) + { + if (!(o instanceof DSAValidationParameters)) + { + return false; + } + + DSAValidationParameters other = (DSAValidationParameters)o; + + if (other.counter != this.counter) + { + return false; + } + + return Arrays.areEqual(this.seed, other.seed); + } +} |