ECDomainParameters.java revision 5db505e1f6a68c8d5dfdb0fed0b8607dea7bed96
1package org.bouncycastle.crypto.params;
2
3import java.math.BigInteger;
4
5import org.bouncycastle.math.ec.ECConstants;
6import org.bouncycastle.math.ec.ECCurve;
7import org.bouncycastle.math.ec.ECPoint;
8import org.bouncycastle.util.Arrays;
9
10public class ECDomainParameters
11    implements ECConstants
12{
13    private ECCurve     curve;
14    private byte[]      seed;
15    private ECPoint     G;
16    private BigInteger  n;
17    private BigInteger  h;
18
19    public ECDomainParameters(
20        ECCurve     curve,
21        ECPoint     G,
22        BigInteger  n)
23    {
24        this(curve, G, n, ONE, null);
25    }
26
27    public ECDomainParameters(
28        ECCurve     curve,
29        ECPoint     G,
30        BigInteger  n,
31        BigInteger  h)
32    {
33        this(curve, G, n, h, null);
34    }
35
36    public ECDomainParameters(
37        ECCurve     curve,
38        ECPoint     G,
39        BigInteger  n,
40        BigInteger  h,
41        byte[]      seed)
42    {
43        this.curve = curve;
44        this.G = G.normalize();
45        this.n = n;
46        this.h = h;
47        this.seed = seed;
48    }
49
50    public ECCurve getCurve()
51    {
52        return curve;
53    }
54
55    public ECPoint getG()
56    {
57        return G;
58    }
59
60    public BigInteger getN()
61    {
62        return n;
63    }
64
65    public BigInteger getH()
66    {
67        return h;
68    }
69
70    public byte[] getSeed()
71    {
72        return Arrays.clone(seed);
73    }
74}
75