Line data Source code
1 : #ifndef HEADER_fd_src_flamenco_runtime_program_fd_zk_elgamal_proof_program_h 2 : #define HEADER_fd_src_flamenco_runtime_program_fd_zk_elgamal_proof_program_h 3 : 4 : /* 5 : * ZK ElGamal Proof Program 6 : */ 7 : 8 : #include "../context/fd_exec_instr_ctx.h" 9 : #include "../context/fd_exec_txn_ctx.h" 10 : 11 : /* FD_ZKSDK_INSTR_{...} identify ZK ElGamal Proof Program instructions. 12 : https://github.com/anza-xyz/agave/blob/v2.0.1/zk-sdk/src/zk_elgamal_proof_program/instruction.rs#L48 */ 13 : 14 39 : #define FD_ZKSDK_INSTR_CLOSE_CONTEXT_STATE ((uchar) 0) 15 258 : #define FD_ZKSDK_INSTR_VERIFY_ZERO_CIPHERTEXT ((uchar) 1) 16 135 : #define FD_ZKSDK_INSTR_VERIFY_CIPHERTEXT_CIPHERTEXT_EQUALITY ((uchar) 2) 17 81 : #define FD_ZKSDK_INSTR_VERIFY_CIPHERTEXT_COMMITMENT_EQUALITY ((uchar) 3) 18 69 : #define FD_ZKSDK_INSTR_VERIFY_PUBKEY_VALIDITY ((uchar) 4) 19 96 : #define FD_ZKSDK_INSTR_VERIFY_PERCENTAGE_WITH_CAP ((uchar) 5) 20 102 : #define FD_ZKSDK_INSTR_VERIFY_BATCHED_RANGE_PROOF_U64 ((uchar) 6) 21 108 : #define FD_ZKSDK_INSTR_VERIFY_BATCHED_RANGE_PROOF_U128 ((uchar) 7) 22 93 : #define FD_ZKSDK_INSTR_VERIFY_BATCHED_RANGE_PROOF_U256 ((uchar) 8) 23 75 : #define FD_ZKSDK_INSTR_VERIFY_GROUPED_CIPHERTEXT_2_HANDLES_VALIDITY ((uchar) 9) 24 81 : #define FD_ZKSDK_INSTR_VERIFY_BATCHED_GROUPED_CIPHERTEXT_2_HANDLES_VALIDITY ((uchar)10) 25 63 : #define FD_ZKSDK_INSTR_VERIFY_GROUPED_CIPHERTEXT_3_HANDLES_VALIDITY ((uchar)11) 26 72 : #define FD_ZKSDK_INSTR_VERIFY_BATCHED_GROUPED_CIPHERTEXT_3_HANDLES_VALIDITY ((uchar)12) 27 : 28 : /* FD_ZKSDK_INSTR_{...}_COMPUTE_UNITS 29 : https://github.com/anza-xyz/agave/blob/v2.0.1/programs/zk-elgamal-proof/src/lib.rs#L16 */ 30 : 31 : #define FD_ZKSDK_INSTR_CLOSE_CONTEXT_STATE_COMPUTE_UNITS 3300UL 32 : #define FD_ZKSDK_INSTR_VERIFY_ZERO_CIPHERTEXT_COMPUTE_UNITS 6000UL 33 : #define FD_ZKSDK_INSTR_VERIFY_CIPHERTEXT_CIPHERTEXT_EQUALITY_COMPUTE_UNITS 8000UL 34 : #define FD_ZKSDK_INSTR_VERIFY_CIPHERTEXT_COMMITMENT_EQUALITY_COMPUTE_UNITS 6400UL 35 0 : #define FD_ZKSDK_INSTR_VERIFY_PUBKEY_VALIDITY_COMPUTE_UNITS 2600UL 36 : #define FD_ZKSDK_INSTR_VERIFY_PERCENTAGE_WITH_CAP_COMPUTE_UNITS 6500UL 37 : #define FD_ZKSDK_INSTR_VERIFY_BATCHED_RANGE_PROOF_U64_COMPUTE_UNITS 111000UL 38 : #define FD_ZKSDK_INSTR_VERIFY_BATCHED_RANGE_PROOF_U128_COMPUTE_UNITS 200000UL 39 : #define FD_ZKSDK_INSTR_VERIFY_BATCHED_RANGE_PROOF_U256_COMPUTE_UNITS 368000UL 40 : #define FD_ZKSDK_INSTR_VERIFY_GROUPED_CIPHERTEXT_2_HANDLES_VALIDITY_COMPUTE_UNITS 6400UL 41 : #define FD_ZKSDK_INSTR_VERIFY_BATCHED_GROUPED_CIPHERTEXT_2_HANDLES_VALIDITY_COMPUTE_UNITS 13000UL 42 : #define FD_ZKSDK_INSTR_VERIFY_GROUPED_CIPHERTEXT_3_HANDLES_VALIDITY_COMPUTE_UNITS 8100UL 43 : #define FD_ZKSDK_INSTR_VERIFY_BATCHED_GROUPED_CIPHERTEXT_3_HANDLES_VALIDITY_COMPUTE_UNITS 16400UL 44 : 45 : FD_PROTOTYPES_BEGIN 46 : 47 : int 48 : fd_executor_zk_elgamal_proof_program_execute( fd_exec_instr_ctx_t * ctx ); 49 : 50 : FD_PROTOTYPES_END 51 : 52 : #endif /* HEADER_fd_src_flamenco_runtime_program_fd_zk_elgamal_proof_program_h */