pepper-project / pequin

A system for verifying outsourced computations, and applying SNARKs. Simplified release of the main Pepper codebase.
Other
122 stars 46 forks source link

java.lang.RuntimeException: Unexpected "end-of-file" #12

Closed cnasikas closed 6 years ago

cnasikas commented 6 years ago

Hi

I follow the tutorial and I am trying to run:

./pepper_compile_and_setup_V.sh mm_pure_arith mm_pure_arith.vkey mm_pure_arith.pkey

and I get the following error:

+ compiling common objs

============================================
=== Compiling computation to constraints ===
============================================

+ compile apps/mm_pure_arith.c --metrics -b 0 -w 10240 -t ZAATAR -db-hash-func ggh -db-num-addresses 1024 -ram-cell-num-bits 32 -db-hash-num-bits 1216 -db-thr-num-addresses-naive 32768 -fast-ram-address-width 32 -fast-ram-word-width 64
metric_num_lines_in_sfdl mm_pure_arith 0
metric_num_lines_in_source mm_pure_arith 0
make[1]: Entering directory '/home/user/workspace/zkp/pequin/compiler/frontend'
ant compile
Buildfile: /home/user/workspace/zkp/pequin/compiler/frontend/build.xml

compile:

BUILD SUCCESSFUL
Total time: 0 seconds
make[1]: Leaving directory '/home/user/workspace/zkp/pequin/compiler/frontend'

WARNING: --cstdarithtruncate is disabled, so type errors will warn and arithmetic is not ANSI C compliant
Compiling mm_pure_arith.c
Exception in thread "main" java.lang.RuntimeException: Unexpected "end-of-file"
    at ccomp.parser.CParser$207.syntaxError(CParser.java:1750)
    at beaver.Parser.parse(Parser.java:394)
    at beaver.Parser.parse(Parser.java:352)
    at ccomp.parser_hw.CCompiler.compileProgram(CCompiler.java:163)
    at zcc.ZCC.compile(ZCC.java:230)
    at zcc.ZCC.main(ZCC.java:127)
Makefile:115: recipe for target 'bin/mm_pure_arith.params' failed
make: *** [bin/mm_pure_arith.params] Error 1

==========================================
===== Running setup (key generation) =====
==========================================

./pepper_compile_and_setup_V.sh: line 35: bin/pepper_verifier_mm_pure_arith: No such file or directory

Thanks in advance

maxhowald commented 6 years ago

Hmm, did you modify apps/mm_pure_arith.c? It looks like the compiler is failing to parse that file. I can reproduce your error if (for example), if I delete this line: https://github.com/pepper-project/pequin/blob/2b172e3615a5f1cf0c1977883d47dd4bc6b17d7e/pepper/apps/mm_pure_arith.c#L30

But it should compile if you use the checked-in version.

cnasikas commented 6 years ago

You are right my mistake. For some strange reason the file was empty. Probably I shouldn't tried after a lot of hours reading about zkSNARKs theory :).

Sorry for posting.