Zokrates / ZoKrates

A toolbox for zkSNARKs on Ethereum
https://zokrates.github.io
GNU Lesser General Public License v3.0
1.81k stars 361 forks source link

mimc7 hash algorithm bug #1316

Closed hotaru57 closed 1 year ago

hotaru57 commented 1 year ago

Description

When i use mimc7 hash algorithm mimc7::<91> , i get an incorrect output

There is a constant field[] C in file mimc7.zok, the value should be 13602139229813231349386885113156901793661719180900395818909719758150455500533 when index is 91

Environment

Steps to Reproduce

def main(field x, field k) -> field {
    h = mimc7::<91>(x, k);
    return h;
}
dark64 commented 1 year ago

Hi @hotaru57, nice catch!

Fixed in https://github.com/Zokrates/ZoKrates/pull/1317