Skip to content

Commit

Permalink
docs: add hint definition for native inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
ivokub committed Mar 11, 2024
1 parent df7cc97 commit ebf9326
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions std/math/emulated/field_hint.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,18 @@ func (f *Field[T]) NewHintWithNativeOutput(hf solver.Hint, nbOutputs int, inputs
// non-native elements. There is [UnwrapHintWithNativeInput] function which
// performs corresponding recomposition of limbs into integer values (and vice
// verse for output).
//
// This method is an alternation of [NewHint] method, which allows to pass
// native inputs to the hint function and returns nonnative outputs. This is
// useful when the inputs do not necessarily have to be emulated elements (e.g.
// indices) and allows to work between different fields.
//
// The hint function for this method is defined as:
//
// func HintFn(nativeMod *big.Int, nativeInputs, nativeOutputs []*big.Int) error {
// return emulated.UnwrapHintWithNativeInput(nativeInputs, nativeOutputs, func(emulatedMod *big.Int, inputs, outputs []*big.Int) error {
// // in the function we have access to both native and nonantive modulus
// })}
func (f *Field[T]) NewHintWithNativeInput(hf solver.Hint, nbOutputs int, inputs ...frontend.Variable) ([]*Element[T], error) {
nativeInputs := f.wrapHintNatives(inputs...)
nbNativeOutputs := int(f.fParams.NbLimbs()) * nbOutputs
Expand Down

0 comments on commit ebf9326

Please sign in to comment.