fix pedersen hash example

This commit is contained in:
collin 2021-03-11 14:51:54 -08:00
parent deb3847b8e
commit 8cbce25b5f
2 changed files with 3 additions and 13 deletions

View File

@ -1,12 +1,4 @@
// syntax 1
[main]
const parameters: [group; 256] = [1; 256];
// syntax 2
[const]
parameters: [group; 256] = [1; 256];
[registers]
r0: group = (1, 0)group;

View File

@ -17,13 +17,11 @@ circuit PedersenHash {
}
}
// syntax 1: const main function input
function main(const parameters: [group; 256]) -> group {
// The 'pedersen-hash' main function.
function main() -> group {
let parameters = [1group; 256];
let pedersen = PedersenHash::new(parameters);
let hash_input: [bool; 256] = [true; 256];
return pedersen.hash(hash_input)
}
// syntax 2: main file global constant
@parameter
const parameters: [group; 256];