@@ -2098,13 +2098,15 @@ def setUp(self):
20982098
20992099 def test_01_insert_encrypted_indexed_and_find (self ):
21002100 val = "encrypted indexed value"
2101- insert_payload = self .client_encryption .encrypt (val , Algorithm .INDEXED , self .key1_id )
2101+ insert_payload = self .client_encryption .encrypt (
2102+ val , Algorithm .INDEXED , self .key1_id , contention_factor = 0
2103+ )
21022104 self .encrypted_client [self .db .name ].explicit_encryption .insert_one (
21032105 {"encryptedIndexed" : insert_payload }
21042106 )
21052107
21062108 find_payload = self .client_encryption .encrypt (
2107- val , Algorithm .INDEXED , self .key1_id , query_type = QueryType .EQUALITY
2109+ val , Algorithm .INDEXED , self .key1_id , query_type = QueryType .EQUALITY , contention_factor = 0
21082110 )
21092111 docs = list (
21102112 self .encrypted_client [self .db .name ].explicit_encryption .find (
@@ -2125,9 +2127,8 @@ def test_02_insert_encrypted_indexed_and_find_contention(self):
21252127 {"encryptedIndexed" : insert_payload }
21262128 )
21272129
2128- # Find without contention_factor non-deterministically returns 0-9 documents.
21292130 find_payload = self .client_encryption .encrypt (
2130- val , Algorithm .INDEXED , self .key1_id , query_type = QueryType .EQUALITY
2131+ val , Algorithm .INDEXED , self .key1_id , query_type = QueryType .EQUALITY , contention_factor = 0
21312132 )
21322133 docs = list (
21332134 self .encrypted_client [self .db .name ].explicit_encryption .find (
@@ -2168,7 +2169,9 @@ def test_03_insert_encrypted_unindexed(self):
21682169
21692170 def test_04_roundtrip_encrypted_indexed (self ):
21702171 val = "encrypted indexed value"
2171- payload = self .client_encryption .encrypt (val , Algorithm .INDEXED , self .key1_id )
2172+ payload = self .client_encryption .encrypt (
2173+ val , Algorithm .INDEXED , self .key1_id , contention_factor = 0
2174+ )
21722175 decrypted = self .client_encryption .decrypt (payload )
21732176 self .assertEqual (decrypted , val )
21742177
0 commit comments