|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bouncycastle.math.ec.ECFieldElement org.bouncycastle.math.ec.ECFieldElement.F2m
public static class ECFieldElement.F2m
Class representing the Elements of the finite field
F2m
in polynomial basis (PB)
representation. Both trinomial (TPB) and pentanomial (PPB) polynomial
basis representations are supported. Gaussian normal basis (GNB)
representation is not supported.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.bouncycastle.math.ec.ECFieldElement |
---|
ECFieldElement.F2m, ECFieldElement.Fp |
Field Summary | |
---|---|
static int |
GNB
Indicates gaussian normal basis representation (GNB). |
private int |
k1
TPB: The integer k where xm +
xk + 1 represents the reduction polynomial
f(z) .PPB: The integer k1 where xm +
xk3 + xk2 + xk1 + 1
represents the reduction polynomial f(z) . |
private int |
k2
TPB: Always set to 0 PPB: The integer k2 where xm +
xk3 + xk2 + xk1 + 1
represents the reduction polynomial f(z) . |
private int |
k3
TPB: Always set to 0 PPB: The integer k3 where xm +
xk3 + xk2 + xk1 + 1
represents the reduction polynomial f(z) . |
private int |
m
The exponent m of F2m . |
static int |
PPB
Indicates pentanomial basis representation (PPB). |
private int |
representation
TPB or PPB. |
private int |
t
The number of int s required to hold m bits. |
static int |
TPB
Indicates trinomial basis representation (TPB). |
private IntArray |
x
The IntArray holding the bits. |
Fields inherited from interface org.bouncycastle.math.ec.ECConstants |
---|
FOUR, ONE, THREE, TWO, ZERO |
Constructor Summary | |
---|---|
|
ECFieldElement.F2m(int m,
int k,
java.math.BigInteger x)
Constructor for TPB. |
|
ECFieldElement.F2m(int m,
int k1,
int k2,
int k3,
java.math.BigInteger x)
Constructor for PPB. |
private |
ECFieldElement.F2m(int m,
int k1,
int k2,
int k3,
IntArray x)
|
Method Summary | |
---|---|
ECFieldElement |
add(ECFieldElement b)
|
static void |
checkFieldElements(ECFieldElement a,
ECFieldElement b)
Checks, if the ECFieldElements a and b
are elements of the same field F2m
(having the same representation). |
ECFieldElement |
divide(ECFieldElement b)
|
boolean |
equals(java.lang.Object anObject)
|
java.lang.String |
getFieldName()
|
int |
getFieldSize()
|
int |
getK1()
|
int |
getK2()
|
int |
getK3()
|
int |
getM()
|
int |
getRepresentation()
|
int |
hashCode()
|
ECFieldElement |
invert()
|
ECFieldElement |
multiply(ECFieldElement b)
|
ECFieldElement |
negate()
|
ECFieldElement |
sqrt()
|
ECFieldElement |
square()
|
ECFieldElement |
subtract(ECFieldElement b)
|
java.math.BigInteger |
toBigInteger()
|
Methods inherited from class org.bouncycastle.math.ec.ECFieldElement |
---|
toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int GNB
public static final int TPB
public static final int PPB
private int representation
private int m
m
of F2m
.
private int k1
k
where xm +
xk + 1
represents the reduction polynomial
f(z)
.k1
where xm +
xk3 + xk2 + xk1 + 1
represents the reduction polynomial f(z)
.
private int k2
0
k2
where xm +
xk3 + xk2 + xk1 + 1
represents the reduction polynomial f(z)
.
private int k3
0
k3
where xm +
xk3 + xk2 + xk1 + 1
represents the reduction polynomial f(z)
.
private IntArray x
IntArray
holding the bits.
private final int t
int
s required to hold m
bits.
Constructor Detail |
---|
public ECFieldElement.F2m(int m, int k1, int k2, int k3, java.math.BigInteger x)
m
- The exponent m
of
F2m
.k1
- The integer k1
where xm +
xk3 + xk2 + xk1 + 1
represents the reduction polynomial f(z)
.k2
- The integer k2
where xm +
xk3 + xk2 + xk1 + 1
represents the reduction polynomial f(z)
.k3
- The integer k3
where xm +
xk3 + xk2 + xk1 + 1
represents the reduction polynomial f(z)
.x
- The BigInteger representing the value of the field element.public ECFieldElement.F2m(int m, int k, java.math.BigInteger x)
m
- The exponent m
of
F2m
.k
- The integer k
where xm +
xk + 1
represents the reduction
polynomial f(z)
.x
- The BigInteger representing the value of the field element.private ECFieldElement.F2m(int m, int k1, int k2, int k3, IntArray x)
Method Detail |
---|
public java.math.BigInteger toBigInteger()
toBigInteger
in class ECFieldElement
public java.lang.String getFieldName()
getFieldName
in class ECFieldElement
public int getFieldSize()
getFieldSize
in class ECFieldElement
public static void checkFieldElements(ECFieldElement a, ECFieldElement b)
a
and b
are elements of the same field F2m
(having the same representation).
a
- field element.b
- field element to be compared.
java.lang.IllegalArgumentException
- if a
and b
are not elements of the same field
F2m
(having the same
representation).public ECFieldElement add(ECFieldElement b)
add
in class ECFieldElement
public ECFieldElement subtract(ECFieldElement b)
subtract
in class ECFieldElement
public ECFieldElement multiply(ECFieldElement b)
multiply
in class ECFieldElement
public ECFieldElement divide(ECFieldElement b)
divide
in class ECFieldElement
public ECFieldElement negate()
negate
in class ECFieldElement
public ECFieldElement square()
square
in class ECFieldElement
public ECFieldElement invert()
invert
in class ECFieldElement
public ECFieldElement sqrt()
sqrt
in class ECFieldElement
public int getRepresentation()
F2m
, either of
TPB (trinomial
basis representation) or
PPB (pentanomial
basis representation).public int getM()
m
of the reduction polynomial
f(z)
.public int getK1()
k
where xm +
xk + 1
represents the reduction polynomial
f(z)
.k1
where xm +
xk3 + xk2 + xk1 + 1
represents the reduction polynomial f(z)
.public int getK2()
0
k2
where xm +
xk3 + xk2 + xk1 + 1
represents the reduction polynomial f(z)
.public int getK3()
0
k3
where xm +
xk3 + xk2 + xk1 + 1
represents the reduction polynomial f(z)
.public boolean equals(java.lang.Object anObject)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |