Skip to content

Commit 47c2a1a

Browse files
committed
feat: make it work
1 parent cb2b213 commit 47c2a1a

28 files changed

+91
-93
lines changed

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ For example, it is possible to have both `unique` and `ore` indexes defined.
348348
For equality (`=`, `<>`) operations, a `unique` index term is a text comparison and should be preferred over an `ore` index term.
349349

350350
The index term types and functions are internal implementation details and should not be exposed as operators on the `eql_v2_encrypted` type.
351-
For example, `eql_v2_encrypted` should not have an operator with the `ore_64_8_v2` type.
351+
For example, `eql_v2_encrypted` should not have an operator with the `ore_block_u64_8_256` type.
352352
Users should never need to think about or interact with EQL internals.
353353

354354
#### Working without operators

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Data is stored in the PostgreSQL database as:
148148
"t": "users"
149149
},
150150
"k": "ct",
151-
"m": null,
151+
"bf": null,
152152
"ob": null,
153153
"u": null,
154154
"v": 1

docs/reference/INDEX.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The default match index options are:
4949
```json
5050
{
5151
"k": 6,
52-
"m": 2048,
52+
"bf": 2048,
5353
"include_original": true,
5454
"tokenizer": {
5555
"kind": "ngram",

docs/tutorials/GETTINGSTARTED.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,15 @@ For ordering or comparison queries we add an `ore` index:
193193

194194
```sql
195195
SELECT cs_add_index_v2('users', 'email_encrypted', 'ore', 'text');
196-
CREATE INDEX ON users (cs_ore_64_8_v2(email_encrypted));
196+
CREATE INDEX ON users (ore_block_u64_8_256(email_encrypted));
197197
```
198198

199199
After adding these indexes, our `eql_v2_configuration` table will look like this:
200200

201201
```bash
202202
id | 1
203203
state | pending
204-
data | {"v": 1, "tables": {"users": {"email_encrypted": {"cast_as": "text", "indexes": {"ore": {}, "match": {"k": 6, "m": 2048, "tokenizer": {"kind": "ngram", "token_length": 3}, "token_filters": [{"kind": "downcase"}], "include_original": true}, "unique": {"token_filters": [{"kind": "downcase"}]}}}}}}
204+
data | {"v": 1, "tables": {"users": {"email_encrypted": {"cast_as": "text", "indexes": {"ore": {}, "match": {"k": 6, "bf": 2048, "tokenizer": {"kind": "ngram", "token_length": 3}, "token_filters": [{"kind": "downcase"}], "include_original": true}, "unique": {"token_filters": [{"kind": "downcase"}]}}}}}}
205205
```
206206

207207
The initial `state` will be set as pending.
@@ -218,7 +218,7 @@ The `cs_configured_v2` table will now have a state of `active`.
218218
```bash
219219
id | 1
220220
state | active
221-
data | {"v": 1, "tables": {"users": {"email_encrypted": {"cast_as": "text", "indexes": {"ore": {}, "match": {"k": 6, "m": 2048, "tokenizer": {"kind": "ngram", "token_length": 3}, "token_filters": [{"kind": "downcase"}], "include_original": true}, "unique": {"token_filters": [{"kind": "downcase"}]}}}}}}
221+
data | {"v": 1, "tables": {"users": {"email_encrypted": {"cast_as": "text", "indexes": {"ore": {}, "match": {"k": 6, "bf": 2048, "tokenizer": {"kind": "ngram", "token_length": 3}, "token_filters": [{"kind": "downcase"}], "include_original": true}, "unique": {"token_filters": [{"kind": "downcase"}]}}}}}}
222222
```
223223

224224
### Encrypting existing plaintext data
@@ -325,7 +325,7 @@ It creates an EQL payload that looks similar to this and inserts this into the e
325325
"t": "users", // Table
326326
"c": "email_encrypted" // Encrypted column
327327
},
328-
"m": [42], // The ciphertext used for free text queries i.e match index
328+
"bf": [42], // The ciphertext used for free text queries i.e match index
329329
"u": "unique ciphertext", // The ciphertext used for unique queries. i.e unique index
330330
"ob": ["a", "b", "c"], // The ciphertext used for order or comparison queries. i.e ore index
331331
"v": 1
@@ -386,7 +386,7 @@ The json stored in the database looks similar to this:
386386
"t": "users", // Table
387387
"c": "email_encrypted" // Encrypted column
388388
},
389-
"m": [42], // The ciphertext used for free text queries i.e match index
389+
"bf": [42], // The ciphertext used for free text queries i.e match index
390390
"u": "unique ciphertext", // The ciphertext used for unique queries. i.e unique index
391391
"ob": ["a", "b", "c"], // The ciphertext used for order or comparison queries. i.e ore index
392392
"v": 1
@@ -509,7 +509,7 @@ Prerequsites:
509509

510510
- An [ore index](#adding-indexes) is needed on the encrypted column to support this operation.
511511

512-
EQL function to use: `cs_ore_64_8_v2(val JSONB)`.
512+
EQL function to use: `ore_block_u64_8_256(val JSONB)`.
513513

514514
A plaintext query order by email looks like this:
515515

@@ -520,7 +520,7 @@ SELECT * FROM users ORDER BY email ASC;
520520
The EQL equivalent of this query is:
521521

522522
```sql
523-
SELECT * FROM users ORDER BY cs_ore_64_8_v2(email_encrypted) ASC;
523+
SELECT * FROM users ORDER BY ore_block_u64_8_256(email_encrypted) ASC;
524524
```
525525

526526
This query returns:
@@ -538,7 +538,7 @@ Prerequsites:
538538

539539
- A [unique index](#adding-indexes) is needed on the encrypted column to support this operation.
540540

541-
EQL function to use: `cs_ore_64_8_v2(val JSONB)`.
541+
EQL function to use: `ore_block_u64_8_256(val JSONB)`.
542542

543543
EQL query payload for a comparison query:
544544

@@ -564,7 +564,7 @@ SELECT * FROM users WHERE email > '[email protected]';
564564
The EQL equivalent of this query is:
565565

566566
```sql
567-
SELECT * FROM users WHERE cs_ore_64_8_v2(email_encrypted) > cs_ore_64_8_v2(
567+
SELECT * FROM users WHERE ore_block_u64_8_256(email_encrypted) > ore_block_u64_8_256(
568568
'{"v":1,"k":"pt","p":"[email protected]","i":{"t":"users","c":"email_encrypted"},"q":"ore"}'
569569
);
570570
```

src/bloom_filter/functions_test.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ DO $$
44
BEGIN
55
PERFORM assert_result(
66
'Extract match index term from encrypted',
7-
'SELECT eql_v2.bloom_filter(''{"m": []}''::jsonb)');
7+
'SELECT eql_v2.bloom_filter(''{"bf": []}''::jsonb)');
88

99
PERFORM assert_exception(
1010
'Missing match index term in encrypted raises exception',

src/config/functions_private.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ LANGUAGE sql STRICT PARALLEL SAFE
8888
BEGIN ATOMIC
8989
SELECT jsonb_build_object(
9090
'k', 6,
91-
'm', 2048,
91+
'bf', 2048,
9292
'include_original', true,
9393
'tokenizer', json_build_object('kind', 'ngram', 'token_length', 3),
9494
'token_filters', json_build_array(json_build_object('kind', 'downcase')));

src/encrypted/aggregates.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-- REQUIRE: src/encrypted/types.sql
2-
-- REQUIRE: ore_block_u64_8_256types.sql
3-
-- REQUIRE: ore_block_u64_8_256functions.sql
2+
-- REQUIRE: src/ore_block_u64_8_256/types.sql
3+
-- REQUIRE: src/ore_block_u64_8_256/functions.sql
44

55
-- Aggregate functions for ORE
66

src/encrypted/aggregates_test.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ INSERT INTO agg_test (plain_int, enc_int) VALUES
1616
),
1717
(
1818
3,
19-
'{"c": "mBbJyWl%QyVQT_N?b~OpQj!$J7B7H2CK@gB#`36H312|)kY;SeM7R*dAl5{R*U)AI+$~k7(JPvj;hmQK^F_}g^7Zs^WuYa^B(7y{V{&<LbY)~;X>N2hzy", "i": {"c": "encrypted_int4", "t": "encrypted"}, "k": "ct", "m": null, "ob": ["ccccccccb06565ebd23d6a4c3eee512713175e673c6d995ff5d9b1d3492fe8eb289c3eb95029025f5b71fc6e06632b4a1302980e433361c7999724dbdd052739258d9444b0fbd43cc61368e60f4b0d5aeca2aa85c1c89933b53afffcc4eb0632dca75f632bb9bc792d1dbd6bced6253291f0db134552d384e9e378f4f5890c31ca9d115965a0e8fbf13ad8d1d33f88d360d5e2f9680fb158f98158443ffc769cd9aac94380f05e3226b785f58006e5b9da6b8d86a7441a88fd848099a2400ef59b494b0c30013568dc1be9bba560565fccb49309ba2ec3edcff6f9d7a67b519b3754b37b0025dff7592a6117949a04043c100353289628884fe06cb2099e7b4b49abea9797a73ee0b85283a5b6f69bcf45f87e6cd6d45ecfd1633903270781173ed9d31a682bba0e54ff355f456bf0c468e378e41cb54fcc074ad40fb4448f6fec892c1ecda15a5efffb8dde3a3b282865ac436d7e43d48d4327c439956733697d3f5b02ead4805a7f905bdae24c1b35252e34939676a07ddb5454c3580c7d76d792a97988e35142f43667112432623eda5126e9af2592dd"], "v": 1}'::jsonb::eql_v2_encrypted
19+
'{"c": "mBbJyWl%QyVQT_N?b~OpQj!$J7B7H2CK@gB#`36H312|)kY;SeM7R*dAl5{R*U)AI+$~k7(JPvj;hmQK^F_}g^7Zs^WuYa^B(7y{V{&<LbY)~;X>N2hzy", "i": {"c": "encrypted_int4", "t": "encrypted"}, "k": "ct", "bf": null, "ob": ["ccccccccb06565ebd23d6a4c3eee512713175e673c6d995ff5d9b1d3492fe8eb289c3eb95029025f5b71fc6e06632b4a1302980e433361c7999724dbdd052739258d9444b0fbd43cc61368e60f4b0d5aeca2aa85c1c89933b53afffcc4eb0632dca75f632bb9bc792d1dbd6bced6253291f0db134552d384e9e378f4f5890c31ca9d115965a0e8fbf13ad8d1d33f88d360d5e2f9680fb158f98158443ffc769cd9aac94380f05e3226b785f58006e5b9da6b8d86a7441a88fd848099a2400ef59b494b0c30013568dc1be9bba560565fccb49309ba2ec3edcff6f9d7a67b519b3754b37b0025dff7592a6117949a04043c100353289628884fe06cb2099e7b4b49abea9797a73ee0b85283a5b6f69bcf45f87e6cd6d45ecfd1633903270781173ed9d31a682bba0e54ff355f456bf0c468e378e41cb54fcc074ad40fb4448f6fec892c1ecda15a5efffb8dde3a3b282865ac436d7e43d48d4327c439956733697d3f5b02ead4805a7f905bdae24c1b35252e34939676a07ddb5454c3580c7d76d792a97988e35142f43667112432623eda5126e9af2592dd"], "v": 1}'::jsonb::eql_v2_encrypted
2020
),
2121
(
2222
5,
23-
'{"c": "mBbKSqWLK6yl>o%G%&x+2$jdg7F`-R(^>R1Q^wGod8-FZ5C$xFI4dN?Ap114=77xPZ9!cKxE}qmyXrhx#K`4ztbUrysQrOFqON6bV{&<LbY)~;X>N2hzy", "i": {"c": "encrypted_int4", "t": "encrypted"}, "k": "ct", "m": null, "ob": ["ccccccccb065659dd23d6a4c3eee512713175e673c6d995ff5d9b1d3492fe8eb289c3eb95029025f5b71fc6e06632b4a1302980e433361c7999724dbdd052739258d9444b0fbd43cc61368e60f4b0d5aeca2aa85c1c89933b53afffcc4eb0632dca75f632bb9bc792d1dbd6bced6253291f0db134552d384bec7bfb23290d7559fd8637b85ca7510cca465570029734ef0319c77177913ad84f54852bed2e2a67b6dafcab3eb70d3a2592414a43acc03703083cf1fa1984dfc0719337d5de4eefd0d137588641a0d38c771b77ab07ebab3fc9bfd7469c4222e1a8edee71188eeb24bfffcd82f711156381d8068223e3d75f5ba8a958182bc46a0ab58c29872cd17e559ed0b935a445249dbac5b51438cebaf9d28d5c8b67cd99f990d5295c1e37470ce5b33fe01eaf31d84c9a08b267c0e9e1aadfcce7f9e2253ababa71eaf1fec309dc988e454717a3c2e3bffb1c546a7195ecf274eb7d691abcf46a61e34d4c63c45d48831dc23aa11f981de692926cd1d1d77a340c9e54baf62da61d5f88960a93e120d3828f4053577b93b536cc9b05c889dcf171865"], "v": 1}'::jsonb::eql_v2_encrypted
23+
'{"c": "mBbKSqWLK6yl>o%G%&x+2$jdg7F`-R(^>R1Q^wGod8-FZ5C$xFI4dN?Ap114=77xPZ9!cKxE}qmyXrhx#K`4ztbUrysQrOFqON6bV{&<LbY)~;X>N2hzy", "i": {"c": "encrypted_int4", "t": "encrypted"}, "k": "ct", "bf": null, "ob": ["ccccccccb065659dd23d6a4c3eee512713175e673c6d995ff5d9b1d3492fe8eb289c3eb95029025f5b71fc6e06632b4a1302980e433361c7999724dbdd052739258d9444b0fbd43cc61368e60f4b0d5aeca2aa85c1c89933b53afffcc4eb0632dca75f632bb9bc792d1dbd6bced6253291f0db134552d384bec7bfb23290d7559fd8637b85ca7510cca465570029734ef0319c77177913ad84f54852bed2e2a67b6dafcab3eb70d3a2592414a43acc03703083cf1fa1984dfc0719337d5de4eefd0d137588641a0d38c771b77ab07ebab3fc9bfd7469c4222e1a8edee71188eeb24bfffcd82f711156381d8068223e3d75f5ba8a958182bc46a0ab58c29872cd17e559ed0b935a445249dbac5b51438cebaf9d28d5c8b67cd99f990d5295c1e37470ce5b33fe01eaf31d84c9a08b267c0e9e1aadfcce7f9e2253ababa71eaf1fec309dc988e454717a3c2e3bffb1c546a7195ecf274eb7d691abcf46a61e34d4c63c45d48831dc23aa11f981de692926cd1d1d77a340c9e54baf62da61d5f88960a93e120d3828f4053577b93b536cc9b05c889dcf171865"], "v": 1}'::jsonb::eql_v2_encrypted
2424
),
2525
(
2626
1,
27-
'{"c": "mBbJSy$p0fHEK%aOAOYi4PTJN7B@a-j{+xl7tffjGTN<-Znt3Zge#lGAX^WHzU`7ml<4vRHLKxoB%}N<H3?J~gR*ISwBlJ)X0By!V{&<LbY)~;X>N2hzy", "i": {"c": "encrypted_int4", "t": "encrypted"}, "k": "ct", "m": null, "ob": ["ccccccccb0656502d23d6a4c3eee512713175e673c6d995ff5d9b1d3492fe8eb289c3eb95029025f5b71fc6e06632b4a1302980e433361c7999724dbdd052739258d9444b0fbd43cc61368e60f4b0d5aeca2aa85c1c89933b53afffcc4eb0632dca75f632bb9bc792d1dbd6bced6253291f0db134552d384250ca116ef329616ddb341917699b9ea48901124a15a4547be1ff7c672c0c1bc6bb17e2a141f46138fc314f4bf8a55068bf031bc48f038c379e54cfbb1c64eb223c18c87cd68a91fb031905e11d9478f158b561399b527038efc594bfd9fb19c963a2778b75215e1d8933b08df04d1c62742fd48a4de310792031a70ca4b157bc218ab3fbadc6dc14b939422023331c03bcf4b673c5d261a19c3d13155cbaa1b84e9e90e389fa6973dde07fba08c13847006707488e288ce780d59700197452ebc68d22032ab03f7b445e45ed7abb1af34955199440f7db2c969c60b1eb49cdcd75d5e8f7de37848ddebb40df8e14d4b92910e15fedac3f61f22ef430805ba1bbf5fccc9fe792e4c0353beee48ca03ef23c7d3fab19e9aa218aefb44e6c26d70"], "v": 1}'::jsonb::eql_v2_encrypted
27+
'{"c": "mBbJSy$p0fHEK%aOAOYi4PTJN7B@a-j{+xl7tffjGTN<-Znt3Zge#lGAX^WHzU`7ml<4vRHLKxoB%}N<H3?J~gR*ISwBlJ)X0By!V{&<LbY)~;X>N2hzy", "i": {"c": "encrypted_int4", "t": "encrypted"}, "k": "ct", "bf": null, "ob": ["ccccccccb0656502d23d6a4c3eee512713175e673c6d995ff5d9b1d3492fe8eb289c3eb95029025f5b71fc6e06632b4a1302980e433361c7999724dbdd052739258d9444b0fbd43cc61368e60f4b0d5aeca2aa85c1c89933b53afffcc4eb0632dca75f632bb9bc792d1dbd6bced6253291f0db134552d384250ca116ef329616ddb341917699b9ea48901124a15a4547be1ff7c672c0c1bc6bb17e2a141f46138fc314f4bf8a55068bf031bc48f038c379e54cfbb1c64eb223c18c87cd68a91fb031905e11d9478f158b561399b527038efc594bfd9fb19c963a2778b75215e1d8933b08df04d1c62742fd48a4de310792031a70ca4b157bc218ab3fbadc6dc14b939422023331c03bcf4b673c5d261a19c3d13155cbaa1b84e9e90e389fa6973dde07fba08c13847006707488e288ce780d59700197452ebc68d22032ab03f7b445e45ed7abb1af34955199440f7db2c969c60b1eb49cdcd75d5e8f7de37848ddebb40df8e14d4b92910e15fedac3f61f22ef430805ba1bbf5fccc9fe792e4c0353beee48ca03ef23c7d3fab19e9aa218aefb44e6c26d70"], "v": 1}'::jsonb::eql_v2_encrypted
2828
),
2929
(
3030
3,
31-
'{"c": "mBbLa7Cm?&jvpfcv1d3hep>s)76qzUbwUky&M&C<M-e2q^@e798gqWcAb{9a>3mjDG_os-_y0MRaMGl@&p#AOuusN|3Lu=mBCcg_V{&<LbY)~;X>N2hzy", "i": {"c": "encrypted_int4", "t": "encrypted"}, "k": "ct", "m": null, "ob": ["ccccccccb06565ebd23d6a4c3eee512713175e673c6d995ff5d9b1d3492fe8eb289c3eb95029025f5b71fc6e06632b4a1302980e433361c7999724dbdd052739258d9444b0fbd43cc61368e60f4b0d5aeca2aa85c1c89933b53afffcc4eb0632dca75f632bb9bc792d1dbd6bced6253291f0db134552d384e9e378f4f5890c31ca9d115965a0e8fb2c3c60ccce84ffc03bddb22b27a1ce278eec118496fd23f083ebb21bb4b83b89eda8c0bdea50debc5ec4f2b2d91b63a80d39386194ad9d129bee2f5168341cb41ed26dc03466cac5e2dbe7336fdb74c0d37d63b396033ce60002c9950f5ac2970dacf4caace2eef5b81544df88a7ef2a8d69550d25d39c678c8e43a3dcc2857018a2c979b45c6b19dabd28ae7388d62916e6742763d6484d1b45154e6c8e6a66e02b03f64b67ddef24747dded32e226e3a93d5d1a92d11e760403cad04a0dd07c14da336a409739e8bbeb3b3d6b92117fa2d2c941da4996ea61b29ca3fffb4594ddbeab7105a1b4c5e422ec5ab8154db545103d8c2889be2e4591198912446d8b33b8708a4cc959a1e0957dcae6a50c3"], "v": 1}'::jsonb::eql_v2_encrypted
31+
'{"c": "mBbLa7Cm?&jvpfcv1d3hep>s)76qzUbwUky&M&C<M-e2q^@e798gqWcAb{9a>3mjDG_os-_y0MRaMGl@&p#AOuusN|3Lu=mBCcg_V{&<LbY)~;X>N2hzy", "i": {"c": "encrypted_int4", "t": "encrypted"}, "k": "ct", "bf": null, "ob": ["ccccccccb06565ebd23d6a4c3eee512713175e673c6d995ff5d9b1d3492fe8eb289c3eb95029025f5b71fc6e06632b4a1302980e433361c7999724dbdd052739258d9444b0fbd43cc61368e60f4b0d5aeca2aa85c1c89933b53afffcc4eb0632dca75f632bb9bc792d1dbd6bced6253291f0db134552d384e9e378f4f5890c31ca9d115965a0e8fb2c3c60ccce84ffc03bddb22b27a1ce278eec118496fd23f083ebb21bb4b83b89eda8c0bdea50debc5ec4f2b2d91b63a80d39386194ad9d129bee2f5168341cb41ed26dc03466cac5e2dbe7336fdb74c0d37d63b396033ce60002c9950f5ac2970dacf4caace2eef5b81544df88a7ef2a8d69550d25d39c678c8e43a3dcc2857018a2c979b45c6b19dabd28ae7388d62916e6742763d6484d1b45154e6c8e6a66e02b03f64b67ddef24747dded32e226e3a93d5d1a92d11e760403cad04a0dd07c14da336a409739e8bbeb3b3d6b92117fa2d2c941da4996ea61b29ca3fffb4594ddbeab7105a1b4c5e422ec5ab8154db545103d8c2889be2e4591198912446d8b33b8708a4cc959a1e0957dcae6a50c3"], "v": 1}'::jsonb::eql_v2_encrypted
3232
)
3333
;
3434

@@ -53,7 +53,7 @@ $$ LANGUAGE plpgsql;
5353
INSERT INTO agg_test (plain_int, enc_int) VALUES
5454
(
5555
3,
56-
'{"c": "mBbLa7Cm?&jvpfcv1d3hep>s)76qzUbwUky&M&C<M-e2q^@e798gqWcAb{9a>3mjDG_os-_y0MRaMGl@&p#AOuusN|3Lu=mBCcg_V{&<LbY)~;X>N2hzy", "i": {"c": "encrypted_int4", "t": "encrypted"}, "k": "ct", "m": null, "v": 1}'::jsonb::eql_v2_encrypted
56+
'{"c": "mBbLa7Cm?&jvpfcv1d3hep>s)76qzUbwUky&M&C<M-e2q^@e798gqWcAb{9a>3mjDG_os-_y0MRaMGl@&p#AOuusN|3Lu=mBCcg_V{&<LbY)~;X>N2hzy", "i": {"c": "encrypted_int4", "t": "encrypted"}, "k": "ct", "bf": null, "v": 1}'::jsonb::eql_v2_encrypted
5757
);
5858

5959
-- run exceptional case

src/encrypted/functions.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-- REQUIRE: src/encrypted/types.sql
22
-- REQUIRE: src/bloom_filter/types.sql
3-
-- REQUIRE: ore_block_u64_8_256types.sql
3+
-- REQUIRE: src/ore_block_u64_8_256/types.sql
44
-- REQUIRE: src/hmac_256/types.sql
55

66

src/hmac_256/functions_test.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ DO $$
44
BEGIN
55
PERFORM assert_result(
66
'Extract hmac_256 index term from encrypted',
7-
'SELECT eql_v2.hmac_256(''{"u": "u"}''::jsonb)');
7+
'SELECT eql_v2.hmac_256(''{"hm": "u"}''::jsonb)');
88

99
PERFORM assert_exception(
1010
'Missing hmac_256 index term in encrypted raises exception',

src/operators/<.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- REQUIRE: src/schema.sql
2-
-- REQUIRE: ore_block_u64_8_256types.sql
3-
-- REQUIRE: ore_block_u64_8_256functions.sql
4-
-- REQUIRE: ore_block_u64_8_256operators.sql
2+
-- REQUIRE: src/ore_block_u64_8_256/types.sql
3+
-- REQUIRE: src/ore_block_u64_8_256/functions.sql
4+
-- REQUIRE: src/ore_block_u64_8_256/operators.sql
55

66

77
-- Operators for < less than comparisons of eql_v2_encrypted types
@@ -13,7 +13,7 @@
1313
-- jsonb = eql_v2_encrypted
1414
--
1515
-- There are multiple index terms that provide equality comparisons
16-
-- - ore_64_8_v2
16+
-- - ore_block_u64_8_256
1717
-- - ore_cllw_8_v2
1818
--
1919
-- We check these index terms in this order and use the first one that exists for both parameters
@@ -41,7 +41,7 @@ AS $$
4141
BEGIN
4242
RETURN eql_v2.ore_block_u64_8_256(a) < eql_v2.ore_block_u64_8_256(b);
4343
EXCEPTION WHEN OTHERS THEN
44-
-- PERFORM eql_v2.log('eql_v2.lt no ore_64_8_v2 index');
44+
-- PERFORM eql_v2.log('eql_v2.lt no ore_block_u64_8_256 index');
4545
END;
4646

4747
RETURN false;

src/operators/<=.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- REQUIRE: src/encrypted/types.sql
2-
-- REQUIRE: ore_block_u64_8_256types.sql
3-
-- REQUIRE: ore_block_u64_8_256functions.sql
4-
-- REQUIRE: ore_block_u64_8_256operators.sql
2+
-- REQUIRE: src/ore_block_u64_8_256/types.sql
3+
-- REQUIRE: src/ore_block_u64_8_256/functions.sql
4+
-- REQUIRE: src/ore_block_u64_8_256/operators.sql
55

66

77
-- Operators for < less than comparisons of eql_v2_encrypted types
@@ -13,7 +13,7 @@
1313
-- jsonb = eql_v2_encrypted
1414
--
1515
-- There are multiple index terms that provide equality comparisons
16-
-- - ore_64_8_v2
16+
-- - ore_block_u64_8_256
1717
-- - ore_cllw_8_v2
1818
--
1919
-- We check these index terms in this order and use the first one that exists for both parameters
@@ -41,7 +41,7 @@ AS $$
4141
BEGIN
4242
RETURN eql_v2.ore_block_u64_8_256(a) <= eql_v2.ore_block_u64_8_256(b);
4343
EXCEPTION WHEN OTHERS THEN
44-
-- PERFORM eql_v2.log('eql_v2.lte no ore_64_8_v2 index');
44+
-- PERFORM eql_v2.log('eql_v2.lte no ore_block_u64_8_256 index');
4545
END;
4646

4747
RETURN false;

src/operators/<>.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
-- REQUIRE: src/encrypted/types.sql
22
-- REQUIRE: src/hmac_256/types.sql
33
-- REQUIRE: src/hmac_256/functions.sql
4-
-- REQUIRE: ore_block_u64_8_256types.sql
5-
-- REQUIRE: ore_block_u64_8_256functions.sql
4+
-- REQUIRE: src/ore_block_u64_8_256/types.sql
5+
-- REQUIRE: src/ore_block_u64_8_256/functions.sql
66
-- REQUIRE: src/operators/=.sql
77

88
-- Operators for equality comparisons of eql_v2_encrypted types
@@ -15,7 +15,7 @@
1515
--
1616
-- There are multiple index terms that provide equality comparisons
1717
-- - hmac_256
18-
-- - ore_64_8_v2
18+
-- - ore_block_u64_8_256
1919
-- - ore_cllw_8_v2
2020
--
2121
-- We check these index terms in this order and use the first one that exists for both parameters

src/operators/<>_test.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ DECLARE
1313
BEGIN
1414

1515
for i in 1..3 loop
16-
e := create_encrypted_json(i, 'u');
16+
e := create_encrypted_json(i, 'hm');
1717

1818
PERFORM assert_count(
1919
format('eql_v2_encrypted <> eql_v2_encrypted with unique index term %s of 3', i),
@@ -23,7 +23,7 @@ DECLARE
2323
end loop;
2424

2525
-- record not in database
26-
e := create_encrypted_json(91347, 'u');
26+
e := create_encrypted_json(91347, 'hm');
2727

2828
PERFORM assert_no_result(
2929
'eql_v2_encrypted <> eql_v2_encrypted with no matching record',
@@ -44,7 +44,7 @@ DECLARE
4444
BEGIN
4545

4646
for i in 1..3 loop
47-
e := create_encrypted_json(i, 'u');
47+
e := create_encrypted_json(i, 'hm');
4848

4949
PERFORM assert_count(
5050
format('eql_v2.neq(eql_v2_encrypted, eql_v2_encrypted) with unique index term %s of 3', i),
@@ -53,7 +53,7 @@ DECLARE
5353
end loop;
5454

5555
-- record not in database
56-
e := create_encrypted_json(91347, 'u');
56+
e := create_encrypted_json(91347, 'hm');
5757

5858
PERFORM assert_no_result(
5959
'eql_v2_encrypted <> eql_v2_encrypted with no matching record',

0 commit comments

Comments
 (0)