• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.bouncycastle.crypto.params;
2 
3 import org.bouncycastle.util.Arrays;
4 
5 public class DSAValidationParameters
6 {
7     private int usageIndex;
8     private byte[]  seed;
9     private int     counter;
10 
DSAValidationParameters( byte[] seed, int counter)11     public DSAValidationParameters(
12         byte[]  seed,
13         int     counter)
14     {
15         this(seed, counter, -1);
16     }
17 
DSAValidationParameters( byte[] seed, int counter, int usageIndex)18     public DSAValidationParameters(
19         byte[]  seed,
20         int     counter,
21         int     usageIndex)
22     {
23         this.seed = seed;
24         this.counter = counter;
25         this.usageIndex = usageIndex;
26     }
27 
getCounter()28     public int getCounter()
29     {
30         return counter;
31     }
32 
getSeed()33     public byte[] getSeed()
34     {
35         return seed;
36     }
37 
getUsageIndex()38     public int getUsageIndex()
39     {
40         return usageIndex;
41     }
42 
hashCode()43     public int hashCode()
44     {
45         return counter ^ Arrays.hashCode(seed);
46     }
47 
equals( Object o)48     public boolean equals(
49         Object o)
50     {
51         if (!(o instanceof DSAValidationParameters))
52         {
53             return false;
54         }
55 
56         DSAValidationParameters  other = (DSAValidationParameters)o;
57 
58         if (other.counter != this.counter)
59         {
60             return false;
61         }
62 
63         return Arrays.areEqual(this.seed, other.seed);
64     }
65 }
66