muvarov replied on github web page:

platform/linux-generic/odp_crypto.c
@@ -112,8 +112,18 @@ struct odp_crypto_generic_session_t {
                const EVP_MD *evp_md;
                crypto_func_t func;
        } auth;
+
+       uint32_t cipher_valid[(ODP_THREAD_COUNT_MAX + 32 - 1) / 32];
+       uint32_t hmac_valid[(ODP_THREAD_COUNT_MAX + 32 - 1) / 32];
+       unsigned idx;
 };
 
+#define IS_VALID(session, type, id)    \
+       (session->type ## _valid[id / 32] & (1 << (id % 32)))
+
+#define SET_VALID(session, type, id)   \
+       session->type ## _valid[id / 32] |= (1 << (id % 32))


Comment:
is 32 everywhere MAX_SESSIONS?

https://github.com/Linaro/odp/pull/342#discussion_r157223565
updated_at 2017-12-16 02:08:29

Reply via email to