pub fn process_instruction_groth16_verifier(&mut self) -> Result<(), ProgramError> {
        if self.current_instruction_index < PREPARE_INPUTS_END_INDEX {
            self.prepare_inputs()?;
            Ok(())
        } else if self.current_instruction_index >= MILLER_LOOP_START_INDEX
            && self.current_instruction_index < MILLER_LOOP_END_INDEX
        {
            self.miller_loop()?;
            Ok(())
        } else if self.current_instruction_index >= FINAL_EXPONENTIATION_START_INDEX
            && self.current_instruction_index < FINAL_EXPONENTIATION_END_INDEX
        {
            self.final_exponentiation()?;
            Ok(())
        } else {
            msg!("should not enter here");
            Err(ProgramError::InvalidArgument)
        }
    }
// The groth16 verifier verifies proofs for the Groth16 zkSNARK construction that's used by Light Protocol.
// This implements the ark-groth16 verifier in a way that can be executed by the Solana runtime.
// As such, it's mostly broken up into many smaller computation pieces that each fit into a single instruction's compute budget.
// The current implemenation relies on a 200k compute budget ix-wide. With that, the Groth16 processor currently processes
// 1k+ ix calls for a single proof verification. The call order is hardcoded on-chain as [IX_ORDER].
// There are some caveats that come with maintaining state across all those instructions, hence the increased code complexity.
The groth16 verifier verifies proofs for the Groth16 zkSNARK construction that's used by Light Protocol.
This implements the ark-groth16 verifier in a way that can be executed by the Solana runtime.
As such, it's mostly broken up into many smaller computation pieces that each fit into a single instruction's compute budget.
The current implemenation relies on a 200k compute budget ix-wide. With that, the Groth16 processor currently processes
1k+ ix calls for a single proof verification. The call order is hardcoded on-chain as [IX_ORDER].
There are some caveats that come with maintaining state across all those instructions, hence the increased code complexity.
The groth16 verifier verifies proofs for the Groth16 zkSNARK construction that ' s used by Light Protocol . This implements the ark - groth16 verifier in a way that can be executed by the Solana runtime . As such it ' s mostly broken up into many smaller computation pieces that each fit into a single instruction ' s compute budget . The current implemenation relies on a 200k compute budget ix - wide . With that the Groth16 processor currently processes 1k + ix calls for a single proof verification . The call order is hardcoded on - chain as [ IX_ORDER ] . There are some caveats that come with maintaining state across all those instructions hence the increased code complexity .
pub fn process_instruction_groth16_verifier(&mut self) -> Result<(), ProgramError> {
        if self.current_instruction_index < PREPARE_INPUTS_END_INDEX {
            self.prepare_inputs()?;
            Ok(())
        } else if self.current_instruction_index >= MILLER_LOOP_START_INDEX
            && self.current_instruction_index < MILLER_LOOP_END_INDEX
        {
            self.miller_loop()?;
            Ok(())
        } else if self.current_instruction_index >= FINAL_EXPONENTIATION_START_INDEX
            && self.current_instruction_index < FINAL_EXPONENTIATION_END_INDEX
        {
            self.final_exponentiation()?;
            Ok(())
        } else {
            msg!("should not enter here");
            Err(ProgramError::InvalidArgument)
        }
    }
pub fn process_instruction_groth16_verifier ( & mut self ) -> Result < ( ) , ProgramError > { if self . current_instruction_index < PREPARE_INPUTS_END_INDEX { self . prepare_inputs ( ) ? ; Ok ( ( ) ) } else if self . current_instruction_index >= MILLER_LOOP_START_INDEX && self . current_instruction_index < MILLER_LOOP_END_INDEX { self . miller_loop ( ) ? ; Ok ( ( ) ) } else if self . current_instruction_index >= FINAL_EXPONENTIATION_START_INDEX && self . current_instruction_index < FINAL_EXPONENTIATION_END_INDEX { self . final_exponentiation ( ) ? ; Ok ( ( ) ) } else { msg ! ( " " ) ; Err ( ProgramError :: InvalidArgument ) } }
The groth16 verifier verifies proofs for the Groth16 zkSNARK construction that's used by Light Protocol.
The groth16 verifier verifies proofs for the Groth16 zkSNARK construction that ' s used by Light Protocol .
&mut self