Line data Source code
1 : #include "../fd_f25519.h" 2 : 3 : /* fd_f25519_rng generates a random fd_f25519_t element. 4 : Note: insecure, for tests only. */ 5 : fd_f25519_t * 6 : fd_f25519_rng_unsafe( fd_f25519_t * r, 7 31 : fd_rng_t * rng ) { 8 31 : uchar buf[32]; 9 1023 : for( int j=0; j<32; j++ ) { 10 992 : buf[j] = fd_rng_uchar( rng ); 11 992 : } 12 31 : return fd_f25519_frombytes( r, buf ); 13 31 : }