我在Circom cicuit编译器中有以下电路
pragma circom 2.0.0;
template MAIN() {
signal len;
len <== 32;
for (k = 0; k < maplen; k++) {
// do something
}
}
component main = MAIN();我收到一个错误:
error[T2005]: Typing error found
┌─ "/Users/ilia/compiling/main-circom/circuits/main.circom":118:17
│
118 │ for (k = 0; k < len; k++) {
│ ^^^^^^^ There are constraints depending on the value of the condition and it can be unknown during the constraint generation phase我如何编写这个循环,使迭代len时间成为可能,len是一个信号?
发布于 2022-02-23 23:33:14
您需要决定循环可以有多少个最大迭代(迭代预算),然后放弃所有不需要使用LessThan组件的迭代。您还可以使用QuinSelector选择迭代所需的结果。
https://stackoverflow.com/questions/70994314
复制相似问题