perf[aes]: 提升Aes加密的性能

This commit is contained in:
godotg
2022-07-07 20:22:31 +08:00
parent 22acf58aa8
commit a3c0f0346b
@@ -30,7 +30,7 @@ import java.util.Base64;
* <p>
* 默认AES/ECB/PKCS5Padding
*
* @author jaysunxiao
* @author godotg
* @version 3.0
*/
public abstract class AesUtils {
@@ -93,8 +93,7 @@ public abstract class AesUtils {
public static byte[] encrypt(byte[] bytes) {
try {
var cipher = LOCAL_ENCRYPT_CIPHER.get();
return cipher.doFinal(bytes);
return LOCAL_ENCRYPT_CIPHER.get().doFinal(bytes);
} catch (Exception e) {
throw new RuntimeException(e);
}
@@ -119,8 +118,7 @@ public abstract class AesUtils {
public static byte[] decrypt(byte[] bytes) {
try {
var cipher = LOCAL_DECRYPT_CIPHER.get();
return cipher.doFinal(bytes);
return LOCAL_DECRYPT_CIPHER.get().doFinal(bytes);
} catch (Exception e) {
throw new RuntimeException(e);
}