33-- REQUIRE: src/ore_cllw_u64_8/types.sql
44
55
6-
7- -- extracts ste_vec index from a jsonb value
8-
9- -- extracts ore_cllw_u64_8 index from a jsonb value
10-
6+ -- ! @brief Extract CLLW ORE index term from JSONB payload
7+ -- !
8+ -- ! Extracts the CLLW ORE ciphertext from the 'ocf' field of an encrypted
9+ -- ! data payload. Used internally for range query comparisons.
10+ -- !
11+ -- ! @param val JSONB Encrypted data payload containing index terms
12+ -- ! @return eql_v2.ore_cllw_u64_8 CLLW ORE ciphertext
13+ -- ! @throws Exception if 'ocf' field is missing when ore index is expected
14+ -- !
15+ -- ! @see eql_v2.has_ore_cllw_u64_8
16+ -- ! @see eql_v2.compare_ore_cllw_u64_8
1117CREATE FUNCTION eql_v2 .ore_cllw_u64_8(val jsonb)
1218 RETURNS eql_v2 .ore_cllw_u64_8
1319 IMMUTABLE STRICT PARALLEL SAFE
2632$$ LANGUAGE plpgsql;
2733
2834
29- -- extracts ore_cllw_u64_8 index from an eql_v2_encrypted value
30-
35+ -- ! @brief Extract CLLW ORE index term from encrypted column value
36+ -- !
37+ -- ! Extracts the CLLW ORE ciphertext from an encrypted column value by accessing
38+ -- ! its underlying JSONB data field.
39+ -- !
40+ -- ! @param val eql_v2_encrypted Encrypted column value
41+ -- ! @return eql_v2.ore_cllw_u64_8 CLLW ORE ciphertext
42+ -- !
43+ -- ! @see eql_v2.ore_cllw_u64_8(jsonb)
3144CREATE FUNCTION eql_v2 .ore_cllw_u64_8(val eql_v2_encrypted)
3245 RETURNS eql_v2 .ore_cllw_u64_8
3346 IMMUTABLE STRICT PARALLEL SAFE
3851$$ LANGUAGE plpgsql;
3952
4053
54+ -- ! @brief Check if JSONB payload contains CLLW ORE index term
55+ -- !
56+ -- ! Tests whether the encrypted data payload includes an 'ocf' field,
57+ -- ! indicating a CLLW ORE ciphertext is available for range queries.
58+ -- !
59+ -- ! @param val JSONB Encrypted data payload
60+ -- ! @return Boolean True if 'ocf' field is present and non-null
61+ -- !
62+ -- ! @see eql_v2.ore_cllw_u64_8
4163CREATE FUNCTION eql_v2 .has_ore_cllw_u64_8(val jsonb)
4264 RETURNS boolean
4365 IMMUTABLE STRICT PARALLEL SAFE
4870$$ LANGUAGE plpgsql;
4971
5072
73+ -- ! @brief Check if encrypted column value contains CLLW ORE index term
74+ -- !
75+ -- ! Tests whether an encrypted column value includes a CLLW ORE ciphertext
76+ -- ! by checking its underlying JSONB data field.
77+ -- !
78+ -- ! @param val eql_v2_encrypted Encrypted column value
79+ -- ! @return Boolean True if CLLW ORE ciphertext is present
80+ -- !
81+ -- ! @see eql_v2.has_ore_cllw_u64_8(jsonb)
5182CREATE FUNCTION eql_v2 .has_ore_cllw_u64_8(val eql_v2_encrypted)
5283 RETURNS boolean
5384 IMMUTABLE STRICT PARALLEL SAFE
@@ -59,11 +90,20 @@ $$ LANGUAGE plpgsql;
5990
6091
6192
62- --
63- -- Compare ore cllw bytes
64- -- Used by both fixed and variable ore cllw variants
65- --
66-
93+ -- ! @brief Compare CLLW ORE ciphertext bytes
94+ -- ! @internal
95+ -- !
96+ -- ! Byte-by-byte comparison of CLLW ORE ciphertexts implementing the CLLW
97+ -- ! comparison algorithm. Used by both fixed-width (ore_cllw_u64_8) and
98+ -- ! variable-width (ore_cllw_var_8) ORE variants.
99+ -- !
100+ -- ! @param a Bytea First CLLW ORE ciphertext
101+ -- ! @param b Bytea Second CLLW ORE ciphertext
102+ -- ! @return Integer -1 if a < b, 0 if a = b, 1 if a > b
103+ -- ! @throws Exception if ciphertexts are different lengths
104+ -- !
105+ -- ! @note Shared comparison logic for multiple ORE CLLW schemes
106+ -- ! @see eql_v2.compare_ore_cllw_u64_8
67107CREATE FUNCTION eql_v2 .compare_ore_cllw_term_bytes(a bytea , b bytea )
68108RETURNS int AS $$
69109DECLARE
0 commit comments