DHValidationParameters.java revision e6bf3e8dfa2804891a82075cb469b736321b4827
1package org.bouncycastle.crypto.params;
2
3import org.bouncycastle.util.Arrays;
4
5public class DHValidationParameters
6{
7    private byte[]  seed;
8    private int     counter;
9
10    public DHValidationParameters(
11        byte[]  seed,
12        int     counter)
13    {
14        this.seed = seed;
15        this.counter = counter;
16    }
17
18    public int getCounter()
19    {
20        return counter;
21    }
22
23    public byte[] getSeed()
24    {
25        return seed;
26    }
27
28    public boolean equals(
29        Object o)
30    {
31        if (!(o instanceof DHValidationParameters))
32        {
33            return false;
34        }
35
36        DHValidationParameters  other = (DHValidationParameters)o;
37
38        if (other.counter != this.counter)
39        {
40            return false;
41        }
42
43        return Arrays.areEqual(this.seed, other.seed);
44    }
45
46    public int hashCode()
47    {
48        return counter ^ Arrays.hashCode(seed);
49    }
50}
51