zkmove / halo2-verifier.move

A set of tooling of halo2 circuits verification in Move environments
Apache License 2.0
16 stars 3 forks source link

support bn254_arithmetic::from_uniform_bytes(repr: vector<u8>): Element<Fr> #29

Closed luxebeng closed 11 months ago

luxebeng commented 11 months ago

bn254_arithmetic::from_repr is wrapped with crypto_algebra::deserialize. and which need support 64 byte vector.

    public fun from_repr(repr: vector<u8>): Element<Fr> {
        let e = std::option::extract(&mut crypto_algebra::deserialize<Fr, FormatFrLsb>(&repr));
        e
    }
guangyuz commented 11 months ago

Fr::from_uniform_bytes() should be supported.

nanne007 commented 11 months ago

There's some bug in the current implementation. should look into it.

nanne007 commented 11 months ago

solved by,

let lo = lo % MODULUS; 
let hi = hi % MODULUS;