Github user vectorijk commented on a diff in the pull request:
https://github.com/apache/spark/pull/10527#discussion_r49436980
--- Diff:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/MiscFunctionsSuite.scala
---
@@ -130,4 +130,49 @@ class MiscFunctionsSuite extends SparkFunSuite with
ExpressionEvalHelper {
}
}
}
+
+ test("aesEncrypt") {
+ checkEvaluation(Base64(AesEncrypt(Literal("ABC".getBytes),
+ Literal("1234567890123456".getBytes))), "y6Ss+zCYObpCbgfWfyNWTw==")
+ checkEvaluation(Base64(AesEncrypt(Literal("".getBytes),
+ Literal("1234567890123456".getBytes))), "BQGHoM3lqYcsurCRq3PlUw==")
+
+ // Before testing this, installing Java Cryptography Extension (JCE)
+ // Unlimited Strength Jurisdiction Policy Files first
+// checkEvaluation(Base64(AesEncrypt(Literal("ABC".getBytes),
+// Literal("12345678901234561234567890123456".getBytes))),
"nYfCuJeRd5eD60yXDw7WEA==")
--- End diff --
Because Oracle JRE/JDK supports AES-128 out of the box. AES-192 and AES-256
are supported if Java Cryptography Extension (JCE) Unlimited Strength
Jurisdiction Policy Files are installed. In this test case, key size is 256
bits. We should install JCE not only with this test also any test with 192/256
bits key. I commented out this test by default in case this test fails.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]