lopy4/components/hash-sigs-master/hss_derive.c
/* This derives the current seed value.  If increment_j is set, it'll then */
/* reset the object to the next j value */
This derives the current seed value.  If increment_j is set, it'll then
reset the object to the next j value
This derives the current seed value . If increment_j is set it ' ll then reset the object to the next j value
void hss_seed_derive( unsigned char *seed, struct seed_derive *derive,
                 bool increment_j ) {
    unsigned char buffer[ PRG_MAX_LEN ];
    memcpy( buffer + PRG_I, derive->I, I_LEN );
    put_bigendian( buffer + PRG_Q, derive->q, 4 );
    put_bigendian( buffer + PRG_J, derive->j, 2 );
    buffer[PRG_FF] = 0xff;
    memcpy( buffer + PRG_SEED, derive->master_seed, SEED_LEN );
    hss_hash( seed, HASH, buffer, PRG_LEN(SEED_LEN) );
    hss_zeroize( buffer, PRG_LEN(SEED_LEN) );
    if (increment_j) derive->j += 1;
}
void hss_seed_derive ( unsigned char * seed , struct seed_derive * derive , bool increment_j ) { unsigned char buffer [ PRG_MAX_LEN ] ; memcpy ( buffer + PRG_I , derive -> I , I_LEN ) ; put_bigendian ( buffer + PRG_Q , derive -> q , 4 ) ; put_bigendian ( buffer + PRG_J , derive -> j , 2 ) ; buffer [ PRG_FF ] = 0xff ; memcpy ( buffer + PRG_SEED , derive -> master_seed , SEED_LEN ) ; hss_hash ( seed , HASH , buffer , PRG_LEN ( SEED_LEN ) ) ; hss_zeroize ( buffer , PRG_LEN ( SEED_LEN ) ) ; if ( increment_j ) derive -> j += 1 ; }
This derives the current seed value.
This derives the current seed value .