Lines Matching refs:hs
149 hs->pool[n % MBEDTLS_HAVEGE_COLLECT_SIZE] ^= RES[i];
154 static void havege_fill( mbedtls_havege_state *hs ) in havege_fill() argument
162 WALK = hs->WALK; in havege_fill()
163 PT1 = hs->PT1; in havege_fill()
164 PT2 = hs->PT2; in havege_fill()
181 hs->PT1 = PT1; in havege_fill()
182 hs->PT2 = PT2; in havege_fill()
184 hs->offset[0] = 0; in havege_fill()
185 hs->offset[1] = MBEDTLS_HAVEGE_COLLECT_SIZE / 2; in havege_fill()
191 void mbedtls_havege_init( mbedtls_havege_state *hs ) in mbedtls_havege_init() argument
193 memset( hs, 0, sizeof( mbedtls_havege_state ) ); in mbedtls_havege_init()
195 havege_fill( hs ); in mbedtls_havege_init()
198 void mbedtls_havege_free( mbedtls_havege_state *hs ) in mbedtls_havege_free() argument
200 if( hs == NULL ) in mbedtls_havege_free()
203 mbedtls_platform_zeroize( hs, sizeof( mbedtls_havege_state ) ); in mbedtls_havege_free()
213 mbedtls_havege_state *hs = (mbedtls_havege_state *) p_rng; in mbedtls_havege_random() local
222 if( hs->offset[1] >= MBEDTLS_HAVEGE_COLLECT_SIZE ) in mbedtls_havege_random()
223 havege_fill( hs ); in mbedtls_havege_random()
225 val = hs->pool[hs->offset[0]++]; in mbedtls_havege_random()
226 val ^= hs->pool[hs->offset[1]++]; in mbedtls_havege_random()