You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using the lib inside a mulitply-threads context and found it is not thread-safe. There are global variables are using to optimized some internal parameters delivery.
For instance:
static state_t* state;
static uint8_t RoundKey[keyExpSize];
static const uint8_t* Key;
After remove them, lib are working propertly under mulitply-threads.
The text was updated successfully, but these errors were encountered:
Hi @quhaige thanks for your interest in the project :)
You are right that static variables do not work well with multithreading.
An easy fix is to move all variables inside a struct and pass it to the encryption/decryption functions.
Check out this pull request with the same goal: #9
We are using the lib inside a mulitply-threads context and found it is not thread-safe. There are global variables are using to optimized some internal parameters delivery.
For instance:
static state_t* state;
static uint8_t RoundKey[keyExpSize];
static const uint8_t* Key;
After remove them, lib are working propertly under mulitply-threads.
The text was updated successfully, but these errors were encountered: