11-- REQUIRE: src/schema.sql
22-- REQUIRE: src/hmac_256/types.sql
33
4- -- extracts hmac_256 index from an encrypted column
5-
4+ -- ! @brief Extract HMAC-SHA256 index term from JSONB payload
5+ -- !
6+ -- ! Extracts the HMAC-SHA256 hash value from the 'hm' field of an encrypted
7+ -- ! data payload. Used internally for exact-match comparisons.
8+ -- !
9+ -- ! @param val JSONB Encrypted data payload containing index terms
10+ -- ! @return eql_v2.hmac_256 HMAC-SHA256 hash value
11+ -- ! @throws Exception if 'hm' field is missing when hmac_256 index is expected
12+ -- !
13+ -- ! @see eql_v2.has_hmac_256
14+ -- ! @see eql_v2.compare_hmac_256
615CREATE FUNCTION eql_v2 .hmac_256(val jsonb)
716 RETURNS eql_v2 .hmac_256
817 IMMUTABLE STRICT PARALLEL SAFE
2029$$ LANGUAGE plpgsql;
2130
2231
32+ -- ! @brief Check if JSONB payload contains HMAC-SHA256 index term
33+ -- !
34+ -- ! Tests whether the encrypted data payload includes an 'hm' field,
35+ -- ! indicating an HMAC-SHA256 hash is available for exact-match queries.
36+ -- !
37+ -- ! @param val JSONB Encrypted data payload
38+ -- ! @return Boolean True if 'hm' field is present and non-null
39+ -- !
40+ -- ! @see eql_v2.hmac_256
2341CREATE FUNCTION eql_v2 .has_hmac_256(val jsonb)
2442 RETURNS boolean
2543 IMMUTABLE STRICT PARALLEL SAFE
3048$$ LANGUAGE plpgsql;
3149
3250
51+ -- ! @brief Check if encrypted column value contains HMAC-SHA256 index term
52+ -- !
53+ -- ! Tests whether an encrypted column value includes an HMAC-SHA256 hash
54+ -- ! by checking its underlying JSONB data field.
55+ -- !
56+ -- ! @param val eql_v2_encrypted Encrypted column value
57+ -- ! @return Boolean True if HMAC-SHA256 hash is present
58+ -- !
59+ -- ! @see eql_v2.has_hmac_256(jsonb)
3360CREATE FUNCTION eql_v2 .has_hmac_256(val eql_v2_encrypted)
3461 RETURNS boolean
3562 IMMUTABLE STRICT PARALLEL SAFE
@@ -41,8 +68,15 @@ $$ LANGUAGE plpgsql;
4168
4269
4370
44- -- extracts hmac_256 index from an encrypted column
45-
71+ -- ! @brief Extract HMAC-SHA256 index term from encrypted column value
72+ -- !
73+ -- ! Extracts the HMAC-SHA256 hash from an encrypted column value by accessing
74+ -- ! its underlying JSONB data field.
75+ -- !
76+ -- ! @param val eql_v2_encrypted Encrypted column value
77+ -- ! @return eql_v2.hmac_256 HMAC-SHA256 hash value
78+ -- !
79+ -- ! @see eql_v2.hmac_256(jsonb)
4680CREATE FUNCTION eql_v2 .hmac_256(val eql_v2_encrypted)
4781 RETURNS eql_v2 .hmac_256
4882 IMMUTABLE STRICT PARALLEL SAFE
0 commit comments