lopy4/components/hash-sigs-master/hss_common.c
/*
 * Get the length of a signature, given this particular parameter set
 */
Get the length of a signature, given this particular parameter set
Get the length of a signature given this particular parameter set
size_t hss_get_signature_len(unsigned levels,
                   const param_set_t *lm_type,
                   const param_set_t *lm_ots_type) {
    if (levels < MIN_HSS_LEVELS || levels > MAX_HSS_LEVELS) return 0;
    unsigned i;
    size_t tot_len = 4;
    for (i=0; i<levels; i++) {
        size_t next_sig_len = lm_get_signature_len(lm_type[i], lm_ots_type[i]);
        if (next_sig_len == 0) return 0;
        tot_len += next_sig_len;
        if (i > 0) {
            size_t next_pub_len = lm_get_public_key_len(lm_type[i]);
            if (next_pub_len == 0) return 0;
            tot_len += next_pub_len;
        }
    }
    return tot_len;
}
size_t hss_get_signature_len ( unsigned levels , const param_set_t * lm_type , const param_set_t * lm_ots_type ) { if ( levels < MIN_HSS_LEVELS || levels > MAX_HSS_LEVELS ) return 0 ; unsigned i ; size_t tot_len = 4 ; for ( i = 0 ; i < levels ; i ++ ) { size_t next_sig_len = lm_get_signature_len ( lm_type [ i ] , lm_ots_type [ i ] ) ; if ( next_sig_len == 0 ) return 0 ; tot_len += next_sig_len ; if ( i > 0 ) { size_t next_pub_len = lm_get_public_key_len ( lm_type [ i ] ) ; if ( next_pub_len == 0 ) return 0 ; tot_len += next_pub_len ; } } return tot_len ; }
Get the length of a signature, given this particular parameter set
Get the length of a signature given this particular parameter set
/* We also include the public keys for levels > 0 */