@@ -618,6 +618,8 @@ int odp_crypto_capability(odp_crypto_capability_t *capa)
capa->max_sessions = MAX_SESSIONS;
+ capa->max_random_kind = ODP_RANDOM_CRYPTO;
+
return 0;
}
@@ -872,9 +874,13 @@ int odp_crypto_term_global(void)
}
int32_t
-odp_random_data(uint8_t *buf, int32_t len, odp_bool_t use_entropy ODP_UNUSED)
+odp_random_data(uint8_t *buf, int32_t len, odp_random_kind_t kind)
{
int32_t rc;
+
+ if (kind > ODP_RANDOM_CRYPTO)
+ return -1;
+
rc = RAND_bytes(buf, len);
return (1 == rc) ? len /*success*/: -1 /*failure*/;
}
Add random kind related values to odp_crypto_capability() and implement this selector field in odp_random_data(). Since odp-linux uses the OpenSSL RAND_bytes() API, the highest kind of random data supported by this implementation is ODP_RANDOM_CRYPTO. Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> --- platform/linux-generic/odp_crypto.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.7.4