// Path: src/main/java/at/archistar/crypto/secretsharing/WeakSecurityException.java
// public class WeakSecurityException extends Exception {
// 
//     /**
//      * create a new exception that denotes that an algorithm was configured
//      * in such a way, that it would yield no security or privacy
//      *
//      * @param msg an detailed error message
//      */
//     public WeakSecurityException(String msg) {
//         super(msg);
//     }
// }


import at.archistar.crypto.data.InformationCheckingShare;
import at.archistar.crypto.mac.MacHelper;
import at.archistar.crypto.random.RandomSource;
import at.archistar.crypto.secretsharing.WeakSecurityException;
import java.util.*;
import java.util.stream.Collectors;
package at.archistar.crypto.informationchecking;



/**
 * <p>This class implements the <i>Unconditionally-Secure Robust Secret Sharing with Compact Shares</i>-scheme developed by:
 * Alfonso Cevallos, Serge Fehr, Rafail Ostrovsky, and Yuval Rabani.</p>
 *
 * <p>This system basically equals the RabinBenOrRSS, but has shorter tags and therefore requires a different,
 * more secure reconstruction phase.</p>
 *
 * <p>For detailed information about this system, see:
 * <a href="http://www.iacr.org/cryptodb/data/paper.php?pubkey=24281">http://www.iacr.org/cryptodb/data/paper.php?pubkey=24281</a></p>
 */
public class CevallosUSRSS extends RabinBenOrRSS {

    /**
     * security constant for computing the tag length; means 128 bit
     */
    public static final int E = 128;

    private final MacHelper mac;

    private final int n;

    /**
     * Constructor.
     */
// Path: src/main/java/at/archistar/crypto/secretsharing/WeakSecurityException.java
// public class WeakSecurityException extends Exception {
// 
//     /**
//      * create a new exception that denotes that an algorithm was configured
//      * in such a way, that it would yield no security or privacy
//      *
//      * @param msg an detailed error message
//      */
//     public WeakSecurityException(String msg) {
//         super(msg);
//     }
// }


// Path: src/main/java/at/archistar/crypto/informationchecking/CevallosUSRSS.java
import at.archistar.crypto.data.InformationCheckingShare;
import at.archistar.crypto.mac.MacHelper;
import at.archistar.crypto.random.RandomSource;
import at.archistar.crypto.secretsharing.WeakSecurityException;
import java.util.*;
import java.util.stream.Collectors;

package at.archistar.crypto.informationchecking;



/**
 * <p>This class implements the <i>Unconditionally-Secure Robust Secret Sharing with Compact Shares</i>-scheme developed by:
 * Alfonso Cevallos, Serge Fehr, Rafail Ostrovsky, and Yuval Rabani.</p>
 *
 * <p>This system basically equals the RabinBenOrRSS, but has shorter tags and therefore requires a different,
 * more secure reconstruction phase.</p>
 *
 * <p>For detailed information about this system, see:
 * <a href="http://www.iacr.org/cryptodb/data/paper.php?pubkey=24281">http://www.iacr.org/cryptodb/data/paper.php?pubkey=24281</a></p>
 */
public class CevallosUSRSS extends RabinBenOrRSS {

    /**
     * security constant for computing the tag length; means 128 bit
     */
    public static final int E = 128;

    private final MacHelper mac;

    private final int n;

    /**
     * Constructor.
     */
    public CevallosUSRSS(int n, int k, MacHelper mac, RandomSource rng) throws WeakSecurityException {