Lines Matching defs:len
35 * Fills \p buf with \p len random bytes. This is the default implementation for
40 coap_prng_impl(unsigned char *buf, size_t len) {
41 while (len != 0) {
47 for (i = 0; i < len && i < 4; i++) {
51 len -= i;
63 coap_prng_default(void *buf, size_t len) {
66 return (mbedtls_hardware_poll(NULL, buf, len, NULL) ? 0 : 1);
69 return (getrandom(buf, len, 0) > 0) ? 1 : 0;
75 if (len) {
81 if (!--len) {
95 random_bytes(buf, len);
99 return csprng_rand(buf, len);
102 return coap_prng_impl(buf,len);
109 while (len--)
140 coap_prng(void *buf, size_t len) {
145 return rand_func(buf, len);