fix thread safe issue with mac.doFinal in java encription