Skip to content

Commit b0ca45a

Browse files
authored
Merge pull request #281 from cipherstash/fix/v3-sem-coderabbit-findings
fix(v3/sem): address CodeRabbit findings (hmac_256 inlining, ORE casing, fixture comment)
2 parents ee975b2 + e372831 commit b0ca45a

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

src/v3/sem/hmac_256/functions.sql

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ $$;
3333
--! @return boolean True if 'hm' field is present and non-null
3434
CREATE FUNCTION eql_v3.has_hmac_256(val jsonb)
3535
RETURNS boolean
36+
LANGUAGE sql
3637
IMMUTABLE STRICT PARALLEL SAFE
37-
SET search_path = pg_catalog, extensions, public
3838
AS $$
39-
BEGIN
40-
RETURN val ->> 'hm' IS NOT NULL;
41-
END;
42-
$$ LANGUAGE plpgsql;
39+
SELECT (val ->> 'hm') IS NOT NULL
40+
$$;

src/v3/sem/ore_block_u64_8_256/functions.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ AS $$
132132
FOR block IN 0..7 LOOP
133133
IF
134134
substr(a.bytes, 1 + block, 1) != substr(b.bytes, 1 + block, 1)
135-
OR substr(a.bytes, 9 + left_block_size * block, left_block_size) != substr(b.bytes, 9 + left_block_size * BLOCK, left_block_size)
135+
OR substr(a.bytes, 9 + left_block_size * block, left_block_size) != substr(b.bytes, 9 + left_block_size * block, left_block_size)
136136
THEN
137137
IF eq THEN
138138
unequal_block := block;

tests/sqlx/fixtures/match_data.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-- Tests encrypted-to-encrypted matching using bloom filter indexes
55
--
66
-- Plaintext structure: {"hello": "world", "n": N}
7-
-- where N is 10, 20, or 30 for records 1, 2, 3
7+
-- where N is 1, 2, or 3 for records 1, 2, 3
88

99
-- Create table for LIKE operator tests
1010
DROP TABLE IF EXISTS encrypted CASCADE;

0 commit comments

Comments
 (0)