Reference Guide

Chapter 5: Cryptographic API Changes 43
RSA BSAFE Crypto-C Micro Edition 3.x to 4.1.4 Migration Guide
Implementing a PRNG - Crypto-C ME 4.1.4
int function(R_CR_CTX *ctx)
{
int ret;
R_CR *rng = NULL;
ret = R_CR_new(crypto_ctx, R_CR_TYPE_RANDOM,
R_CR_ID_RANDOM_DEFAULT, 0, &rng);
if (R_ERROR_NONE != ret)
goto end;
ret = R_CR_random_init(rng);
if (R_ERROR_NONE != ret)
goto end;
ret = R_CR_random_seed(rng, seed_data, seed_len);
if (R_ERROR_NONE != ret)
goto end;
ret = R_CR_random_bytes(rng, sizeof(buf), buf, &len);
if (R_ERROR_NONE != ret)
goto end;
/* Use random data */
end:
R_CR_free(rng);
return ret;
}