blob: ad29ed657efc1f15220fe24fa8d97090fb9b69c9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
package org.spongycastle.crypto.params;
import org.spongycastle.crypto.CipherParameters;
import java.math.BigInteger;
public class GOST3410Parameters
implements CipherParameters
{
private BigInteger p;
private BigInteger q;
private BigInteger a;
private GOST3410ValidationParameters validation;
public GOST3410Parameters(
BigInteger p,
BigInteger q,
BigInteger a)
{
this.p = p;
this.q = q;
this.a = a;
}
public GOST3410Parameters(
BigInteger p,
BigInteger q,
BigInteger a,
GOST3410ValidationParameters params)
{
this.a = a;
this.p = p;
this.q = q;
this.validation = params;
}
public BigInteger getP()
{
return p;
}
public BigInteger getQ()
{
return q;
}
public BigInteger getA()
{
return a;
}
public GOST3410ValidationParameters getValidationParameters()
{
return validation;
}
public int hashCode()
{
return p.hashCode() ^ q.hashCode() ^ a.hashCode();
}
public boolean equals(
Object obj)
{
if (!(obj instanceof GOST3410Parameters))
{
return false;
}
GOST3410Parameters pm = (GOST3410Parameters)obj;
return (pm.getP().equals(p) && pm.getQ().equals(q) && pm.getA().equals(a));
}
}
|