public class Fp6Fp12Test
extends junit.framework.TestCase
These tests do not depend on external KAT vectors; they exercise the field laws directly. A correct Fp^6 / Fp^12 implementation must satisfy:
a * a^-1 == 1.(a + b)^2 == a^2 + 2*a*b + b^2.a^(q-1) == 1
for nonzero a, where q == p^6 or p^12.conjugate^2 == identity, and
(a*b).conjugate == a.conjugate * b.conjugate.| Constructor and Description |
|---|
Fp6Fp12Test() |
| Modifier and Type | Method and Description |
|---|---|
void |
testFp12Conjugate() |
void |
testFp12ConjugateEqualsP6Frobenius() |
void |
testFp12Distributive() |
void |
testFp12FermatSubgroupOrder() |
void |
testFp12FrobeniusMatchesModPow() |
void |
testFp12FrobeniusSquaredMatchesModPow() |
void |
testFp12FromFp6Embedding() |
void |
testFp12Inverse() |
void |
testFp12MulAssociative() |
void |
testFp12MulCommutative() |
void |
testFp12SquareMatchesMul() |
void |
testFp12SquareOfSum() |
void |
testFp2MulMatchesSchoolbook()
Fp^2 multiplication against the four-product schoolbook formula, including
components at the top of the range, where Karatsuba's sums are largest.
|
void |
testFp2MulNegativeRealPart()
Products whose real part
ac - bd is a large negative number that a
Barrett estimate would overshoot unless it is first shifted into range
(found by search; about 0.5% of negative values behave this way). |
void |
testFp2OpsMatchReference()
The other Fp^2 operations against plain
BigInteger.mod arithmetic,
with the same edge components: the reductions are Barrett and conditional
add/subtract, whose boundaries sit at 0, p - 1 and products near 2p^2. |
void |
testFp6Add() |
void |
testFp6Distributive() |
void |
testFp6FermatSubgroupOrder() |
void |
testFp6FrobeniusMatchesModPow() |
void |
testFp6FrobeniusSquaredMatchesModPow() |
void |
testFp6FromFp2Embedding() |
void |
testFp6Inverse() |
void |
testFp6MulAssociative() |
void |
testFp6MulByV() |
void |
testFp6MulCommutative() |
void |
testFp6MulMatchesSchoolbook()
Fp^6 multiplication against the nine-product schoolbook formula with the
products by xi = 1 + I done as full Fp^2 multiplications.
|
void |
testFp6SquareMatchesMul() |
void |
testFp6SquareOfSum() |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, setUp, tearDown, toStringpublic void testFp6Add()
public void testFp6MulCommutative()
public void testFp6MulAssociative()
public void testFp6Distributive()
public void testFp6SquareMatchesMul()
public void testFp6SquareOfSum()
public void testFp6Inverse()
public void testFp6FermatSubgroupOrder()
public void testFp6MulByV()
public void testFp6FromFp2Embedding()
public void testFp12MulCommutative()
public void testFp12MulAssociative()
public void testFp12Distributive()
public void testFp12SquareMatchesMul()
public void testFp12SquareOfSum()
public void testFp12Inverse()
public void testFp12Conjugate()
public void testFp12ConjugateEqualsP6Frobenius()
public void testFp12FermatSubgroupOrder()
public void testFp6FrobeniusMatchesModPow()
public void testFp12FrobeniusMatchesModPow()
public void testFp6FrobeniusSquaredMatchesModPow()
public void testFp12FrobeniusSquaredMatchesModPow()
public void testFp12FromFp6Embedding()
public void testFp2MulMatchesSchoolbook()
public void testFp2OpsMatchReference()
BigInteger.mod arithmetic,
with the same edge components: the reductions are Barrett and conditional
add/subtract, whose boundaries sit at 0, p - 1 and products near 2p^2.public void testFp2MulNegativeRealPart()
ac - bd is a large negative number that a
Barrett estimate would overshoot unless it is first shifted into range
(found by search; about 0.5% of negative values behave this way).public void testFp6MulMatchesSchoolbook()