~brian-thomason/+junk/bouncycastle

« back to all changes in this revision

Viewing changes to src/org/bouncycastle/crypto/params/ElGamalPublicKeyParameters.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 java.math.BigInteger;
 
4
 
 
5
public class ElGamalPublicKeyParameters
 
6
    extends ElGamalKeyParameters
 
7
{
 
8
    private BigInteger      y;
 
9
 
 
10
    public ElGamalPublicKeyParameters(
 
11
        BigInteger      y,
 
12
        ElGamalParameters    params)
 
13
    {
 
14
        super(false, params);
 
15
 
 
16
        this.y = y;
 
17
    }   
 
18
 
 
19
    public BigInteger getY()
 
20
    {
 
21
        return y;
 
22
    }
 
23
 
 
24
    public int hashCode()
 
25
    {
 
26
        return y.hashCode() ^ super.hashCode();
 
27
    }
 
28
 
 
29
    public boolean equals(
 
30
        Object  obj)
 
31
    {
 
32
        if (!(obj instanceof ElGamalPublicKeyParameters))
 
33
        {
 
34
            return false;
 
35
        }
 
36
 
 
37
        ElGamalPublicKeyParameters   other = (ElGamalPublicKeyParameters)obj;
 
38
 
 
39
        return other.getY().equals(y) && super.equals(obj);
 
40
    }
 
41
}