diff options
Diffstat (limited to 'jstests/fle2/libs/encrypted_client_util.js')
-rw-r--r-- | jstests/fle2/libs/encrypted_client_util.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/jstests/fle2/libs/encrypted_client_util.js b/jstests/fle2/libs/encrypted_client_util.js index 501fee781c6..4a6a3a5a4dc 100644 --- a/jstests/fle2/libs/encrypted_client_util.js +++ b/jstests/fle2/libs/encrypted_client_util.js @@ -293,3 +293,15 @@ function assertIsIndexedEncryptedField(value) { assert(value.hex().startsWith("07"), "Expected subtype 7 but found the wrong type: " + value.hex()); } + +/** + * Assert a field is an unindexed encrypted field + * + * @param {BinData} value bindata value + */ +function assertIsUnindexedEncryptedField(value) { + assert(value instanceof BinData, "Expected BinData, found: " + value); + assert.eq(value.subtype(), 6, "Expected Encrypted bindata: " + value); + assert(value.hex().startsWith("06"), + "Expected subtype 6 but found the wrong type: " + value.hex()); +} |