Line data Source code
1 : #include "fd_block_marker.h" 2 : 3 : int 4 : fd_block_footer_cert_from_agg( fd_block_footer_cert_t * cert, 5 : ulong slot, 6 : uchar const * block_hash, 7 0 : fd_bls_agg_t const * agg ) { 8 0 : if( FD_UNLIKELY( fd_bls_set_is_null( agg->set ) ) ) return 0; /* nobody signed */ 9 : 10 0 : fd_memset( cert, 0, sizeof(fd_block_footer_cert_t) ); 11 0 : cert->slot = slot; 12 0 : cert->nbits = (ushort)( fd_bls_set_last( agg->set )+1UL ); 13 0 : if( block_hash ) memcpy( cert->block_id.uc, block_hash, sizeof(fd_hash_t) ); 14 0 : fd_bls_set_copy( cert->signer_set, agg->set ); 15 0 : fd_bls_sig_t a[1]; 16 0 : blst_p2_to_affine( a, &agg->sig ); 17 0 : blst_p2_affine_compress( cert->sig, a ); 18 0 : return 1; 19 0 : }