LCOV - code coverage report
Current view: top level - flamenco/runtime/program/zksdk/instructions - fd_zksdk_grouped_ciphertext_3_handles_validity.c (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 29 29 100.0 %
Date: 2024-11-13 11:58:15 Functions: 2 2 100.0 %

          Line data    Source code
       1             : #include "../fd_zksdk_private.h"
       2             : 
       3             : static inline void
       4             : grouped_ciphertext_validity_transcript_init(
       5             :   fd_zksdk_transcript_t *                    transcript,
       6          30 :   fd_zksdk_grp_ciph_3h_val_context_t const * context ) {
       7          30 :   fd_zksdk_transcript_init( transcript, FD_TRANSCRIPT_LITERAL("grouped-ciphertext-validity-3-handles-instruction") );
       8          30 :   fd_zksdk_transcript_append_pubkey ( transcript, FD_TRANSCRIPT_LITERAL("first-pubkey"),  context->pubkey1 );
       9          30 :   fd_zksdk_transcript_append_pubkey ( transcript, FD_TRANSCRIPT_LITERAL("second-pubkey"), context->pubkey2 );
      10          30 :   fd_zksdk_transcript_append_pubkey ( transcript, FD_TRANSCRIPT_LITERAL("third-pubkey"),  context->pubkey3 );
      11          30 :   fd_zksdk_transcript_append_message( transcript, FD_TRANSCRIPT_LITERAL("grouped-ciphertext"), (uchar *)&context->grouped_ciphertext, sizeof(grp_ciph_3h_t) );
      12          30 : }
      13             : 
      14             : int
      15          30 : fd_zksdk_instr_verify_proof_grouped_ciphertext_3_handles_validity( void const * _context, void const * _proof ) {
      16          30 :   fd_zksdk_transcript_t transcript[1];
      17          30 :   fd_zksdk_grp_ciph_3h_val_context_t const * context = _context;
      18          30 :   fd_zksdk_grp_ciph_3h_val_proof_t const *   proof   = _proof;
      19             : 
      20          30 :   grouped_ciphertext_validity_transcript_init( transcript, context );
      21             : 
      22          30 :   return fd_zksdk_verify_proof_batched_grouped_ciphertext_3_handles_validity(
      23          30 :     proof,
      24          30 :     context->pubkey1,
      25          30 :     context->pubkey2,
      26          30 :     context->pubkey3,
      27          30 :     context->grouped_ciphertext.commitment,
      28          30 :     context->grouped_ciphertext.handles[0].handle,
      29          30 :     context->grouped_ciphertext.handles[1].handle,
      30          30 :     context->grouped_ciphertext.handles[2].handle,
      31          30 :     NULL,
      32          30 :     NULL,
      33          30 :     NULL,
      34          30 :     NULL,
      35          30 :     false,
      36          30 :     transcript
      37          30 :   );
      38          30 : }

Generated by: LCOV version 1.14