lopy4/components/hash-sigs-master/hss_compute.c
/*
 * Combine adjacent left and right nodes within the Merkle tree
 * together 
 */
Combine adjacent left and right nodes within the Merkle tree
together
Combine adjacent left and right nodes within the Merkle tree together
void hss_combine_internal_nodes( unsigned char *dest,
        const unsigned char *left_node, const unsigned char *right_node,
        int h, const unsigned char *I, unsigned hash_size,
        merkle_index_t node_num) {
    unsigned char hash_val[ INTR_MAX_LEN ];
    memcpy( hash_val + INTR_I, I, I_LEN );
    put_bigendian( hash_val + INTR_R, node_num, 4 );
    SET_D( hash_val + INTR_D, D_INTR );
    memcpy( hash_val + INTR_PK,             left_node,  hash_size );
    memcpy( hash_val + INTR_PK + hash_size, right_node, hash_size );
    union hash_context ctx;
    hss_hash_ctx( dest, h, &ctx, hash_val, INTR_LEN(hash_size) );
}
void hss_combine_internal_nodes ( unsigned char * dest , const unsigned char * left_node , const unsigned char * right_node , int h , const unsigned char * I , unsigned hash_size , merkle_index_t node_num ) { unsigned char hash_val [ INTR_MAX_LEN ] ; memcpy ( hash_val + INTR_I , I , I_LEN ) ; put_bigendian ( hash_val + INTR_R , node_num , 4 ) ; SET_D ( hash_val + INTR_D , D_INTR ) ; memcpy ( hash_val + INTR_PK , left_node , hash_size ) ; memcpy ( hash_val + INTR_PK + hash_size , right_node , hash_size ) ; union hash_context ctx ; hss_hash_ctx ( dest , h , & ctx , hash_val , INTR_LEN ( hash_size ) ) ; }
Combine adjacent left and right nodes within the Merkle tree
 together
Combine adjacent left and right nodes within the Merkle tree together