NilFoundation / zkllvm-rslang

Other
15 stars 2 forks source link

Public and private inputs to circuit function #76

Open aleasims opened 9 months ago

aleasims commented 9 months ago

We need to somehow specify publicity of arguments of circuit function: which arguments are public and which are private.

In C++ we now can do it by applying attributes to function arguments:

[[circuit]] void example(
    int a,                     // this is public input
    [[private_input]] int b,   // this is private input
);

Possible syntax of that in Rust is quite similar (using attributes on function parameters):

#[circuit]
fn example(
    a: u32,              // this is public input
    #[private] b: u32,   // this is private input
) {}