@@ -2098,13 +2098,15 @@ def setUp(self):
2098
2098
2099
2099
def test_01_insert_encrypted_indexed_and_find (self ):
2100
2100
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
+ )
2102
2104
self .encrypted_client [self .db .name ].explicit_encryption .insert_one (
2103
2105
{"encryptedIndexed" : insert_payload }
2104
2106
)
2105
2107
2106
2108
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
2108
2110
)
2109
2111
docs = list (
2110
2112
self .encrypted_client [self .db .name ].explicit_encryption .find (
@@ -2125,9 +2127,8 @@ def test_02_insert_encrypted_indexed_and_find_contention(self):
2125
2127
{"encryptedIndexed" : insert_payload }
2126
2128
)
2127
2129
2128
- # Find without contention_factor non-deterministically returns 0-9 documents.
2129
2130
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
2131
2132
)
2132
2133
docs = list (
2133
2134
self .encrypted_client [self .db .name ].explicit_encryption .find (
@@ -2168,7 +2169,9 @@ def test_03_insert_encrypted_unindexed(self):
2168
2169
2169
2170
def test_04_roundtrip_encrypted_indexed (self ):
2170
2171
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
+ )
2172
2175
decrypted = self .client_encryption .decrypt (payload )
2173
2176
self .assertEqual (decrypted , val )
2174
2177
0 commit comments