Giter Club home page Giter Club logo

dizk's People

Contributors

bh2smith avatar dependabot[bot] avatar howardwu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dizk's Issues

Verifier Fails in problem size 16, 17 and 18

Based on the Profiler script

for TOTAL_CORES in 8; do
for SIZE in `seq 15 25`; do
export APP=dizk-large

with APP=zksnark-large

and size range limited to 15..19 we get the following output file

Verifier-for--4exec-2cpu-10mem-16partitions.csv

Size (inputs),Verifier (sec),isValid
32768,0.957887561,1
65536,1.446744197,0
131072,0.977929921,0
262144,1.144847189,0
524288,0.917492237,1

Error in unit tests

All of the following 4 errors on unit tests are nullPointerExceptions coming from what appear to be an issue with algebra.curves.barreto_naehrig.BNG1.one and algebra.curves.barreto_naehrig.BNG1.zero.

I am not overly familiar with Java development, but wonder if this could be a result of my java --version (which is 11). Otherwise, I am stumped on how to continue here.

Results of mvn test:

Tests in error:
DistributedBN254bProofSystemTest(zk_proof_systems.zkSNARK.DistributedzkSNARKTest)
SerialBN254bProofSystemTest(zk_proof_systems.zkSNARK.SerialzkSNARKTest)
BN254bTest(algebra.curves.CurvesTest)
BN254bTest(algebra.curves.BilinearityTest)

Tests run: 71, Failures: 0, Errors: 4, Skipped: 0

BN254bTest(algebra.curves.BilinearityTest) Time elapsed: 0 sec <<< ERROR!
java.lang.NullPointerException
at algebra.curves.barreto_naehrig.BNG1.zero(BNG1.java:113)
at algebra.curves.barreto_naehrig.BNG1.zero(BNG1.java:17)
at algebra.groups.AbstractGroup.mul(AbstractGroup.java:35)
at algebra.groups.AbstractGroup.mul(AbstractGroup.java:54)
etc...

BN254bTest(algebra.curves.CurvesTest) Time elapsed: 0 sec <<< ERROR!
java.lang.NullPointerException
at algebra.curves.barreto_naehrig.BNG1.zero(BNG1.java:113)
at algebra.curves.barreto_naehrig.BNG1.zero(BNG1.java:17)
at algebra.curves.CurvesTest.GroupTest(CurvesTest.java:33)
at algebra.curves.CurvesTest.BN254bTest(CurvesTest.java:93)
etc...

SerialBN254bProofSystemTest(zk_proof_systems.zkSNARK.SerialzkSNARKTest) Time elapsed: 0.077 sec <<< ERROR!
java.lang.NullPointerException
at algebra.curves.barreto_naehrig.BNG1.one(BNG1.java:117)
at algebra.curves.barreto_naehrig.BNG1.random(BNG1.java:121)
at algebra.curves.barreto_naehrig.BNG1.random(BNG1.java:17)
at zk_proof_systems.zkSNARK.SerialSetup.generate(SerialSetup.java:89)
at zk_proof_systems.zkSNARK.SerialzkSNARKTest.SerialBNProofSystemTest(SerialzkSNARKTest.java:82)
at zk_proof_systems.zkSNARK.SerialzkSNARKTest.SerialBN254bProofSystemTest(SerialzkSNARKTest.java:142)
etc...

DistributedBN254bProofSystemTest(zk_proof_systems.zkSNARK.DistributedzkSNARKTest) Time elapsed: 3.362 sec <<< ERROR!
java.lang.NullPointerException
at algebra.curves.barreto_naehrig.BNG1.one(BNG1.java:117)
at algebra.curves.barreto_naehrig.BNG1.random(BNG1.java:121)
at algebra.curves.barreto_naehrig.BNG1.random(BNG1.java:17)
at zk_proof_systems.zkSNARK.DistributedSetup.generate(DistributedSetup.java:82)
at zk_proof_systems.zkSNARK.DistributedzkSNARKTest.DistributedBNProofSystemTest(DistributedzkSNARKTest.java:103)
at zk_proof_systems.zkSNARK.DistributedzkSNARKTest.DistributedBN254bProofSystemTest(DistributedzkSNARKTest.java:163)
etc...

Applications (photo proof and ML model)

Are the following applications mentioned in README.md and paper contained in the library? I didn't find it anywhere...

  • Authenticity of photos on three transformations (crop, rotation, blur); see [NT16]
  • Integrity of machine learning models with support for linear regression and covariance matrices; see [Bis06] [Can69] [LRF97]

If they are contained, could you refer me to those circuits and the commands for running them? If not, will those be open-sourced?

In fact, I found some keywords of the ML models like Covariance and Regression under the profiling folder which seems like the ML application. However, the operations about photo proof are not found at all. Another question is that is the circuit portable to libsnark?

Test Error

I followed the four steps and find errors when running mvn test
The I use mvn text -x for printing out logs, the error log is below:

Tests run: 71, Failures: 0, Errors: 10, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  44.968 s
[INFO] Finished at: 2020-02-21T21:40:08+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project dizk: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/silverpoker/github/dizk/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project dizk: There are test failures.

Please refer to /home/silverpoker/github/dizk/target/surefire-reports for the individual test results.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.

Please refer to /home/silverpoker/github/dizk/target/surefire-reports for the individual test results.
    at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution (SurefireHelper.java:83)
    at org.apache.maven.plugin.surefire.SurefirePlugin.writeSummary (SurefirePlugin.java:176)
    at org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary (SurefirePlugin.java:150)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked (AbstractSurefireMojo.java:650)
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute (AbstractSurefireMojo.java:586)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

[Bug] Problems with Window Table

I think there is a bug in the Window Table calculation in the SerialSetup.java.
Around line 90, there is this block of code that initializes the window table.

        config.beginLog("Generating G1 MSM Window Table");
        final G1T generatorG1 = g1Factory.random(config.seed(), config.secureSeed());
        final int scalarCountG1 = nonZeroAt + nonZeroBt + numVariables;
        final int scalarSizeG1 = generatorG1.bitSize();
        final int windowSizeG1 = FixedBaseMSM.getWindowSize(scalarCountG1, generatorG1);
        final List<List<G1T>> windowTableG1 = FixedBaseMSM
                .getWindowTable(generatorG1, scalarSizeG1, windowSizeG1);
        config.endLog("Generating G1 MSM Window Table");

The scalarSizeG1 is set to the size of the generator, and this returns the minimum number of bits that can represent generatorG1. If I pick this to be g1Factory.one() (a valid generator), the scalarSizeG1 would be 2 and the window table would be too small. I did some basic tests for batchMSM with such a table (with scalars between 1 and 10) and it could not accurately compute the multiples of generatorG1, because it did not inspect all the bits of the scalars.

I think this should not really depend on the generator but be an attribute of the type used. Otherwise, even when uniformly sampling the generator, we should get a wrong number of bits with reasonable probability.

I did a quick fix for my particular use case (non-generic) like this. A better fix should be capable of taking the type into account:

scalarSizeG1 = (int) BN254aFields.BN254aFr.FrParameters.numBits();

Rust question

How much code here duplicates code in other sipr-labs repositories? I suppose the base differs and then everything else above must change as a result?

I'm asking because one rust clone of Spark is being developed https://github.com/rajasekarv/native_spark although I suspect they should figure out async ala rajasekarv/vega#71 before one uses it for much.

LinearCombination.java evaluate method

Hi all,

I think there is a problem with the evaluate() method in relations.objects.LinearCombination.
This line seems fishy if the condition is true:

final FieldT value = index == 0 ? one : input.get((int) index).mul(terms.get(i).value());

If index == 0, we want to add the constant value of the linear combination, which should be
terms.get(i).value(), not one.

Feature request: read R1CS as serialized by libsnark

DIZK is an awesome concept, and I'd really want to try this out for some of the larger constraint systems I work on - some of these are in libsnark.

It would be awesome if we could read in R1CS constraint systems as they are serialized in libsnark, so DIZK could be used with a lot of the existing circuits out there.

Profiler should throw error for non-existent method call

Missing else condition in the distributed and serial profiling apps that throws, or at least logs, an error when appName is not listed.

public static String appName(final String s) {
if (s.equals("fft")) {
return "SparkFFT";
} else if (s.equals("fmsm-g1")) {
return "SparkFixedMSMG1";
} else if (s.equals("fmsm-g2")) {
return "SparkFixedMSMG2";
} else if (s.equals("vmsm-g1")) {
return "SparkVariableMSMG1";
} else if (s.equals("vmsm-g2")) {
return "SparkVariableMSMG2";
} else if (s.equals("relation")) {
return "SparkQAPRelation";
} else if (s.equals("witness")) {
return "SparkQAPWitness";
} else if (s.equals("zksnark")) {
return "SparkZKSNARK";
} else if (s.equals("zksnark-large")) {
return "SparkZKSNARKLarge";
} else if (s.equals("vmsm-sorted-g1")) {
return "SparkVMSMSortedG1";
}
return "default";
}

An error occurs when running mvn test in docker

Follow the steps of building, when executing mvn test
java.lang.NullPointerException
at algebra.curves.barreto_naehrig.BNG1.one(BNG1.java:117)
at algebra.curves.barreto_naehrig.BNG1.random(BNG1.java:121)
at algebra.curves.barreto_naehrig.BNG1.random(BNG1.java:17)
at zk_proof_systems.zkSNARK.DistributedSetup.generate(DistributedSetup.java:82)
There are 4 locations where this error occurs.
Tests in error:
DistributedBN254bProofSystemTest(zk_proof_systems.zkSNARK.DistributedzkSNARKTest)
SerialBN254bProofSystemTest(zk_proof_systems.zkSNARK.SerialzkSNARKTest)
BN254bTest(algebra.curves.BilinearityTest)
BN254bTest(algebra.curves.CurvesTest)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.