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

string.h & stdlib.h support #15

Open cnasikas opened 6 years ago

cnasikas commented 6 years ago

Hi

Is it possible to use <stdlib.h> and <string.h> build-in libraries ? I am trying to use atol and strlen but the compiler says fatal error: string.h: No such file or directory or fatal error: stdlib.h: No such file or directory

Is there a way to include those libraries or any alternative to use the specific functions ?

Thanks in advanced

maxhowald commented 6 years ago

Unfortunately, it's not possible to directly use implementations of stdlib functions from gcc or other normal compilers. You'll have to implement them yourself, subject to all the usual restrictions of pepper's compiler (C89, upper-bounded loops, etc.).

The system include path for pepper defaults to pepper/compiler/cstdinc. There are some examples there of re-implementations of various headers that you can use (although, mostly, they only contain a few of the functions from the real library). You could add functions for atol and strlen there.

cnasikas commented 6 years ago

I see! Thanks a lot! The information you provided is very useful.