1package org.bouncycastle.math.field;
2
3import java.math.BigInteger;
4
5class PrimeField implements FiniteField
6{
7    protected final BigInteger characteristic;
8
9    PrimeField(BigInteger characteristic)
10    {
11        this.characteristic = characteristic;
12    }
13
14    public BigInteger getCharacteristic()
15    {
16        return characteristic;
17    }
18
19    public int getDimension()
20    {
21        return 1;
22    }
23
24    public boolean equals(Object obj)
25    {
26        if (this == obj)
27        {
28            return true;
29        }
30        if (!(obj instanceof PrimeField))
31        {
32            return false;
33        }
34        PrimeField other = (PrimeField)obj;
35        return characteristic.equals(other.characteristic);
36    }
37
38    public int hashCode()
39    {
40        return characteristic.hashCode();
41    }
42}
43