01: package org.bouncycastle.jce.spec;
02:
03: import java.math.BigInteger;
04:
05: /**
06: * ParameterSpec for a GOST 3410-94 key parameters.
07: */
08: public class GOST3410PublicKeyParameterSetSpec {
09: private BigInteger p;
10: private BigInteger q;
11: private BigInteger a;
12:
13: /**
14: * Creates a new GOST3410ParameterSpec with the specified parameter values.
15: *
16: * @param p the prime.
17: * @param q the sub-prime.
18: * @param a the base.
19: */
20: public GOST3410PublicKeyParameterSetSpec(BigInteger p,
21: BigInteger q, BigInteger a) {
22: this .p = p;
23: this .q = q;
24: this .a = a;
25: }
26:
27: /**
28: * Returns the prime <code>p</code>.
29: *
30: * @return the prime <code>p</code>.
31: */
32: public BigInteger getP() {
33: return this .p;
34: }
35:
36: /**
37: * Returns the sub-prime <code>q</code>.
38: *
39: * @return the sub-prime <code>q</code>.
40: */
41: public BigInteger getQ() {
42: return this .q;
43: }
44:
45: /**
46: * Returns the base <code>a</code>.
47: *
48: * @return the base <code>a</code>.
49: */
50: public BigInteger getA() {
51: return this .a;
52: }
53:
54: public boolean equals(Object o) {
55: if (o instanceof GOST3410PublicKeyParameterSetSpec) {
56: GOST3410PublicKeyParameterSetSpec other = (GOST3410PublicKeyParameterSetSpec) o;
57:
58: return this .a.equals(other.a) && this .p.equals(other.p)
59: && this .q.equals(other.q);
60: }
61:
62: return false;
63: }
64:
65: public int hashCode() {
66: return a.hashCode() ^ p.hashCode() ^ q.hashCode();
67: }
68: }
|