NilFoundation / zkLLVM

Zero-Knowledge Proof Systems Circuit Compiler
https://docs.nil.foundation/zkllvm
274 stars 46 forks source link

[Possible bug] constexpr requires integer operands error in small example #537

Closed ETatuzova closed 4 months ago

ETatuzova commented 5 months ago

Compilation error in example

#include <nil/crypto3/algebra/curves/pallas.hpp>

using namespace nil::crypto3::algebra::curves;

[[circuit]] typename pallas::base_field_type::value_type
    field_arithmetic_example(typename pallas::base_field_type::value_type a,
                             typename pallas::base_field_type::value_type b) {

    pallas::base_field_type::value_type factor1(11);
    pallas::base_field_type::value_type factor2(5);

    factor1 = factor1 * factor2;
    __builtin_assigner_exit_check(factor1 * factor2 == a*b);
    return a;
}

Error

: error: constexpr requires integer operands
  %4 = icmp eq __zkllvm_field_pallas_base mul (__zkllvm_field_pallas_base f0xB, __zkllvm_field_pallas_base f0x5), %3
                                          ^
makxenov commented 5 months ago

Probably duplicates #529