// Path: src/main/java/com/tiemens/secretshare/exceptions/SecretShareException.java
// public class SecretShareException
//     extends RuntimeException
// {
//     // ==================================================
//     // class static data
//     // ==================================================
// 
//     private static final long serialVersionUID = 2193317873773384997L;
// 
//     // ==================================================
//     // class static methods
//     // ==================================================
// 
// 
// 
//     // ==================================================
//     // instance data
//     // ==================================================
// 
//     // ==================================================
//     // factories
//     // ==================================================
// 
//     // ==================================================
//     // constructors
//     // ==================================================
// 
// 
//     /** Constructs a new runtime exception with the specified detail message.
//      * The cause is not initialized, and may subsequently be initialized by a
//      * call to {@link #initCause}.
//      *
//      * @param   message   the detail message. The detail message is saved for
//      *          later retrieval by the {@link #getMessage()} method.
//      */
//     public SecretShareException(final String message)
//     {
//         super(message);
//     }
// 
//     /**
//      * Constructs a new runtime exception with the specified detail message and
//      * cause.  <p>Note that the detail message associated with
//      * <code>cause</code> is <i>not</i> automatically incorporated in
//      * this runtime exception's detail message.
//      *
//      * @param  message the detail message (which is saved for later retrieval
//      *         by the {@link #getMessage()} method).
//      * @param  cause the cause (which is saved for later retrieval by the
//      *         {@link #getCause()} method).  (A <code>null</code> value is
//      *         permitted, and indicates that the cause is nonexistent or
//      *         unknown.)
//      */
//     public SecretShareException(final String message,
//                                 final Throwable cause)
//     {
//         super(message, cause);
//     }
// 
//     // ==================================================
//     // public methods
//     // ==================================================
// 
//     // ==================================================
//     // non public methods
//     // ==================================================
// }


import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import java.math.BigInteger;
import java.security.SecureRandom;
import java.util.Random;
import org.junit.Assert;
import org.junit.Test;
import com.tiemens.secretshare.exceptions.SecretShareException;
        // true = generates 'reallyBad'[odd] string     false = run tests
        boolean runAsGenerate = false;

        String[] reallyBad = new String[] {
                "AB##",     "461C44",
                "8f4...",   "1750A6",
                "$",        "7DE9C3",
                "00abcO",   "E5D568",          // that is abc-letter-O not abc-zero
        };

        for (int i = 0, n = reallyBad.length; i < n; i += 2)
        {
            if (runAsGenerate)
            {
                // This path generates the strings above
                String s = reallyBad[i];
                System.out.println("\"" + s + "\",    \"" +
                                   BigIntStringChecksum.computeMd5ChecksumLimit6(s) + "\",");
            }
            else
            {
                // This path checks the strings above

                BigIntStringChecksum bisc = new BigIntStringChecksum(reallyBad[i],
                                                                     reallyBad[i + 1]);
                try
                {
                    bisc.asBigInteger();   // should throw exception
                    Assert.fail("Really bad input '" + reallyBad[i] + "' failed to fail");
                }
// Path: src/main/java/com/tiemens/secretshare/exceptions/SecretShareException.java
// public class SecretShareException
//     extends RuntimeException
// {
//     // ==================================================
//     // class static data
//     // ==================================================
// 
//     private static final long serialVersionUID = 2193317873773384997L;
// 
//     // ==================================================
//     // class static methods
//     // ==================================================
// 
// 
// 
//     // ==================================================
//     // instance data
//     // ==================================================
// 
//     // ==================================================
//     // factories
//     // ==================================================
// 
//     // ==================================================
//     // constructors
//     // ==================================================
// 
// 
//     /** Constructs a new runtime exception with the specified detail message.
//      * The cause is not initialized, and may subsequently be initialized by a
//      * call to {@link #initCause}.
//      *
//      * @param   message   the detail message. The detail message is saved for
//      *          later retrieval by the {@link #getMessage()} method.
//      */
//     public SecretShareException(final String message)
//     {
//         super(message);
//     }
// 
//     /**
//      * Constructs a new runtime exception with the specified detail message and
//      * cause.  <p>Note that the detail message associated with
//      * <code>cause</code> is <i>not</i> automatically incorporated in
//      * this runtime exception's detail message.
//      *
//      * @param  message the detail message (which is saved for later retrieval
//      *         by the {@link #getMessage()} method).
//      * @param  cause the cause (which is saved for later retrieval by the
//      *         {@link #getCause()} method).  (A <code>null</code> value is
//      *         permitted, and indicates that the cause is nonexistent or
//      *         unknown.)
//      */
//     public SecretShareException(final String message,
//                                 final Throwable cause)
//     {
//         super(message, cause);
//     }
// 
//     // ==================================================
//     // public methods
//     // ==================================================
// 
//     // ==================================================
//     // non public methods
//     // ==================================================
// }


// Path: src/test/java/com/tiemens/secretshare/math/type/BigIntStringChecksumTest.java
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import java.math.BigInteger;
import java.security.SecureRandom;
import java.util.Random;
import org.junit.Assert;
import org.junit.Test;
import com.tiemens.secretshare.exceptions.SecretShareException;

        // true = generates 'reallyBad'[odd] string     false = run tests
        boolean runAsGenerate = false;

        String[] reallyBad = new String[] {
                "AB##",     "461C44",
                "8f4...",   "1750A6",
                "$",        "7DE9C3",
                "00abcO",   "E5D568",          // that is abc-letter-O not abc-zero
        };

        for (int i = 0, n = reallyBad.length; i < n; i += 2)
        {
            if (runAsGenerate)
            {
                // This path generates the strings above
                String s = reallyBad[i];
                System.out.println("\"" + s + "\",    \"" +
                                   BigIntStringChecksum.computeMd5ChecksumLimit6(s) + "\",");
            }
            else
            {
                // This path checks the strings above

                BigIntStringChecksum bisc = new BigIntStringChecksum(reallyBad[i],
                                                                     reallyBad[i + 1]);
                try
                {
                    bisc.asBigInteger();   // should throw exception
                    Assert.fail("Really bad input '" + reallyBad[i] + "' failed to fail");
                }
                catch (SecretShareException e)