From 42f0e12429329e444be8f1389502fb251ead1550 Mon Sep 17 00:00:00 2001 From: "Casper V. Kristensen" Date: Tue, 5 Nov 2019 14:16:14 +0100 Subject: [PATCH] Java er garbage. --- pir/.gitignore | 136 ++++++++++++++++++ pir/pom.xml | 18 +++ .../protocols/interpoly/InterPolyClient.java | 10 ++ .../protocols/interpoly/InterPolyServer.java | 4 + .../java/dk/au/pir/settings/PIRSettings.java | 10 ++ 5 files changed, 178 insertions(+) create mode 100644 pir/.gitignore create mode 100644 pir/pom.xml create mode 100644 pir/src/main/java/dk/au/pir/protocols/interpoly/InterPolyClient.java create mode 100644 pir/src/main/java/dk/au/pir/protocols/interpoly/InterPolyServer.java create mode 100644 pir/src/main/java/dk/au/pir/settings/PIRSettings.java diff --git a/pir/.gitignore b/pir/.gitignore new file mode 100644 index 0000000..1324a0f --- /dev/null +++ b/pir/.gitignore @@ -0,0 +1,136 @@ + +# Created by https://www.gitignore.io/api/java,maven,code-java,intellij+all +# Edit at https://www.gitignore.io/?templates=java,maven,code-java,intellij+all + +### Code-Java ### +# Language Support for Java(TM) by Red Hat extension for Visual Studio Code - https://marketplace.visualstudio.com/items?itemName=redhat.java + +.project +.classpath +factoryConfiguration.json + +### Intellij+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### Intellij+all Patch ### +# Ignores the whole .idea folder and all .iml files +# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 + +.idea/ + +# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 + +*.iml +modules.xml +.idea/misc.xml +*.ipr + +# Sonarlint plugin +.idea/sonarlint + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +### Maven ### +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +.mvn/wrapper/maven-wrapper.jar +.flattened-pom.xml + +# End of https://www.gitignore.io/api/java,maven,code-java,intellij+all diff --git a/pir/pom.xml b/pir/pom.xml new file mode 100644 index 0000000..7a73e86 --- /dev/null +++ b/pir/pom.xml @@ -0,0 +1,18 @@ + + + 4.0.0 + + dk.au.pir + pir + 1.0-SNAPSHOT + + + + dk.alexandra.fresco + core + 1.2.1 + + + diff --git a/pir/src/main/java/dk/au/pir/protocols/interpoly/InterPolyClient.java b/pir/src/main/java/dk/au/pir/protocols/interpoly/InterPolyClient.java new file mode 100644 index 0000000..01b6459 --- /dev/null +++ b/pir/src/main/java/dk/au/pir/protocols/interpoly/InterPolyClient.java @@ -0,0 +1,10 @@ +package dk.au.pir.protocols.interpoly; + +import dk.au.pir.settings.PIRSettings; + +public class InterPolyClient { + public static void main(String[] args) { + System.out.println("Client!"); + System.out.println(PIRSettings.FIELD_DEFINITION.getBitLength()); + } +} diff --git a/pir/src/main/java/dk/au/pir/protocols/interpoly/InterPolyServer.java b/pir/src/main/java/dk/au/pir/protocols/interpoly/InterPolyServer.java new file mode 100644 index 0000000..cfa3018 --- /dev/null +++ b/pir/src/main/java/dk/au/pir/protocols/interpoly/InterPolyServer.java @@ -0,0 +1,4 @@ +package dk.au.pir.protocols.interpoly; + +public class InterPolyServer { +} diff --git a/pir/src/main/java/dk/au/pir/settings/PIRSettings.java b/pir/src/main/java/dk/au/pir/settings/PIRSettings.java new file mode 100644 index 0000000..ebd7738 --- /dev/null +++ b/pir/src/main/java/dk/au/pir/settings/PIRSettings.java @@ -0,0 +1,10 @@ +package dk.au.pir.settings; + +import dk.alexandra.fresco.framework.builder.numeric.field.BigIntegerFieldDefinition; +import dk.alexandra.fresco.framework.builder.numeric.field.FieldDefinition; +import dk.alexandra.fresco.framework.util.ModulusFinder; + +public class PIRSettings { + private static final int MOD_BIT_LENGTH = 16; + public static FieldDefinition FIELD_DEFINITION = new BigIntegerFieldDefinition(ModulusFinder.findSuitableModulus(MOD_BIT_LENGTH)); +}