SEZ9 commented on issue #13377:
URL: https://github.com/apache/seatunnel/issues/13377#issuecomment-7089439740

   Thanks for the proposal to add `SM4_ENCRYPT` / `SM4_DECRYPT` to the SQL 
transform. The two review comments above are identical, so there is one set of 
open asks, and the request stays design-gated until they are answered. Please 
do not open an implementation PR with the pure-Java cipher yet.
   
   **1. Provider and packaging decision**
   
   A handwritten block cipher inside the transform module is not acceptable in 
place of a reviewed provider. Please state:
   - which maintained provider supplies SM4, and on which supported 
JDKs/runtimes it is available;
   - the exact dependency or distribution path, including shading and license 
impact;
   - how the provider is initialized and exercised in the packaged runtime.
   
   The isolated Bouncy Castle use in unrelated artifacts does not show that it 
is available to the SQL transform runtime.
   
   **2. One wire contract**
   
   The current `CryptoFunction` uses the JDK `Cipher` provider for 
`AES/CBC/PKCS5Padding` and returns a Base64 `String`, and `ZetaSQLType` exposes 
the AES functions as `STRING`. A raw `BINARY` SM4 result would therefore be a 
new cross-engine SQL contract, not a direct extension of the AES one. Please 
pick one:
   - **Base64 `STRING` envelope:** documented and compatible with the existing 
AES-function style.
   - **True `BINARY` result:** the same observable type and byte layout in 
every supported SQL engine. This needs a feasibility proof covering the Zeta 
dispatcher/type path and Calcite's `CalciteUdf` SPI/`byte[]` bridge, because 
the Zeta implementation alone does not show engine parity.
   
   **3. Test plan and secret handling**
   
   - Add published test vectors and engine-level binary-type assertions to the 
key, IV, malformed-input and documentation cases you already listed.
   - Confirm that secrets and derived key material stay out of logs, exceptions 
and persisted diagnostics.
   
   Once the provider and the engine contract have maintainer agreement, a 
focused implementation proposal can be reviewed.
   
   <!-- streview-comment:2549 -->


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to