lib_hash_drbg/src/drvr.c
/*
 * Generate a 64-bit random code word, as 8 bytes
 *  This is a random value which has been turned into a code word
 *
 * Parameters:
 * uint8_t* drvr - 8 byte buffer to hold the random code word
 * int with_1e   - 0: all bits random
 *                 1: four bits are forced to 1s in the high byte
 *
 * Return code:
 *  0 - All is well
 * >0 - Error occurred somewhere
 */
Generate a 64-bit random code word, as 8 bytes
This is a random value which has been turned into a code word

uint8_t* drvr - 8 byte buffer to hold the random code word
int with_1e   - 0: all bits random
1: four bits are forced to 1s in the high byte

Return code:
0 - All is well
>0 - Error occurred somewhere
Generate a 64 - bit random code word as 8 bytes This is a random value which has been turned into a code word uint8_t * drvr - 8 byte buffer to hold the random code word int with_1e - 0 : all bits random 1 : four bits are forced to 1s in the high byte Return code : 0 - All is well > 0 - Error occurred somewhere
int
drvr_b_get_rand_64(uint8_t* drvr, int with_1e)
{
    int ret_code;
    ret_code = get_rand_bytes(drvr, 8);
    if (with_1e == 1) {
        drvr[60/8] |= (1 << (60%8));
        drvr[59/8] |= (1 << (59%8));
        drvr[58/8] |= (1 << (58%8));
        drvr[57/8] |= (1 << (57%8));
    }
    if (ret_code == SUCCESS) {
        drvr_b_make_code_word_64(drvr);
    }
    return ret_code;
}
int drvr_b_get_rand_64 ( uint8_t * drvr , int with_1e ) { int ret_code ; ret_code = get_rand_bytes ( drvr , 8 ) ; if ( with_1e == 1 ) { drvr [ 60 / 8 ] |= ( 1 << ( 60 % 8 ) ) ; drvr [ 59 / 8 ] |= ( 1 << ( 59 % 8 ) ) ; drvr [ 58 / 8 ] |= ( 1 << ( 58 % 8 ) ) ; drvr [ 57 / 8 ] |= ( 1 << ( 57 % 8 ) ) ; } if ( ret_code == SUCCESS ) { drvr_b_make_code_word_64 ( drvr ) ; } return ret_code ; }
Generate a 64-bit random code word, as 8 bytes
  This is a random value which has been turned into a code word
Generate a 64 - bit random code word as 8 bytes This is a random value which has been turned into a code word
/*
     * Get 8 bytes of random data
     */ /*
     * Convert the random bytes to a DRVR code word
     */