1 (edited by cachristiansen 2022-07-05 06:29:28)

Topic: Creating TRNG with Renesas RX65 TSIP

I am trying to create a true random number. By looking at these sites it should be possible when i have a Renesas RX65 with TSIP.

https://www.wolfssl.com/true-random-vs- … eneration/

Do you have any documentation/example code ?

Currently i am using this code by calling "wc_InitRng" but it this the proper way? and do i need to call wc_RNG_GenerateBlock also ? Because this site says that "wc_RNG_GenerateBlock " create pseudorandom and i want to make TRNG: https://www.wolfssl.com/doxygen/group__ … 743020f83c ("Copies a sz bytes of pseudorandom data to output. Will reseed rng if needed (blocking). ")

   #include "r_bsp/mcu/all/r_rx_compiler.h"
   #include "r_bsp/platform.h"
    #include "r_tsip_rx_if.h"

    int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
        int ret = 0;
        word32 buffer[4];

        while (sz > 0) {
            word32 len = sizeof(buffer);

            if (sz < len) {
                len = sz;
            /* return 4 words random number*/
            ret = R_TSIP_GenerateRandomNumber(buffer);
            if(ret == TSIP_SUCCESS) {
                XMEMCPY(output, &buffer, len);
                output += len;
                sz -= len;
            } else
                return ret;
        return ret;



Re: Creating TRNG with Renesas RX65 TSIP

Hello cachristiansen

Thanks for joining the forum. In order to provide highest priority support, we recommend emailing support@wolfssl.com with your questions.

The default implementation of wc_RNG_GenerateBlock will use the TSIP RNG via the seed operation. You can implement you r own block RNG function by defining CUSTOM_RAND_GENERATE_BLOCK.

Eric @ wolfSSL Support