LCOV - code coverage report
Current view: top level - flamenco/runtime/program/zksdk/instructions - fd_zksdk_grouped_ciphertext_2_handles_validity.c (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 25 25 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          36 :   fd_zksdk_grp_ciph_2h_val_context_t const * context ) {
       7          36 :   fd_zksdk_transcript_init( transcript, FD_TRANSCRIPT_LITERAL("grouped-ciphertext-validity-2-handles-instruction") );
       8          36 :   fd_zksdk_transcript_append_pubkey ( transcript, FD_TRANSCRIPT_LITERAL("first-pubkey"),  context->pubkey1 );
       9          36 :   fd_zksdk_transcript_append_pubkey ( transcript, FD_TRANSCRIPT_LITERAL("second-pubkey"), context->pubkey2 );
      10          36 :   fd_zksdk_transcript_append_message( transcript, FD_TRANSCRIPT_LITERAL("grouped-ciphertext"), (uchar *)&context->grouped_ciphertext, sizeof(grp_ciph_2h_t) );
      11          36 : }
      12             : 
      13             : int
      14          36 : fd_zksdk_instr_verify_proof_grouped_ciphertext_2_handles_validity( void const * _context, void const * _proof ) {
      15          36 :   fd_zksdk_transcript_t transcript[1];
      16          36 :   fd_zksdk_grp_ciph_2h_val_context_t const * context = _context;
      17          36 :   fd_zksdk_grp_ciph_2h_val_proof_t const *   proof   = _proof;
      18             : 
      19          36 :   grouped_ciphertext_validity_transcript_init( transcript, context );
      20             : 
      21          36 :   return fd_zksdk_verify_proof_batched_grouped_ciphertext_2_handles_validity(
      22          36 :     proof,
      23          36 :     context->pubkey1,
      24          36 :     context->pubkey2,
      25          36 :     context->grouped_ciphertext.commitment,
      26          36 :     context->grouped_ciphertext.handles[0].handle,
      27          36 :     context->grouped_ciphertext.handles[1].handle,
      28          36 :     NULL,
      29          36 :     NULL,
      30          36 :     NULL,
      31          36 :     false,
      32          36 :     transcript
      33          36 :   );
      34          36 : }

Generated by: LCOV version 1.14