Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 5781

SSP1.2.0 Cryptography RNG API mismatch desciptions

$
0
0

Hello

I am trying to build mbedTLS for SKS7G2 with Netx bsd.  To build mbedTLS need to implement Synergy platform based entropy source strong random number generator (RNG)

SSP documentation has example

 uint32_t rand_data\[32\];
g_sce_trng.p_api->read(g_sce_trng.p_ctrl, rand_data, 16);
 

API header file description shows like below

    /** Generate `nbytes` of random number bytes and store them in `p_rngbuf` buffer
     *  @param[in]   p_ctrl pointer to trng control structure
     *  @param[out]  p_rngbuf generated random numbers will be stored to the buffer `p_rngbuf`
     *  @param[in]   nbytes number of random bytes to generate
     */
    uint32_t (* read)(trng_ctrl_t * const p_ctrl, uint32_t * const p_rngbuf, uint32_t nwords);

 

My question is we should pass number of bytes OR number of 32bit words?  Look at description and function call parameter naming convention.

if nword is answer then need to convert number of bytes into n_words i.e. numbytes / sizeof(uint32_).

not clear which one correct.

Thanks

Mariya

 

 


Viewing all articles
Browse latest Browse all 5781

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>