01: package org.bouncycastle.crypto.params;
02:
03: import org.bouncycastle.util.Arrays;
04:
05: public class DHValidationParameters {
06: private byte[] seed;
07: private int counter;
08:
09: public DHValidationParameters(byte[] seed, int counter) {
10: this .seed = seed;
11: this .counter = counter;
12: }
13:
14: public int getCounter() {
15: return counter;
16: }
17:
18: public byte[] getSeed() {
19: return seed;
20: }
21:
22: public boolean equals(Object o) {
23: if (!(o instanceof DHValidationParameters)) {
24: return false;
25: }
26:
27: DHValidationParameters other = (DHValidationParameters) o;
28:
29: if (other.counter != this .counter) {
30: return false;
31: }
32:
33: return Arrays.areEqual(this .seed, other.seed);
34: }
35:
36: public int hashCode() {
37: return counter ^ Arrays.hashCode(seed);
38: }
39: }
|