Class RawCipherSupport
java.lang.Object
dev.frostlake.functions.scalar.crypto.RawCipherSupport
Shared helpers for the raw-key
EncryptRaw / DecryptRaw AES-GCM functions: hex BINARY
conversion (the engine represents BINARY as an uppercase hex string) and the encryption-method guard.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intGCM authentication-tag length used by ENCRYPT_RAW / DECRYPT_RAW, in bits and bytes.static final int -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]binaryBytes(String function, Object arg) Read a BINARY argument's bytes.static StringbytesToHex(byte[] bytes) Encode bytes as an uppercase hex BINARY string, matching the engine's BINARY rendering.static byte[]hexToBytes(String function, String hex) Decode an uppercase-or-lowercase hex BINARY string to bytes.static voidrequireGcm(String function, Object method) Reject anything but AES-GCM.
-
Field Details
-
GCM_TAG_BITS
public static final int GCM_TAG_BITSGCM authentication-tag length used by ENCRYPT_RAW / DECRYPT_RAW, in bits and bytes.- See Also:
-
GCM_TAG_BYTES
public static final int GCM_TAG_BYTES- See Also:
-
-
Method Details
-
requireGcm
Reject anything but AES-GCM. A null method is the Snowflake default (AES-GCM); any explicit method that does not name the GCM mode is refused so that an unsupported mode fails loudly rather than being silently mis-encrypted. -
binaryBytes
Read a BINARY argument's bytes. Snowflake types the crypto arguments (plaintext/ciphertext, key, IV, AAD, tag) as BINARY and rejects a VARCHAR with "Invalid argument types" — a hex string is NOT silently accepted. Abyte[]is tolerated (an already-unwrapped BINARY). -
hexToBytes
Decode an uppercase-or-lowercase hex BINARY string to bytes. -
bytesToHex
Encode bytes as an uppercase hex BINARY string, matching the engine's BINARY rendering.
-