Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: crypto: return value of odp_crypto_cipher_capability/odp_crypto_auth_capability #652

Open
lumag opened this issue Jul 23, 2018 · 2 comments

Comments

@lumag
Copy link

lumag commented Jul 23, 2018

Currently we enforce that crypto capabilities retrieval functions always return same value for 'number of capability structures'. This helps one to use following code sequence easily:

int num_caps = odp_crypto_cipher_capability(ODP_CIPHER_ALG_AES_CBC, NULL, 0);
odp_crypto_cipher_capability_t capa[num_caps];
int ret = odp_crypto_cipher_capability(ODP_CIPHER_ALG_AES_CBC, capa, num_caps);
int i;

for (i = 0; i < num_capa; i++)
    do_something(&capa[i]);

For ODP-DPDK this might lead to inclusion of duplicate or overlapping entries in capabilties structure.
Options to consider:

  • leave API as is, document that caps might include overlapping entries
  • change requirement so that ret <= num_capa, forcing users to loop till ret in the second loop
  • ???
@Bill-Fischofer-Linaro
Copy link
Contributor

@lumag is this issue still current?

@lumag
Copy link
Author

lumag commented Sep 13, 2018

@Bill-Fischofer-Linaro sure it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants