
eu.clarussecure.dataoperations.homomorphic.testing.HomomorphicCloud Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dataoperations.homomorphic Show documentation
Show all versions of dataoperations.homomorphic Show documentation
CLARUS Homomorphoc encryption module
The newest version!
package eu.clarussecure.dataoperations.homomorphic.testing;
import eu.clarussecure.dataoperations.Criteria;
import eu.clarussecure.dataoperations.homomorphic.HomomorphicRemoteOperationCommand;
import eu.clarussecure.dataoperations.homomorphic.operators.Select;
import eu.clarussecure.encryption.paillier.EncryptedInteger;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Base64;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;
public class HomomorphicCloud {
// Dommy implementation for a cloud
// The implementation is a table, saving columns and rows.
private final List data;
private final String[] columns; // attributes
public HomomorphicCloud(String[] columns) {
this.columns = columns;
this.data = new ArrayList<>();
}
public void addRow(String[] row) {
// It is assumed that the given arrays contains the columns in order!
this.data.add(row);
}
public void addRows(String[][] rows) {
// Each array will be added to the data
this.data.addAll(Arrays.asList(rows));
}
public String[][] getRows(String[] protectedAttribNames, Criteria[] criteria) {
// Select the columns regarding the required attribute names
List results = new ArrayList<>();
// First, parse the selection criteria and prepare the Select instances
Map> selectorsSet = new HashMap<>();
// Initialize the selection criteria
if (criteria == null) {
// There is no criteria, use the Identity Function
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy