public class BLS12_381G2ScalarMulTest
extends junit.framework.TestCase
add and
doublePoint. Covers points in and outside the prime-order subgroup,
negative scalars, and the scalars that drive the mixed addition into its
special cases: r (the accumulator reaches -P, so the final
addition gives infinity) and r + 2 (it reaches P, so the final
addition is a doubling).| Constructor and Description |
|---|
BLS12_381G2ScalarMulTest() |
| Modifier and Type | Method and Description |
|---|---|
void |
testGlsDigitPatterns()
On G2,
constantTimeMultiply splits the scalar into four base-|x|
digits and adds subset sums of P, -psi(P), psi^2(P), -psi^3(P) from a
table. |
void |
testInfinity() |
void |
testPointsOutsideSubgroup() |
void |
testRandomScalarsInSubgroup() |
void |
testSpecialScalars() |
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 testSpecialScalars()
public void testRandomScalarsInSubgroup()
public void testGlsDigitPatterns()
constantTimeMultiply splits the scalar into four base-|x|
digits and adds subset sums of P, -psi(P), psi^2(P), -psi^3(P) from a
table. These scalars give digits that are zero in some columns (so the
table entry is skipped), single-digit scalars that leave the
accumulator at infinity for up to three quarters of the loop, digits at
their maximum |x| - 1, equal digits (only entries 0 and 15), every one
of the 16 entries, and scalars that only reduce mod r into range.public void testPointsOutsideSubgroup()
public void testInfinity()