|
Bouncy Castle Cryptography Library 1.86 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
org.bouncycastle.crypto.threshold.test.ShamirSecretSplitterTest
| Field Summary | |
static byte[][] |
TV011D_TV1_1_2_SPLITS
|
static byte[] |
TV011D_TV1_SECRET
|
static byte[][] |
TV011D_TV1_SPLITS
|
static byte[][] |
TV011D_TV1_SR
|
static byte[][] |
TV011D_TV2_1_2_SPLITS
|
static byte[][] |
TV011D_TV2_1_4_SPLITS
|
static byte[][] |
TV011D_TV2_3_4_SPLITS
|
static byte[] |
TV011D_TV2_SECRET
|
static byte[][] |
TV011D_TV2_SPLITS
|
static byte[][] |
TV011D_TV2_SR
|
static byte[][] |
TV011D_TV3_1_2_3_SPLITS
|
static byte[][] |
TV011D_TV3_1_2_4_SPLITS
|
static byte[][] |
TV011D_TV3_1_3_4_SPLITS
|
static byte[] |
TV011D_TV3_SECRET
|
static byte[][] |
TV011D_TV3_SPLITS
|
static byte[][] |
TV011D_TV3_SR
|
static byte[][] |
TV011D_TV4_1_2_3_4_SPLITS
|
static byte[] |
TV011D_TV4_SECRET
|
static byte[][] |
TV011D_TV4_SPLITS
|
static byte[][] |
TV011D_TV4_SR
|
static byte[][] |
TV011D_TV5_1_2_SPLITS
|
static byte[][] |
TV011D_TV5_8_9_SPLITS
|
static byte[] |
TV011D_TV5_SECRET
|
static byte[][] |
TV011D_TV5_SPLITS
|
static byte[][] |
TV011D_TV5_SR
|
| Constructor Summary | |
ShamirSecretSplitterTest()
|
|
| Method Summary | |
static void |
main(java.lang.String[] args)
|
void |
performTest()
|
void |
testLargeShareSetRecovery()
Recovery has to work for any share count the splitter will produce. getSecret counted the Lagrange products into a byte, so from 130 shares up the index wrapped negative and threw an ArrayIndexOutOfBoundsException. |
void |
testMultipleDivideRejectFieldZero()
divide() and multiple() rewrite every share in place, so a zero divisor or multiplier would silently overwrite the whole set with zeroes and irreversibly destroy the secret. gfMul reduces its operand modulo 256, so the field's zero element is any value with (v & 0xFF) == 0 - not just an exact 0 - and both methods reject it up front. |
void |
testPolynomial()
|
void |
testPolynomialModeEquivalence()
The mode-free getInstance and both deprecated Mode values have to be interchangeable, since all three now run the same GF(256) arithmetic. |
void |
testRecombine(ShamirSplitSecret splitSecret,
byte[] secret)
|
void |
testRecoveryRejectsEmptyShareSet()
Nothing can be recovered from no shares at all. getSecret used to size its Lagrange product array at one less than the share count, so an empty set threw a NegativeArraySizeException. |
void |
testResplitRejectsWrongLengthSecret()
resplit sizes its coefficient rows by l but took the replacement secret at whatever length it came in at, so a short secret silently produced shares shorter than l and a long one threw an ArrayIndexOutOfBoundsException. |
void |
testShamirSecretMultipleDivide()
|
void |
testShamirSecretResplit()
|
void |
testShamirSecretSplitter()
|
void |
testShamirSecretSplitterSplitAround()
|
void |
testShareCountIndependentOfSecretLength()
The generated share array is sized by the requested number of shares n, not by the length l of the secret. |
void |
testSplitAroundRejectsWrongLengthShare()
splitAround folds the supplied share over the secret length l, so a share of any other length used to fail with an ArrayIndexOutOfBoundsException (short), or be carried into the result at its own length while every other share was l bytes (long). |
void |
testSplitAroundThresholdOfOne()
A threshold of one is a degenerate but legal split - every share is the secret. splitAround read the second coefficient row unconditionally, so it threw an ArrayIndexOutOfBoundsException before producing any share. |
| Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString |
| Methods inherited from class junit.framework.Assert |
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, fail, fail |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final byte[][] TV011D_TV1_SR
public static final byte[][] TV011D_TV1_SPLITS
public static final byte[][] TV011D_TV1_1_2_SPLITS
public static final byte[] TV011D_TV1_SECRET
public static final byte[][] TV011D_TV2_SR
public static final byte[][] TV011D_TV2_SPLITS
public static final byte[][] TV011D_TV2_1_2_SPLITS
public static final byte[][] TV011D_TV2_1_4_SPLITS
public static final byte[][] TV011D_TV2_3_4_SPLITS
public static final byte[] TV011D_TV2_SECRET
public static final byte[][] TV011D_TV3_SR
public static final byte[][] TV011D_TV3_SPLITS
public static final byte[][] TV011D_TV3_1_2_3_SPLITS
public static final byte[][] TV011D_TV3_1_2_4_SPLITS
public static final byte[][] TV011D_TV3_1_3_4_SPLITS
public static final byte[] TV011D_TV3_SECRET
public static final byte[][] TV011D_TV4_SR
public static final byte[][] TV011D_TV4_SPLITS
public static final byte[][] TV011D_TV4_1_2_3_4_SPLITS
public static final byte[] TV011D_TV4_SECRET
public static final byte[][] TV011D_TV5_SR
public static final byte[][] TV011D_TV5_SPLITS
public static final byte[][] TV011D_TV5_1_2_SPLITS
public static final byte[][] TV011D_TV5_8_9_SPLITS
public static final byte[] TV011D_TV5_SECRET
| Constructor Detail |
public ShamirSecretSplitterTest()
| Method Detail |
public static void main(java.lang.String[] args)
throws java.io.IOException
java.io.IOException
public void performTest()
throws java.io.IOException
java.io.IOException
public void testResplitRejectsWrongLengthSecret()
throws java.io.IOException
java.io.IOException
public void testRecoveryRejectsEmptyShareSet()
throws java.io.IOException
java.io.IOException
public void testLargeShareSetRecovery()
throws java.io.IOException
java.io.IOException
public void testSplitAroundThresholdOfOne()
throws java.io.IOException
java.io.IOException
public void testSplitAroundRejectsWrongLengthShare()
throws java.io.IOException
java.io.IOException
public void testShareCountIndependentOfSecretLength()
throws java.io.IOException
java.io.IOException
public void testPolynomialModeEquivalence()
throws java.io.IOException
java.io.IOException
public void testShamirSecretResplit()
throws java.io.IOException
java.io.IOException
public void testShamirSecretMultipleDivide()
throws java.io.IOException
java.io.IOException
public void testMultipleDivideRejectFieldZero()
throws java.io.IOException
java.io.IOException
public void testShamirSecretSplitterSplitAround()
throws java.io.IOException
java.io.IOException
public void testShamirSecretSplitter()
throws java.io.IOException
java.io.IOException
public void testPolynomial()
throws java.io.IOException
java.io.IOException
public void testRecombine(ShamirSplitSecret splitSecret,
byte[] secret)
throws java.io.IOException
java.io.IOException
|
Bouncy Castle Cryptography Library 1.86 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||