~brian-thomason/+junk/bouncycastle

« back to all changes in this revision

Viewing changes to src/org/bouncycastle/crypto/params/DSAValidationParameters.java

  • Committer: Brian Thomason
  • Date: 2011-12-20 17:20:32 UTC
  • Revision ID: brian.thomason@canonical.com-20111220172032-rdtm13jgdxtksacr
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.bouncycastle.crypto.params;
 
2
 
 
3
import org.bouncycastle.util.Arrays;
 
4
 
 
5
public class DSAValidationParameters
 
6
{
 
7
    private byte[]  seed;
 
8
    private int     counter;
 
9
 
 
10
    public DSAValidationParameters(
 
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 int hashCode()
 
29
    {
 
30
        return counter ^ Arrays.hashCode(seed);
 
31
    }
 
32
    
 
33
    public boolean equals(
 
34
        Object o)
 
35
    {
 
36
        if (!(o instanceof DSAValidationParameters))
 
37
        {
 
38
            return false;
 
39
        }
 
40
 
 
41
        DSAValidationParameters  other = (DSAValidationParameters)o;
 
42
 
 
43
        if (other.counter != this.counter)
 
44
        {
 
45
            return false;
 
46
        }
 
47
 
 
48
        return Arrays.areEqual(this.seed, other.seed);
 
49
    }
 
50
}