diff mbox

[API-NEXT,PATCHv5,3/7] api: crypto: add random kind info to odp_crypto_capabilities() api

Message ID 1480900520-21989-3-git-send-email-bill.fischofer@linaro.org
State New
Headers show

Commit Message

Bill Fischofer Dec. 5, 2016, 1:15 a.m. UTC
Add the field max_random_kind to the odp_crypto_capability_t struct

Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org>

---
 include/odp/api/spec/crypto.h | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.7.4

Comments

Savolainen, Petri (Nokia - FI/Espoo) Dec. 5, 2016, 3:04 p.m. UTC | #1
> diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h

> index 0cb8814..10373a3 100644

> --- a/include/odp/api/spec/crypto.h

> +++ b/include/odp/api/spec/crypto.h

> @@ -19,6 +19,8 @@

>  extern "C" {

>  #endif

> 

> +#include <odp/api/random.h>

> +

>  /** @defgroup odp_crypto ODP CRYPTO

>   *  Macros, enums, types and operations to utilise crypto.

>   *  @{

> @@ -332,6 +334,8 @@ typedef struct odp_crypto_capability_t {

>  	/** Authentication algorithms implemented with HW offload */

>  	odp_crypto_auth_algos_t   hw_auths;

> 

> +	/** Highest kind of random data available */

> +	odp_random_kind_t max_random_kind;

>  } odp_crypto_capability_t;

> 


This should be in random.h. Maybe simple ...

odp_random_kind_t odp_random_max_kind(void);

... would do it.


-Petri
Bill Fischofer Dec. 5, 2016, 3:20 p.m. UTC | #2
On Mon, Dec 5, 2016 at 9:04 AM, Savolainen, Petri (Nokia - FI/Espoo)
<petri.savolainen@nokia-bell-labs.com> wrote:
>> diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h

>> index 0cb8814..10373a3 100644

>> --- a/include/odp/api/spec/crypto.h

>> +++ b/include/odp/api/spec/crypto.h

>> @@ -19,6 +19,8 @@

>>  extern "C" {

>>  #endif

>>

>> +#include <odp/api/random.h>

>> +

>>  /** @defgroup odp_crypto ODP CRYPTO

>>   *  Macros, enums, types and operations to utilise crypto.

>>   *  @{

>> @@ -332,6 +334,8 @@ typedef struct odp_crypto_capability_t {

>>       /** Authentication algorithms implemented with HW offload */

>>       odp_crypto_auth_algos_t   hw_auths;

>>

>> +     /** Highest kind of random data available */

>> +     odp_random_kind_t max_random_kind;

>>  } odp_crypto_capability_t;

>>

>

> This should be in random.h. Maybe simple ...

>

> odp_random_kind_t odp_random_max_kind(void);

>

> ... would do it.


We've consolidated this sort of information under the general
odp_xxx_capability() framework so it would be consistent to stick with
this. While today kind is the only capability we're exposing that
doesn't mean we wouldn't want to expose additional capabilities in the
future. But I agree this would be a reasonable exception if you'd
prefer that.

>

>

> -Petri
diff mbox

Patch

diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h
index 0cb8814..10373a3 100644
--- a/include/odp/api/spec/crypto.h
+++ b/include/odp/api/spec/crypto.h
@@ -19,6 +19,8 @@ 
 extern "C" {
 #endif
 
+#include <odp/api/random.h>
+
 /** @defgroup odp_crypto ODP CRYPTO
  *  Macros, enums, types and operations to utilise crypto.
  *  @{
@@ -332,6 +334,8 @@  typedef struct odp_crypto_capability_t {
 	/** Authentication algorithms implemented with HW offload */
 	odp_crypto_auth_algos_t   hw_auths;
 
+	/** Highest kind of random data available */
+	odp_random_kind_t max_random_kind;
 } odp_crypto_capability_t;
 
 /**