leo/benchmark/simple.leo

20 lines
334 B
Plaintext
Raw Normal View History

2020-05-12 07:31:06 +03:00
// Basic Pedersen hash function
// 1 window x 3 bits
struct PedersenCRHParameters {
bases: fe[3]
2020-05-09 02:35:00 +03:00
}
2020-05-12 07:31:06 +03:00
function main(bits: private bool[3]) -> fe {
let params = PedersenCRHParameters { bases: [1fe, 1fe, 1fe] };
let res = 0fe;
for bit in 0..3 {
//if (bits[bit]) {
res += params.bases[bit];
//}
}
2020-05-09 02:35:00 +03:00
2020-05-12 07:31:06 +03:00
return res
}