01: package org.bouncycastle.crypto.params;
02:
03: import org.bouncycastle.crypto.CipherParameters;
04:
05: import java.math.BigInteger;
06:
07: public class GOST3410Parameters implements CipherParameters {
08: private BigInteger p;
09: private BigInteger q;
10: private BigInteger a;
11: private GOST3410ValidationParameters validation;
12:
13: public GOST3410Parameters(BigInteger p, BigInteger q, BigInteger a) {
14: this .p = p;
15: this .q = q;
16: this .a = a;
17: }
18:
19: public GOST3410Parameters(BigInteger p, BigInteger q, BigInteger a,
20: GOST3410ValidationParameters params) {
21: this .a = a;
22: this .p = p;
23: this .q = q;
24: this .validation = params;
25: }
26:
27: public BigInteger getP() {
28: return p;
29: }
30:
31: public BigInteger getQ() {
32: return q;
33: }
34:
35: public BigInteger getA() {
36: return a;
37: }
38:
39: public GOST3410ValidationParameters getValidationParameters() {
40: return validation;
41: }
42:
43: public int hashCode() {
44: return p.hashCode() ^ q.hashCode() ^ a.hashCode();
45: }
46:
47: public boolean equals(Object obj) {
48: if (!(obj instanceof GOST3410Parameters)) {
49: return false;
50: }
51:
52: GOST3410Parameters pm = (GOST3410Parameters) obj;
53:
54: return (pm.getP().equals(p) && pm.getQ().equals(q) && pm.getA()
55: .equals(a));
56: }
57: }
|