others/fw-verif/8051secureboot/fw/rsa.c
// generate random number, put in hash
generate random number, put in hash
generate random number put in hash
void PRG(unsigned char* state)
{
    unsigned int i;
    unsigned char next[H];
    HMAC(state, H, one, 32);
    for(i=0; i<H; i++)
        next[i] = sha_regs.wr_addr[i];
    HMAC(state, H, zero, 32);
    unlock(page, state, state+H);
    writecarr(page, state, next, H);
    lock(page, state, state+H);
}
void PRG ( unsigned char * state ) { unsigned int i ; unsigned char next [ H ] ; HMAC ( state , H , one , 32 ) ; for ( i = 0 ; i < H ; i ++ ) next [ i ] = sha_regs . wr_addr [ i ] ; HMAC ( state , H , zero , 32 ) ; unlock ( page , state , state + H ) ; writecarr ( page , state , next , H ) ; lock ( page , state , state + H ) ; }
generate random number, put in hash
generate random number put in hash
// compute next state // compute next output