Javascript 电路编译错误:无法将NQ类型转换为QEX
我目前正在使用零知识证明,因此我使用Node.js及其circom和snarkjs包 我正在尝试使用以下电路运行Javascript 电路编译错误:无法将NQ类型转换为QEX,javascript,node.js,cryptography,Javascript,Node.js,Cryptography,我目前正在使用零知识证明,因此我使用Node.js及其circom和snarkjs包 我正在尝试使用以下电路运行circom circuit.circom--r1cs--wasm--sym: template Accum() { signal private input a; signal private input b; signal input n; signal output c; c <== (a**b) % n; } component
circom circuit.circom--r1cs--wasm--sym
:
template Accum() {
signal private input a;
signal private input b;
signal input n;
signal output c;
c <== (a**b) % n;
}
component main = Accum();
我的理解是,这个错误与我使用的求幂和模有关,但我无法纠正它
提前感谢。您必须作为单独的模板或函数来实现。该页面还为您提供了可以实现的伪代码。您必须作为单独的模板或函数实现。该页面还提供了一个可以实现的伪代码。
Error: Type NQ can not be converted to QEX
at LCAlgebra.toQEX (/usr/local/lib/node_modules/circom/src/lcalgebra.js:433:19)
at execConstrain (/usr/local/lib/node_modules/circom/src/construction_phase.js:931:37)
at execSignalAssignConstrain (/usr/local/lib/node_modules/circom/src/construction_phase.js:943:5)
at exec (/usr/local/lib/node_modules/circom/src/construction_phase.js:110:20)
at execBlock (/usr/local/lib/node_modules/circom/src/construction_phase.js:534:9)
at instantiateComponent (/usr/local/lib/node_modules/circom/src/construction_phase.js:521:9)
at execInstantiateComponet (/usr/local/lib/node_modules/circom/src/construction_phase.js:463:9)
at execAssignement (/usr/local/lib/node_modules/circom/src/construction_phase.js:364:31)
at exec (/usr/local/lib/node_modules/circom/src/construction_phase.js:106:20)
at execBlock (/usr/local/lib/node_modules/circom/src/construction_phase.js:534:9)
Type NQ can not be converted to QEX