MCPcopy Create free account
hub / github.com/PolyhedraZK/ExpanderCompilerCollection / new_hint

Method new_hint

expander_compiler/src/frontend/debug.rs:152–171  ·  view source on GitHub ↗
(
        &mut self,
        hint_key: &str,
        inputs: &[Variable],
        num_outputs: usize,
    )

Source from the content-addressed store, hash-verified

150 self.return_as_variable(v)
151 }
152 fn new_hint(
153 &mut self,
154 hint_key: &str,
155 inputs: &[Variable],
156 num_outputs: usize,
157 ) -> Vec<Variable> {
158 ensure_variables_valid(inputs);
159 let inputs: Vec<CircuitField<C>> =
160 inputs.iter().map(|v| self.convert_to_value(v)).collect();
161 match self
162 .hint_caller
163 .call(hint_key_to_id(hint_key), &inputs, num_outputs)
164 {
165 Ok(outputs) => outputs
166 .into_iter()
167 .map(|v| self.return_as_variable(v))
168 .collect(),
169 Err(e) => panic!("Hint error: {e:?}"),
170 }
171 }
172 fn constant(&mut self, x: impl ToVariableOrValue<CircuitField<C>>) -> Variable {
173 let x = self.convert_to_value(x);
174 self.return_as_variable(x)

Callers 3

loadMethod · 0.45
to_binaryFunction · 0.45
to_binaryFunction · 0.45

Calls 7

ensure_variables_validFunction · 0.85
hint_key_to_idFunction · 0.85
iterMethod · 0.80
convert_to_valueMethod · 0.80
callMethod · 0.80
return_as_variableMethod · 0.80
mapMethod · 0.45

Tested by 2

to_binaryFunction · 0.36
to_binaryFunction · 0.36