You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/05/23 07:53:18 UTC

[GitHub] [shardingsphere] klboke commented on pull request #5766: Optimized aes encryption implementation

klboke commented on pull request #5766:
URL: https://github.com/apache/shardingsphere/pull/5766#issuecomment-633003293


   > I don't think it's a good idea to lift the initialization into `init`, `javax.crypto.Cipher` is not thread-safe and the method `org.apache.shardingsphere.encrypt.strategy.impl.AESEncryptor#encrypt` is definitely possible to be called by multiple threads, you'd better keep it as is, or at least put it into `ThreadLocal`
   
   After the thread shares the instance, there is indeed a thread safety problem. Do you have more detailed documentation on the thread safety of javax.crypto.Cipher?
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org