diff options
author | David Hook <dgh@cryptoworkshop.com> | 2013-05-31 11:07:45 +0400 |
---|---|---|
committer | David Hook <dgh@cryptoworkshop.com> | 2013-05-31 11:07:45 +0400 |
commit | 2b976f5364cfdbc37d3086019d93483c983eb80b (patch) | |
tree | cb846af3fd1d43f9c2562a1fb2d06b997ad8f229 /core/src/main/java/org/bouncycastle/crypto/params/GOST3410Parameters.java | |
parent | 5f714bd92fbd780d22406f4bc3681be005f6f04a (diff) |
initial reshuffle
Diffstat (limited to 'core/src/main/java/org/bouncycastle/crypto/params/GOST3410Parameters.java')
-rw-r--r-- | core/src/main/java/org/bouncycastle/crypto/params/GOST3410Parameters.java | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/core/src/main/java/org/bouncycastle/crypto/params/GOST3410Parameters.java b/core/src/main/java/org/bouncycastle/crypto/params/GOST3410Parameters.java new file mode 100644 index 00000000..07450f61 --- /dev/null +++ b/core/src/main/java/org/bouncycastle/crypto/params/GOST3410Parameters.java @@ -0,0 +1,74 @@ +package org.bouncycastle.crypto.params; + +import org.bouncycastle.crypto.CipherParameters; + +import java.math.BigInteger; + +public class GOST3410Parameters + implements CipherParameters +{ + private BigInteger p; + private BigInteger q; + private BigInteger a; + private GOST3410ValidationParameters validation; + + public GOST3410Parameters( + BigInteger p, + BigInteger q, + BigInteger a) + { + this.p = p; + this.q = q; + this.a = a; + } + + public GOST3410Parameters( + BigInteger p, + BigInteger q, + BigInteger a, + GOST3410ValidationParameters params) + { + this.a = a; + this.p = p; + this.q = q; + this.validation = params; + } + + public BigInteger getP() + { + return p; + } + + public BigInteger getQ() + { + return q; + } + + public BigInteger getA() + { + return a; + } + + public GOST3410ValidationParameters getValidationParameters() + { + return validation; + } + + public int hashCode() + { + return p.hashCode() ^ q.hashCode() ^ a.hashCode(); + } + + public boolean equals( + Object obj) + { + if (!(obj instanceof GOST3410Parameters)) + { + return false; + } + + GOST3410Parameters pm = (GOST3410Parameters)obj; + + return (pm.getP().equals(p) && pm.getQ().equals(q) && pm.getA().equals(a)); + } +} |