From c018b700bae95b2070942fac3241019829ba0c61 Mon Sep 17 00:00:00 2001 From: tabVersion Date: Mon, 22 Jan 2024 17:28:00 +0800 Subject: [PATCH] stash --- src/expr/impl/src/scalar/encrypt.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/expr/impl/src/scalar/encrypt.rs b/src/expr/impl/src/scalar/encrypt.rs index bb3304ddb4a6f..93f4661a70e20 100644 --- a/src/expr/impl/src/scalar/encrypt.rs +++ b/src/expr/impl/src/scalar/encrypt.rs @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -use aes_gcm::{Aes128Gcm, Aes256Gcm, Key, KeyInit, OsRng}; +use aes_gcm::aead::OsRng; +use aes_gcm::{Aes128Gcm, Aes256Gcm, Key, KeyInit}; use risingwave_expr::{function, ExprError, Result}; enum CypherEnum { @@ -37,9 +38,9 @@ fn build_encrypt(key: &[u8], mode: &str) -> Result { /// from pg doc https://www.postgresql.org/docs/current/pgcrypto.html#PGCRYPTO-RAW-ENC-FUNCS #[function( - "decrypt(bytea, bytea, text) -> bytea", - prebuilt = "build_encrypt($1, $2)" + "decrypt(bytea, bytea, varchar) -> bytea", + prebuild = "build_encrypt($1, $2)?" )] -pub fn decrypt(data: &[u8], cypher: CypherEnum) -> Result> { +pub fn decrypt(data: &[u8], cypher: CypherEnum) -> Result> { Ok(data) }