libmongocrypt-helper 1.11.0.0.1001 → 1.13.2.0.1001
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/libmongocrypt/libmongocrypt/CHANGELOG.md +27 -1
- data/ext/libmongocrypt/libmongocrypt/CMakeLists.txt +13 -2
- data/ext/libmongocrypt/libmongocrypt/CODEOWNERS +1 -7
- data/ext/libmongocrypt/libmongocrypt/CONTRIBUTING.md +14 -0
- data/ext/libmongocrypt/libmongocrypt/Earthfile +49 -50
- data/ext/libmongocrypt/libmongocrypt/README.md +39 -23
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/README.md +4 -67
- data/ext/libmongocrypt/libmongocrypt/bindings/python/CHANGELOG.rst +14 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/README.rst +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/libmongocrypt-version.txt +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/asynchronous/state_machine.py +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/binding.py +39 -7
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/mongocrypt.py +32 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/version.py +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pyproject.toml +1 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/release.sh +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/sbom.json +10 -9
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/compact/success/encrypted-field-config-map.json +0 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/encrypted-field-config-map.json +0 -2
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_mongocrypt.py +13 -12
- data/ext/libmongocrypt/libmongocrypt/cmake/FetchMongoC.cmake +4 -2
- data/ext/libmongocrypt/libmongocrypt/cmake/ImportBSON.cmake +1 -1
- data/ext/libmongocrypt/libmongocrypt/doc/releasing.md +37 -40
- data/ext/libmongocrypt/libmongocrypt/etc/cyclonedx.sbom.json +10 -9
- data/ext/libmongocrypt/libmongocrypt/etc/format.sh +0 -2
- data/ext/libmongocrypt/libmongocrypt/etc/libbson-remove-GCC-diagnostic-in-functions.patch +158 -0
- data/ext/libmongocrypt/libmongocrypt/etc/libbson-remove-GCC-diagnostic-pragma.patch +3 -3
- data/ext/libmongocrypt/libmongocrypt/etc/purls.txt +1 -1
- data/ext/libmongocrypt/libmongocrypt/integrating.md +51 -13
- data/ext/libmongocrypt/libmongocrypt/kms-message/README.md +1 -1
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_crypto_windows.c +2 -2
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_response_parser.h +3 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message.c +1 -1
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message_private.h +2 -2
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request.c +3 -3
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_response_parser.c +8 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kmip_reader_writer.c +5 -5
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_assert.h +25 -8
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_azure_online.c +2 -2
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_gcp_online.c +3 -3
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kms_request.c +12 -10
- data/ext/libmongocrypt/libmongocrypt/src/mc-cmp-private.h +137 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-efc-private.h +5 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-efc.c +35 -1
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle-blob-subtype-private.h +5 -2
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder-private.h +99 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder.c +226 -2
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-v2.c +0 -1
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload.c +0 -1
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-private-v2.h +5 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-private-v2.h +39 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-v2.c +165 -1
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload.c +0 -1
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-private-v2.h +183 -60
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-v2.c +498 -115
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds-private.h +10 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-tag-and-encrypted-metadata-block-private.h +49 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-tag-and-encrypted-metadata-block.c +98 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation.c +3 -2
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding.c +2 -1
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-generator.template.h +2 -2
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover.c +1 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts-private.h +6 -1
- data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts.c +2 -1
- data/ext/libmongocrypt/libmongocrypt/src/mc-schema-broker-private.h +126 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-schema-broker.c +1075 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-str-encode-string-sets-private.h +95 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-str-encode-string-sets.c +304 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-text-search-str-encode-private.h +45 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-text-search-str-encode.c +248 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-tokens-private.h +112 -2
- data/ext/libmongocrypt/libmongocrypt/src/mc-tokens.c +166 -2
- data/ext/libmongocrypt/libmongocrypt/src/mlib/windows-lean.h +2 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-buffer-private.h +11 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-buffer.c +36 -3
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-collinfo.c +1 -1
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-key.c +1 -1
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-private.h +2 -2
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache.c +1 -1
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ciphertext.c +1 -1
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-datakey.c +2 -1
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-decrypt.c +8 -4
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-encrypt.c +429 -858
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-private.h +55 -19
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx.c +13 -10
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker.c +15 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-private.h +9 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key.c +6 -2
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx-private.h +6 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx.c +174 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-log.c +0 -1
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking-private.h +4 -0
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking.c +518 -524
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts-private.h +0 -4
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts.c +1 -1
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-private.h +8 -12
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-traverse-util.c +1 -1
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-util.c +3 -1
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.c +25 -9
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.h +65 -6
- data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_dll.c +3 -1
- data/ext/libmongocrypt/libmongocrypt/src/unicode/case-fold-map.c +1434 -0
- data/ext/libmongocrypt/libmongocrypt/src/unicode/diacritic-fold-map.c +2884 -0
- data/ext/libmongocrypt/libmongocrypt/src/unicode/fold.c +139 -0
- data/ext/libmongocrypt/libmongocrypt/src/unicode/fold.h +58 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/unencrypted/payload.json +2 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/missing-key-id/collinfo.json +1 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/no-fields/collinfo.json +1 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/collinfo.json +1 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/anchor-pad/collinfo.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/anchor-pad/encrypted-payload-range-v2.json +20 -21
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/missing-key-id/collinfo.json +2 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-fields/collinfo.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-range/collinfo.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/collinfo.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-field-config-map.json +0 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-payload-range-v2.json +20 -21
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/omitted/cmd-to-mongocryptd.json +1 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/omitted/collinfo.json +2 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/omitted/encrypted-payload.json +2 -3
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/omitted/mongocryptd-reply.json +1 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved/cmd-to-mongocryptd.json +1 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved/collinfo.json +2 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved/encrypted-payload.json +2 -3
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved/mongocryptd-reply.json +1 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_empty/cmd-to-mongocryptd.json +1 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_empty/collinfo.json +2 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_empty/mongocryptd-reply.json +1 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/dollardb/preserved_fle1/collinfo.json +2 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/efc/efc-extraField.json +0 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/efc/efc-missingKeyId.json +0 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/efc/efc-oneField-badVersionSet.json +23 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/efc/efc-oneField-goodVersionSet.json +23 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/efc/efc-oneField.json +0 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/efc/efc-textSearchFields-badVersionSet.json +48 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/efc/efc-textSearchFields-goodVersionSet.json +48 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/efc/efc-textSearchFields.json +47 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/efc/efc-twoFields.json +0 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/encrypted-field-config-map.json +1 -3
- data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE1DeterministicEncryptedValue.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE1EncryptionPlaceholder.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE1RandomEncryptedValue.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE2EncryptionPlaceholder.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE2EqualityIndexedValueV2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE2FindEqualityPayloadV2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE2IndexedEqualityEncryptedValue.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE2IndexedEqualityEncryptedValueV2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE2IndexedRangeEncryptedValue.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE2IndexedRangeEncryptedValueV2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE2InsertUpdatePayload-with-edges-V2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE2InsertUpdatePayload-with-edges.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/{fle2-explicit/insert-indexed.json → explicit-decrypt/FLE2InsertUpdatePayload.json} +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE2InsertUpdatePayloadV2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE2RangeIndexedValueV2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE2UnindexedEncryptedValue.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/explicit-decrypt/FLE2UnindexedEncryptedValueV2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/find-with-encryptionInformation.json +0 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-explain/with-csfle/collinfo.json +2 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-explain/with-mongocryptd/collinfo.json +2 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-bad-str-encode-version/bad-collinfo.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-bad-str-encode-version/bad-create-cmd-mongocryptd-reply.json +51 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-bad-str-encode-version/bad-create-cmd-to-mongocryptd.json +45 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-bad-str-encode-version/bad-create-cmd.json +18 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/{fle2-find-range/int32/encrypted-field-map.json → fle2-bad-str-encode-version/bad-encrypted-field-config-map.json} +7 -12
- data/ext/libmongocrypt/libmongocrypt/test/data/{fle2-insert → fle2-bad-str-encode-version}/encrypted-payload.json +4 -4
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create/cmd-to-mongocryptd.json +1 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create/encrypted-field-config-map.json +1 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create-encrypted-collection/cmd-to-mongocryptd.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create-encrypted-collection/cmd.json +17 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/{fle2-find-equality/encrypted-field-map.json → fle2-create-encrypted-collection/encrypted-field-config-map.json} +9 -8
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create-encrypted-collection/encrypted-payload.json +17 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create-encrypted-collection/mongocryptd-reply.json +50 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create-encrypted-collection-encrypted-fields-unset-str-encode-version/cmd-to-mongocryptd.json +45 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create-encrypted-collection-encrypted-fields-unset-str-encode-version/mongocryptd-reply.json +51 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create-encrypted-collection-with-str-encode-version/cmd-to-mongocryptd.json +46 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create-encrypted-collection-with-str-encode-version/cmd.json +18 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create-encrypted-collection-with-str-encode-version/encrypted-field-config-map.json +25 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create-encrypted-collection-with-str-encode-version/encrypted-payload.json +18 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create-encrypted-collection-with-str-encode-version/mongocryptd-reply.json +52 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/collinfo.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/encrypted-field-config-map.json +0 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/encrypted-payload-v2.json +57 -59
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/mongocryptd-reply.json +63 -64
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/collinfo.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/encrypted-field-config-map.json +0 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/encrypted-payload-v2.json +64 -66
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/mongocryptd-reply.json +69 -70
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-csfle/collinfo.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-csfle/encrypted-payload.json +1 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-mongocryptd/cmd-to-mongocryptd.json +1 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-mongocryptd/collinfo.json +2 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-mongocryptd/encrypted-payload.json +2 -3
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-mongocryptd/mongocryptd-reply.json +1 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-explicit/cmd-to-mongocryptd.json +0 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-explicit/cmd-to-mongod.json +0 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-explicit/reply-from-mongocryptd.json +0 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32/encrypted-field-map.json +0 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-text-search/cmd.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/{fle2-find-range/double → fle2-insert-text-search}/encrypted-field-map.json +10 -9
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-text-search/encrypted-payload.json +47 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-text-search/mongocryptd-reply.json +55 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/{fle2-find-range/date → fle2-insert-text-search-with-str-encode-version}/encrypted-field-map.json +12 -10
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-text-search-with-str-encode-version/encrypted-payload.json +47 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-text-search-with-str-encode-version/mongocryptd-reply.json +55 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2-with-str-encode-version/cmd.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/{fle2-insert → fle2-insert-v2-with-str-encode-version}/encrypted-field-map.json +2 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2-with-str-encode-version/encrypted-payload.json +40 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/{fle2-insert → fle2-insert-v2-with-str-encode-version}/mongocryptd-reply.json +2 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-text-search-create-encrypted-collection/cmd-to-mongocryptd.json +55 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-text-search-create-encrypted-collection/cmd.json +22 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-text-search-create-encrypted-collection/encrypted-field-config-map.json +29 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-text-search-create-encrypted-collection/encrypted-payload.json +23 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-text-search-create-encrypted-collection/mongocryptd-reply.json +61 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-text-search-create-encrypted-collection-with-str-encode-version/cmd-to-mongocryptd.json +56 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-text-search-create-encrypted-collection-with-str-encode-version/cmd.json +23 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-text-search-create-encrypted-collection-with-str-encode-version/encrypted-field-config-map.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-text-search-create-encrypted-collection-with-str-encode-version/encrypted-payload.json +23 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-text-search-create-encrypted-collection-with-str-encode-version/mongocryptd-reply.json +62 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/iev-v2/FLECrudTest-insertOneRangeV2.json +9 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/iev-v2/FLECrudTest-insertOneText.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/iev-v2/FLECrudTest-insertOneTextLarge.json +930 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/iev-v2/FLECrudTest-insertOneV2.json +1 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/kms-tests.json +4 -4
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle/cmd-to-mongocryptd.json +60 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle/cmd.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle/collInfo-c1.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle/collInfo-c2.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-facet/cmd.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-mismatch/cmd.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/{bindings/cs/MongoDB.Libmongocrypt.Test/test/example/collection-info.json → test/data/lookup/csfle-mismatch/collInfo-c1.json} +12 -10
- data/ext/libmongocrypt/libmongocrypt/{bindings/java/mongocrypt/src/test/resources/collection-info.json → test/data/lookup/csfle-mismatch/collInfo-c3.json} +13 -11
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-nested/cmd.json +24 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-only-schemaMap/cmd-to-mongocryptd.json +60 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-only-schemaMap/cmd.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-only-schemaMap/schemaMap.json +40 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-schemaMap/cmd-to-mongocryptd.json +60 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-schemaMap/cmd.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-schemaMap/collInfo-c1.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-schemaMap/schemaMap.json +21 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-self/cmd-to-mongocryptd.json +34 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-self/cmd.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-self/collInfo-c1.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-sibling/cmd-to-mongocryptd.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-sibling/cmd.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-sibling/collInfo-c1.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-sibling/collInfo-c2.json +29 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-sibling/reply-from-mongocryptd.json +18 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-unionWith/cmd.json +21 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-view/cmd.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-view/collInfo-c1.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/csfle-view/collInfo-v1.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/csfle/csfle/cmd-to-mongocryptd.json +65 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/csfle/csfle/cmd-to-mongod.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/csfle/csfle/cmd.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/csfle/csfle/collInfo-c1.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/csfle/csfle/collInfo-c2.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/{bindings/java/mongocrypt/src/test/resources/keys/ABCDEFAB123498761234123456789012-local-document.json → test/data/lookup/mixed/csfle/csfle/key-doc.json} +4 -4
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/csfle/csfle/reply-from-mongocryptd.json +33 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/csfle/no-schema/cmd-to-mongocryptd.json +47 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/csfle/no-schema/cmd-to-mongod.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/csfle/no-schema/cmd.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/csfle/no-schema/collInfo-c1.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/csfle/no-schema/collInfo-c2.json +17 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/csfle/no-schema/key-doc.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/csfle/no-schema/reply-from-mongocryptd.json +33 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/csfle/qe/cmd-to-mongocryptd.json +70 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/csfle/qe/cmd.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/csfle/qe/collInfo-c1.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/csfle/qe/collInfo-c2.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/csfle/cmd-to-mongocryptd.json +47 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/csfle/cmd-to-mongod.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/csfle/cmd.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/csfle/collInfo-c1.json +17 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/csfle/collInfo-c2.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/csfle/key-doc.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/csfle/reply-from-mongocryptd.json +33 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/no-schema/cmd-to-mongocryptd.json +29 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/no-schema/cmd-to-mongod.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/no-schema/cmd.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/no-schema/collInfo-c1.json +17 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/no-schema/collInfo-c2.json +17 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/no-schema/reply-from-mongocryptd.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/qe/cmd-to-mongocryptd.json +53 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/qe/cmd-to-mongod.json +58 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/qe/cmd.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/qe/collInfo-c1.json +17 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/qe/collInfo-c2.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/qe/key-doc.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/no-schema/qe/reply-from-mongocryptd.json +65 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/qe/csfle/cmd-to-mongocryptd.json +70 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/qe/csfle/cmd.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/qe/csfle/collInfo-c1.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/qe/csfle/collInfo-c2.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/qe/no-schema/cmd-to-mongocryptd.json +53 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/qe/no-schema/cmd-to-mongod.json +56 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/qe/no-schema/cmd.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/qe/no-schema/collInfo-c1.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/qe/no-schema/collInfo-c2.json +17 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/qe/no-schema/key-doc.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/qe/no-schema/reply-from-mongocryptd.json +63 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/qe/qe/cmd-to-mongocryptd.json +66 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/qe/qe/cmd-to-mongod.json +71 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/qe/qe/cmd.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/qe/qe/collInfo-c1.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/qe/qe/collInfo-c2.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/qe/qe/key-doc.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/mixed/qe/qe/reply-from-mongocryptd.json +78 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe/cmd-to-mongocryptd.json +61 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe/cmd-to-mongod.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe/cmd.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe/collInfo-c1.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe/collInfo-c2.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe/reply-from-mongocryptd.json +68 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe-encryptedFieldsMap/cmd-to-mongocryptd.json +66 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe-encryptedFieldsMap/cmd-to-mongod.json +71 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe-encryptedFieldsMap/cmd.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe-encryptedFieldsMap/collInfo-c1.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/{fle2-insert-unindexed/encrypted-field-map.json → lookup/qe-encryptedFieldsMap/encryptedFieldsMap.json} +6 -7
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe-encryptedFieldsMap/key-doc.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe-encryptedFieldsMap/reply-from-mongocryptd.json +78 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe-self/cmd-to-mongocryptd.json +46 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe-self/cmd-to-mongod.json +53 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe-self/cmd.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe-self/collInfo-c1.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe-self/key-doc.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe-self/reply-from-mongocryptd.json +58 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe-with-payload/cmd-to-mongocryptd.json +66 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe-with-payload/cmd-to-mongod.json +75 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe-with-payload/cmd.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe-with-payload/collInfo-c1.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe-with-payload/collInfo-c2.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe-with-payload/key-doc.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/lookup/qe-with-payload/reply-from-mongocryptd.json +78 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/{fle2-create/mongocryptd-ismaster.json → mongocryptd-ismaster-17.json} +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/mongocryptd-ismaster-26.json +12 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/multikey/command.json +7 -0
- data/ext/libmongocrypt/libmongocrypt/{bindings/java/mongocrypt/src/test/resources/key-document.json → test/data/multikey/key-document-a.json} +18 -19
- data/ext/libmongocrypt/libmongocrypt/test/data/multikey/key-document-b.json +37 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/multikey/mongocryptd_reply.json +34 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/multikey/schema_map.json +35 -0
- data/ext/libmongocrypt/libmongocrypt/{bindings/java/mongocrypt/src/test/resources/kms-reply.txt → test/data/rmd/kms-decrypt-reply-429.txt} +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/schema-broker/collinfo-encryptedFields.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/schema-broker/collinfo-encryptedFields2.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/schema-broker/collinfo-jsonSchema.json +43 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/schema-broker/collinfo-noSchema.json +21 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/schema-broker/create-with-jsonSchema.json +24 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/schema-broker/encryptedFields.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/schema-broker/encryptedFields2.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/schema-broker/encryptedFieldsMap.json +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/schema-broker/jsonSchema.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/schema-broker/jsonSchema2.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/schema-broker/schemaMap.json +40 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/tokens/mc.json +28 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/tokens/server.json +28 -2
- data/ext/libmongocrypt/libmongocrypt/test/example-state-machine.c +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-cmp.c +304 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-efc.c +70 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-encryption-placeholder.c +468 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-find-equality-payload-v2.c +20 -1
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iev-v2.c +370 -22
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iev.c +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup-v2.c +25 -1
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup.c +24 -1
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-uev.c +2 -2
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-rfds.c +2 -2
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-tag-and-encrypted-metadata-block.c +91 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-edge-generation.c +6 -7
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-encoding.c +32 -33
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-mincover.c +68 -75
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-rangeopts.c +2 -2
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-schema-broker.c +1124 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-text-search-str-encode.c +1207 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-tokens.c +144 -37
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.c +13 -14
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.h +2 -2
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert.h +21 -4
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-buffer.c +25 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cache.c +3 -20
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-hooks.c +57 -46
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto.c +37 -7
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-csfle-lib.c +21 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-decrypt.c +226 -146
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-encrypt.c +1529 -1197
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-rewrap-many-datakey.c +79 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-datakey.c +160 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kek.c +3 -3
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key-cache.c +7 -7
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kms-responses.c +6 -5
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-marking.c +750 -110
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.c +143 -33
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.h +39 -4
- data/ext/libmongocrypt/libmongocrypt/test/test-unicode-fold.c +97 -0
- data/lib/libmongocrypt_helper/version.rb +2 -2
- metadata +233 -225
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/CMakeLists.txt +0 -17
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Driver.snk +0 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/AssemblyInfo.cs +0 -4
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Binary.cs +0 -145
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/BinarySafeHandle.cs +0 -60
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CheckableSafeHandle.cs +0 -46
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CipherCallbacks.cs +0 -168
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/ContextSafeHandle.cs +0 -48
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptClient.cs +0 -257
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptClientFactory.cs +0 -138
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptContext.cs +0 -214
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptException.cs +0 -37
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptOptions.cs +0 -67
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/HashCallback.cs +0 -59
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/HmacShaCallbacks.cs +0 -96
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/IStatus.cs +0 -26
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/KmsCredentials.cs +0 -53
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/KmsKeyId.cs +0 -91
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/KmsRequest.cs +0 -125
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/KmsRequestCollection.cs +0 -60
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Library.cs +0 -684
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/LibraryLoader.cs +0 -289
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/LibraryLoadingException.cs +0 -34
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/License.txt +0 -14
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/LogLevel.cs +0 -26
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/MongoCryptSafeHandle.cs +0 -48
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/MongoDB.Libmongocrypt.csproj +0 -107
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/MongoDB.Libmongocrypt.ruleset +0 -85
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/MongoDB.Libmongocrypt.targets +0 -21
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/OperatingSystemHelper.cs +0 -59
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Package.include.template.csproj +0 -38
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/PinnedBinary.cs +0 -49
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/SecureRandomCallback.cs +0 -51
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/SigningRSAESPKCSCallback.cs +0 -74
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Status.cs +0 -94
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/StatusSafeHandle.cs +0 -60
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/StyleCop.ruleset +0 -11
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/stylecop.json +0 -8
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Example/MongoDB.Libmongocrypt.Example.csproj +0 -23
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Example/Package.include.template.csproj +0 -11
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Example/Program.cs +0 -442
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/BasicTests.cs +0 -748
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/BsonUtil.cs +0 -82
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/CallbackUtils.cs +0 -37
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/CipherCallbacksTests.cs +0 -46
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/HashCallbackTests.cs +0 -37
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/HmacShaCallbacksTests.cs +0 -37
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/MongoDB.Libmongocrypt.Test.csproj +0 -37
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/Package.include.template.csproj +0 -23
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/SigningRSAESPKCSCallbackTests.cs +0 -64
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/command-reply.json +0 -13
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/encrypted-command-reply.json +0 -16
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/encrypted-command.json +0 -11
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/encrypted-value.json +0 -6
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/key-document.json +0 -36
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/key-filter.json +0 -19
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/list-collections-filter.json +0 -3
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/test/example/mongocryptd-command.json +0 -22
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/xunit.runner.json +0 -6
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test32/BasicTests.cs +0 -54
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test32/MongoDB.Libmongocrypt.Test32.csproj +0 -44
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test32/Package.include.template.csproj +0 -23
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.cake +0 -215
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.config +0 -3
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.ps1 +0 -275
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.sh +0 -77
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/README.md +0 -36
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/benchmarks/build.gradle.kts +0 -28
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/benchmarks/src/main/java/com/mongodb/crypt/benchmark/BenchmarkRunner.java +0 -217
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/benchmarks/src/main/resources/keyDocument.json +0 -24
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/build.gradle.kts +0 -354
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradle/wrapper/gradle-wrapper.jar +0 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradle/wrapper/gradle-wrapper.properties +0 -5
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradlew +0 -234
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradlew.bat +0 -89
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/settings.gradle.kts +0 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/BinaryHolder.java +0 -45
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CAPI.java +0 -1165
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CAPIHelper.java +0 -96
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CipherCallback.java +0 -92
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/DisposableMemory.java +0 -31
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/JULLogger.java +0 -130
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/Logger.java +0 -144
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/Loggers.java +0 -50
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MacCallback.java +0 -60
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MessageDigestCallback.java +0 -55
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoAwsKmsProviderOptions.java +0 -104
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCrypt.java +0 -100
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCryptContext.java +0 -137
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCryptContextImpl.java +0 -164
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCryptException.java +0 -67
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCryptImpl.java +0 -423
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCryptOptions.java +0 -284
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCrypts.java +0 -38
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoDataKeyOptions.java +0 -125
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoExplicitEncryptOptions.java +0 -227
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoKeyDecryptor.java +0 -76
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoKeyDecryptorImpl.java +0 -105
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoLocalKmsProviderOptions.java +0 -83
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoRewrapManyDataKeyOptions.java +0 -104
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/SLF4JLogger.java +0 -110
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/SecureRandomCallback.java +0 -51
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/SigningRSAESPKCSCallback.java +0 -76
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/package-info.java +0 -18
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/resources/META-INF/native-image/jni-config.json +0 -180
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/resources/META-INF/native-image/reflect-config.json +0 -134
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/java/com/mongodb/crypt/capi/MongoCryptTest.java +0 -389
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/command-reply.json +0 -13
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/command.json +0 -6
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/encrypted-command-reply.json +0 -16
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/encrypted-command.json +0 -11
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/encrypted-value.json +0 -6
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit-v2/int32/encrypted-payload.json +0 -26
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit-v2/int32/key-filter.json +0 -19
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit-v2/int32/rangeopts.json +0 -14
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit-v2/int32/value-to-encrypt.json +0 -20
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/json-schema.json +0 -15
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/key-filter-keyAltName.json +0 -14
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/key-filter.json +0 -19
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/list-collections-filter.json +0 -3
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/mongocryptd-command.json +0 -22
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/mongocryptd-reply.json +0 -18
- data/ext/libmongocrypt/libmongocrypt/etc/silk-create-asset-group.sh +0 -70
- data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/jsonSchema/cmd.json +0 -20
- data/ext/libmongocrypt/libmongocrypt/test/data/collection-info-no-schema.json +0 -19
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-range/encrypted-field-config-map.json +0 -47
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-collMod/insert/cmd.json +0 -8
- data/ext/libmongocrypt/libmongocrypt/test/data/fle1-collMod/insert/collinfo.json +0 -9
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-create/ismaster-to-mongocryptd.json +0 -3
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/encrypted-payload.json +0 -91
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/encrypted-payload.json +0 -98
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/find-indexed-contentionFactor1.json +0 -8
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-contentionFactor1.json +0 -8
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-same-user-and-index-key.json +0 -8
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality/cmd.json +0 -6
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality/encrypted-payload.json +0 -41
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality/mongocryptd-reply.json +0 -19
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date/cmd.json +0 -10
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date/encrypted-payload.json +0 -42
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date/mongocryptd-reply.json +0 -50
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128/cmd.json +0 -6
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128/encrypted-field-map.json +0 -28
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128/encrypted-payload.json +0 -42
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128/mongocryptd-reply.json +0 -50
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision/cmd.json +0 -6
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision/encrypted-field-map.json +0 -31
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision/encrypted-payload.json +0 -51
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision/mongocryptd-reply.json +0 -59
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double/cmd.json +0 -8
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double/encrypted-payload.json +0 -42
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double/mongocryptd-reply.json +0 -50
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision/cmd.json +0 -8
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision/encrypted-field-map.json +0 -31
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision/encrypted-payload.json +0 -45
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision/mongocryptd-reply.json +0 -53
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32/cmd.json +0 -8
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32/encrypted-payload.json +0 -42
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32/mongocryptd-reply.json +0 -50
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64/cmd.json +0 -8
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64/encrypted-field-map.json +0 -28
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64/encrypted-payload.json +0 -42
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64/mongocryptd-reply.json +0 -50
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double/encrypted-payload.json +0 -26
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double-precision/encrypted-payload.json +0 -26
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32/encrypted-payload.json +0 -26
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/encrypted-payload-v2.json +0 -26
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-openinterval/encrypted-payload.json +0 -16
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date/cmd.json +0 -13
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date/encrypted-field-map.json +0 -28
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date/encrypted-payload.json +0 -45
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date/mongocryptd-reply.json +0 -53
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128/cmd.json +0 -9
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128/encrypted-field-map.json +0 -28
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128/encrypted-payload.json +0 -45
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128/mongocryptd-reply.json +0 -53
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision/cmd.json +0 -9
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision/encrypted-field-map.json +0 -31
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision/encrypted-payload.json +0 -54
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision/mongocryptd-reply.json +0 -62
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double/cmd.json +0 -11
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double/encrypted-field-map.json +0 -28
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double/encrypted-payload.json +0 -45
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double/mongocryptd-reply.json +0 -53
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision/cmd.json +0 -11
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision/encrypted-field-map.json +0 -31
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision/encrypted-payload.json +0 -48
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision/mongocryptd-reply.json +0 -56
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32/encrypted-payload.json +0 -45
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32/mongocryptd-reply.json +0 -53
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64/cmd.json +0 -11
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64/encrypted-field-map.json +0 -28
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64/encrypted-payload.json +0 -45
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64/mongocryptd-reply.json +0 -53
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/encrypted-payload.json +0 -8
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/encrypted-payload.json +0 -8
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/encrypted-payload-v2.json +0 -8
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/encrypted-payload.json +0 -8
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed/cmd.json +0 -9
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed/encrypted-payload.json +0 -14
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed/mongocryptd-reply.json +0 -46
- data/ext/libmongocrypt/libmongocrypt/test/data/schema.json +0 -19
- /data/ext/libmongocrypt/libmongocrypt/test/data/{fle2-explicit/find-indexed.json → explicit-decrypt/FLE2FindEqualityPayload.json} +0 -0
- /data/ext/libmongocrypt/libmongocrypt/test/data/{fle2-insert → fle2-insert-text-search-with-str-encode-version}/cmd.json +0 -0
@@ -0,0 +1,95 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2024-present MongoDB, Inc.
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
#ifndef MONGOCRYPT_STR_ENCODE_STRING_SETS_PRIVATE_H
|
18
|
+
#define MONGOCRYPT_STR_ENCODE_STRING_SETS_PRIVATE_H
|
19
|
+
|
20
|
+
#include "mongocrypt-buffer-private.h"
|
21
|
+
#include "mongocrypt.h"
|
22
|
+
|
23
|
+
// Represents a valid unicode string with the bad character 0xFF appended to the end. This is our base string which
|
24
|
+
// we build substring trees on. Stores all the valid code points in the string, plus one code point for 0xFF.
|
25
|
+
// Exposed for testing.
|
26
|
+
typedef struct {
|
27
|
+
_mongocrypt_buffer_t buf;
|
28
|
+
uint32_t *codepoint_offsets;
|
29
|
+
uint32_t codepoint_len;
|
30
|
+
} mc_utf8_string_with_bad_char_t;
|
31
|
+
|
32
|
+
// Initialize by copying buffer into data and adding the bad character.
|
33
|
+
mc_utf8_string_with_bad_char_t *mc_utf8_string_with_bad_char_from_buffer(const char *buf, uint32_t len);
|
34
|
+
|
35
|
+
void mc_utf8_string_with_bad_char_destroy(mc_utf8_string_with_bad_char_t *utf8);
|
36
|
+
|
37
|
+
// Set of affixes of a shared base string. Does not do any duplicate prevention.
|
38
|
+
typedef struct _mc_affix_set_t mc_affix_set_t;
|
39
|
+
|
40
|
+
// Initialize affix set from base string and number of entries (this must be known as a prior).
|
41
|
+
mc_affix_set_t *mc_affix_set_new(const mc_utf8_string_with_bad_char_t *base_string, uint32_t n_indices);
|
42
|
+
|
43
|
+
void mc_affix_set_destroy(mc_affix_set_t *set);
|
44
|
+
|
45
|
+
// Insert affix into set. base_start/end_idx are codepoint indices. base_end_idx is exclusive. Returns true if
|
46
|
+
// inserted, false otherwise.
|
47
|
+
bool mc_affix_set_insert(mc_affix_set_t *set, uint32_t base_start_idx, uint32_t base_end_idx);
|
48
|
+
|
49
|
+
// Insert the base string count times into the set. Treated as a special case, since this is the only affix that
|
50
|
+
// will appear multiple times. Returns true if inserted, false otherwise.
|
51
|
+
bool mc_affix_set_insert_base_string(mc_affix_set_t *set, uint32_t count);
|
52
|
+
|
53
|
+
// Iterator on affix set.
|
54
|
+
typedef struct {
|
55
|
+
mc_affix_set_t *set;
|
56
|
+
uint32_t cur_idx;
|
57
|
+
} mc_affix_set_iter_t;
|
58
|
+
|
59
|
+
// Point the iterator to the first affix of the given set.
|
60
|
+
void mc_affix_set_iter_init(mc_affix_set_iter_t *it, mc_affix_set_t *set);
|
61
|
+
|
62
|
+
// Get the next affix, its length in bytes, and its count. Returns false if the set does not have a next element, true
|
63
|
+
// otherwise.
|
64
|
+
bool mc_affix_set_iter_next(mc_affix_set_iter_t *it, const char **str, uint32_t *byte_len, uint32_t *count);
|
65
|
+
|
66
|
+
// Set of substrings of a shared base string. Prevents duplicates.
|
67
|
+
typedef struct _mc_substring_set_t mc_substring_set_t;
|
68
|
+
|
69
|
+
mc_substring_set_t *mc_substring_set_new(const mc_utf8_string_with_bad_char_t *base_string);
|
70
|
+
|
71
|
+
void mc_substring_set_destroy(mc_substring_set_t *set);
|
72
|
+
|
73
|
+
// Insert the base string count times into the set. Treated as a special case, since this is the only substring that
|
74
|
+
// will appear multiple times. Always inserts successfully.
|
75
|
+
void mc_substring_set_increment_fake_string(mc_substring_set_t *set, uint32_t count);
|
76
|
+
|
77
|
+
// Insert substring into set. base_start/end_idx are codepoint indices. base_end_idx is exclusive. Returns true if
|
78
|
+
// inserted, false otherwise.
|
79
|
+
bool mc_substring_set_insert(mc_substring_set_t *set, uint32_t base_start_idx, uint32_t base_end_idx);
|
80
|
+
|
81
|
+
// Iterator on substring set.
|
82
|
+
typedef struct {
|
83
|
+
mc_substring_set_t *set;
|
84
|
+
void *cur_node;
|
85
|
+
uint32_t cur_idx;
|
86
|
+
} mc_substring_set_iter_t;
|
87
|
+
|
88
|
+
// Point the iterator to the first substring of the given set.
|
89
|
+
void mc_substring_set_iter_init(mc_substring_set_iter_t *it, mc_substring_set_t *set);
|
90
|
+
|
91
|
+
// Get the next substring, its length in bytes, and its count. Returns false if the set does not have a next element,
|
92
|
+
// true otherwise.
|
93
|
+
bool mc_substring_set_iter_next(mc_substring_set_iter_t *it, const char **str, uint32_t *byte_len, uint32_t *count);
|
94
|
+
|
95
|
+
#endif
|
@@ -0,0 +1,304 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2024-present MongoDB, Inc.
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
#include "mc-str-encode-string-sets-private.h"
|
18
|
+
#include "mongocrypt-buffer-private.h"
|
19
|
+
#include <bson/bson.h>
|
20
|
+
#include <stdint.h>
|
21
|
+
|
22
|
+
#define BAD_CHAR ((uint8_t)0xFF)
|
23
|
+
|
24
|
+
// Input must be pre-validated by bson_utf8_validate().
|
25
|
+
mc_utf8_string_with_bad_char_t *mc_utf8_string_with_bad_char_from_buffer(const char *buf, uint32_t len) {
|
26
|
+
BSON_ASSERT_PARAM(buf);
|
27
|
+
mc_utf8_string_with_bad_char_t *ret = bson_malloc0(sizeof(mc_utf8_string_with_bad_char_t));
|
28
|
+
_mongocrypt_buffer_init_size(&ret->buf, len + 1);
|
29
|
+
memcpy(ret->buf.data, buf, len);
|
30
|
+
ret->buf.data[len] = BAD_CHAR;
|
31
|
+
// max # offsets is the total length
|
32
|
+
ret->codepoint_offsets = bson_malloc0(sizeof(uint32_t) * (len + 1));
|
33
|
+
const char *cur = buf;
|
34
|
+
const char *end = buf + len;
|
35
|
+
ret->codepoint_len = 0;
|
36
|
+
while (cur < end) {
|
37
|
+
ret->codepoint_offsets[ret->codepoint_len++] = (uint32_t)(cur - buf);
|
38
|
+
cur = bson_utf8_next_char(cur);
|
39
|
+
}
|
40
|
+
// last codepoint points at the 0xFF at the end of the string
|
41
|
+
ret->codepoint_offsets[ret->codepoint_len++] = (uint32_t)(end - buf);
|
42
|
+
// realloc to save some space
|
43
|
+
ret->codepoint_offsets = bson_realloc(ret->codepoint_offsets, sizeof(uint32_t) * ret->codepoint_len);
|
44
|
+
return ret;
|
45
|
+
}
|
46
|
+
|
47
|
+
void mc_utf8_string_with_bad_char_destroy(mc_utf8_string_with_bad_char_t *utf8) {
|
48
|
+
if (!utf8) {
|
49
|
+
return;
|
50
|
+
}
|
51
|
+
bson_free(utf8->codepoint_offsets);
|
52
|
+
_mongocrypt_buffer_cleanup(&utf8->buf);
|
53
|
+
bson_free(utf8);
|
54
|
+
}
|
55
|
+
|
56
|
+
struct _mc_affix_set_t {
|
57
|
+
// base_string is not owned
|
58
|
+
const mc_utf8_string_with_bad_char_t *base_string;
|
59
|
+
uint32_t *start_indices;
|
60
|
+
uint32_t *end_indices;
|
61
|
+
// Store counts per substring. As we expect heavy duplication of the padding value, this will save some time when we
|
62
|
+
// hash later.
|
63
|
+
uint32_t *substring_counts;
|
64
|
+
uint32_t n_indices;
|
65
|
+
uint32_t cur_idx;
|
66
|
+
};
|
67
|
+
|
68
|
+
mc_affix_set_t *mc_affix_set_new(const mc_utf8_string_with_bad_char_t *base_string, uint32_t n_indices) {
|
69
|
+
BSON_ASSERT_PARAM(base_string);
|
70
|
+
mc_affix_set_t *set = (mc_affix_set_t *)bson_malloc0(sizeof(mc_affix_set_t));
|
71
|
+
set->base_string = base_string;
|
72
|
+
set->start_indices = (uint32_t *)bson_malloc0(sizeof(uint32_t) * n_indices);
|
73
|
+
set->end_indices = (uint32_t *)bson_malloc0(sizeof(uint32_t) * n_indices);
|
74
|
+
set->substring_counts = (uint32_t *)bson_malloc0(sizeof(uint32_t) * n_indices);
|
75
|
+
set->n_indices = n_indices;
|
76
|
+
return set;
|
77
|
+
}
|
78
|
+
|
79
|
+
void mc_affix_set_destroy(mc_affix_set_t *set) {
|
80
|
+
if (!set) {
|
81
|
+
return;
|
82
|
+
}
|
83
|
+
bson_free(set->start_indices);
|
84
|
+
bson_free(set->end_indices);
|
85
|
+
bson_free(set->substring_counts);
|
86
|
+
bson_free(set);
|
87
|
+
}
|
88
|
+
|
89
|
+
bool mc_affix_set_insert(mc_affix_set_t *set, uint32_t base_start_idx, uint32_t base_end_idx) {
|
90
|
+
BSON_ASSERT_PARAM(set);
|
91
|
+
if (base_start_idx > base_end_idx || base_end_idx >= set->base_string->codepoint_len
|
92
|
+
|| set->cur_idx >= set->n_indices) {
|
93
|
+
return false;
|
94
|
+
}
|
95
|
+
uint32_t idx = set->cur_idx++;
|
96
|
+
set->start_indices[idx] = base_start_idx;
|
97
|
+
set->end_indices[idx] = base_end_idx;
|
98
|
+
set->substring_counts[idx] = 1;
|
99
|
+
return true;
|
100
|
+
}
|
101
|
+
|
102
|
+
bool mc_affix_set_insert_base_string(mc_affix_set_t *set, uint32_t count) {
|
103
|
+
BSON_ASSERT_PARAM(set);
|
104
|
+
if (count == 0 || set->cur_idx >= set->n_indices) {
|
105
|
+
return false;
|
106
|
+
}
|
107
|
+
uint32_t idx = set->cur_idx++;
|
108
|
+
set->start_indices[idx] = 0;
|
109
|
+
set->end_indices[idx] = set->base_string->codepoint_len;
|
110
|
+
set->substring_counts[idx] = count;
|
111
|
+
return true;
|
112
|
+
}
|
113
|
+
|
114
|
+
void mc_affix_set_iter_init(mc_affix_set_iter_t *it, mc_affix_set_t *set) {
|
115
|
+
BSON_ASSERT_PARAM(it);
|
116
|
+
BSON_ASSERT_PARAM(set);
|
117
|
+
it->set = set;
|
118
|
+
it->cur_idx = 0;
|
119
|
+
}
|
120
|
+
|
121
|
+
bool mc_affix_set_iter_next(mc_affix_set_iter_t *it, const char **str, uint32_t *byte_len, uint32_t *count) {
|
122
|
+
BSON_ASSERT_PARAM(it);
|
123
|
+
if (it->cur_idx >= it->set->n_indices) {
|
124
|
+
return false;
|
125
|
+
}
|
126
|
+
uint32_t idx = it->cur_idx++;
|
127
|
+
uint32_t start_idx = it->set->start_indices[idx];
|
128
|
+
uint32_t end_idx = it->set->end_indices[idx];
|
129
|
+
uint32_t start_byte_offset = it->set->base_string->codepoint_offsets[start_idx];
|
130
|
+
// Pointing to the end of the codepoints represents the end of the string.
|
131
|
+
uint32_t end_byte_offset = it->set->base_string->buf.len;
|
132
|
+
if (end_idx != it->set->base_string->codepoint_len) {
|
133
|
+
end_byte_offset = it->set->base_string->codepoint_offsets[end_idx];
|
134
|
+
}
|
135
|
+
if (str) {
|
136
|
+
*str = (const char *)it->set->base_string->buf.data + start_byte_offset;
|
137
|
+
}
|
138
|
+
if (byte_len) {
|
139
|
+
*byte_len = end_byte_offset - start_byte_offset;
|
140
|
+
}
|
141
|
+
if (count) {
|
142
|
+
*count = it->set->substring_counts[idx];
|
143
|
+
}
|
144
|
+
return true;
|
145
|
+
}
|
146
|
+
|
147
|
+
// Linked list node in the hashset.
|
148
|
+
typedef struct _mc_substring_set_node_t {
|
149
|
+
uint32_t start_offset;
|
150
|
+
uint32_t byte_len;
|
151
|
+
struct _mc_substring_set_node_t *next;
|
152
|
+
} mc_substring_set_node_t;
|
153
|
+
|
154
|
+
static mc_substring_set_node_t *new_ssnode(uint32_t start_byte_offset, uint32_t byte_len) {
|
155
|
+
mc_substring_set_node_t *ret = (mc_substring_set_node_t *)bson_malloc0(sizeof(mc_substring_set_node_t));
|
156
|
+
ret->start_offset = start_byte_offset;
|
157
|
+
ret->byte_len = byte_len;
|
158
|
+
return ret;
|
159
|
+
}
|
160
|
+
|
161
|
+
static void mc_substring_set_node_destroy(mc_substring_set_node_t *node) {
|
162
|
+
if (!node) {
|
163
|
+
return;
|
164
|
+
}
|
165
|
+
bson_free(node);
|
166
|
+
}
|
167
|
+
|
168
|
+
// FNV-1a hash function
|
169
|
+
const uint32_t FNV1APRIME = 16777619;
|
170
|
+
const uint32_t FNV1ABASIS = 2166136261;
|
171
|
+
|
172
|
+
static uint32_t fnv1a(const uint8_t *data, uint32_t len) {
|
173
|
+
BSON_ASSERT_PARAM(data);
|
174
|
+
uint32_t hash = FNV1ABASIS;
|
175
|
+
const uint8_t *ptr = data;
|
176
|
+
while (ptr != data + len) {
|
177
|
+
hash = (hash ^ (uint32_t)(*ptr++)) * FNV1APRIME;
|
178
|
+
}
|
179
|
+
return hash;
|
180
|
+
}
|
181
|
+
|
182
|
+
// A reasonable default, balancing space with speed
|
183
|
+
#define HASHSET_SIZE 4096
|
184
|
+
|
185
|
+
struct _mc_substring_set_t {
|
186
|
+
// base_string is not owned
|
187
|
+
const mc_utf8_string_with_bad_char_t *base_string;
|
188
|
+
mc_substring_set_node_t *set[HASHSET_SIZE];
|
189
|
+
uint32_t base_string_count;
|
190
|
+
};
|
191
|
+
|
192
|
+
mc_substring_set_t *mc_substring_set_new(const mc_utf8_string_with_bad_char_t *base_string) {
|
193
|
+
BSON_ASSERT_PARAM(base_string);
|
194
|
+
mc_substring_set_t *set = (mc_substring_set_t *)bson_malloc0(sizeof(mc_substring_set_t));
|
195
|
+
set->base_string = base_string;
|
196
|
+
return set;
|
197
|
+
}
|
198
|
+
|
199
|
+
void mc_substring_set_destroy(mc_substring_set_t *set) {
|
200
|
+
if (!set) {
|
201
|
+
return;
|
202
|
+
}
|
203
|
+
for (int i = 0; i < HASHSET_SIZE; i++) {
|
204
|
+
mc_substring_set_node_t *node = set->set[i];
|
205
|
+
while (node) {
|
206
|
+
mc_substring_set_node_t *to_destroy = node;
|
207
|
+
node = node->next;
|
208
|
+
mc_substring_set_node_destroy(to_destroy);
|
209
|
+
}
|
210
|
+
}
|
211
|
+
bson_free(set);
|
212
|
+
}
|
213
|
+
|
214
|
+
void mc_substring_set_increment_fake_string(mc_substring_set_t *set, uint32_t count) {
|
215
|
+
BSON_ASSERT_PARAM(set);
|
216
|
+
set->base_string_count += count;
|
217
|
+
}
|
218
|
+
|
219
|
+
bool mc_substring_set_insert(mc_substring_set_t *set, uint32_t base_start_idx, uint32_t base_end_idx) {
|
220
|
+
BSON_ASSERT_PARAM(set);
|
221
|
+
BSON_ASSERT(base_start_idx <= base_end_idx);
|
222
|
+
BSON_ASSERT(base_end_idx <= set->base_string->codepoint_len);
|
223
|
+
uint32_t start_byte_offset = set->base_string->codepoint_offsets[base_start_idx];
|
224
|
+
uint32_t end_byte_offset = (base_end_idx == set->base_string->codepoint_len)
|
225
|
+
? set->base_string->buf.len
|
226
|
+
: set->base_string->codepoint_offsets[base_end_idx];
|
227
|
+
const uint8_t *start = set->base_string->buf.data + start_byte_offset;
|
228
|
+
uint32_t len = end_byte_offset - start_byte_offset;
|
229
|
+
uint32_t hash = fnv1a(start, len);
|
230
|
+
uint32_t idx = hash % HASHSET_SIZE;
|
231
|
+
mc_substring_set_node_t *node = set->set[idx];
|
232
|
+
if (node) {
|
233
|
+
// Traverse linked list to find match; if no match, insert at end of linked list.
|
234
|
+
mc_substring_set_node_t *prev;
|
235
|
+
while (node) {
|
236
|
+
prev = node;
|
237
|
+
if (len == node->byte_len && memcmp(start, set->base_string->buf.data + node->start_offset, len) == 0) {
|
238
|
+
// Match, no insertion
|
239
|
+
return false;
|
240
|
+
}
|
241
|
+
node = node->next;
|
242
|
+
}
|
243
|
+
// No matches, insert
|
244
|
+
prev->next = new_ssnode(start_byte_offset, len);
|
245
|
+
} else {
|
246
|
+
// Create new node and put it in hashset
|
247
|
+
set->set[idx] = new_ssnode(start_byte_offset, len);
|
248
|
+
}
|
249
|
+
return true;
|
250
|
+
}
|
251
|
+
|
252
|
+
void mc_substring_set_iter_init(mc_substring_set_iter_t *it, mc_substring_set_t *set) {
|
253
|
+
BSON_ASSERT_PARAM(it);
|
254
|
+
BSON_ASSERT_PARAM(set);
|
255
|
+
it->set = set;
|
256
|
+
it->cur_node = set->set[0];
|
257
|
+
it->cur_idx = 0;
|
258
|
+
}
|
259
|
+
|
260
|
+
bool mc_substring_set_iter_next(mc_substring_set_iter_t *it, const char **str, uint32_t *byte_len, uint32_t *count) {
|
261
|
+
BSON_ASSERT_PARAM(it);
|
262
|
+
if (it->cur_idx >= HASHSET_SIZE) {
|
263
|
+
// No next.
|
264
|
+
return false;
|
265
|
+
}
|
266
|
+
if (it->cur_node == NULL) {
|
267
|
+
it->cur_idx++;
|
268
|
+
// Next node is at another idx; iterate idx until we find a node.
|
269
|
+
while (it->cur_idx < HASHSET_SIZE && !it->set->set[it->cur_idx]) {
|
270
|
+
it->cur_idx++;
|
271
|
+
}
|
272
|
+
if (it->cur_idx >= HASHSET_SIZE) {
|
273
|
+
// Almost done with iteration; return base string if count is not 0.
|
274
|
+
if (it->set->base_string_count) {
|
275
|
+
if (count) {
|
276
|
+
*count = it->set->base_string_count;
|
277
|
+
}
|
278
|
+
if (str) {
|
279
|
+
*str = (const char *)it->set->base_string->buf.data;
|
280
|
+
}
|
281
|
+
if (byte_len) {
|
282
|
+
*byte_len = it->set->base_string->buf.len;
|
283
|
+
}
|
284
|
+
return true;
|
285
|
+
}
|
286
|
+
return false;
|
287
|
+
}
|
288
|
+
// Otherwise, we found a node; iterate to it.
|
289
|
+
it->cur_node = it->set->set[it->cur_idx];
|
290
|
+
}
|
291
|
+
mc_substring_set_node_t *cur = (mc_substring_set_node_t *)(it->cur_node);
|
292
|
+
// Count is always 1 for substrings in the hashset
|
293
|
+
if (count) {
|
294
|
+
*count = 1;
|
295
|
+
}
|
296
|
+
if (str) {
|
297
|
+
*str = (const char *)it->set->base_string->buf.data + cur->start_offset;
|
298
|
+
}
|
299
|
+
if (byte_len) {
|
300
|
+
*byte_len = cur->byte_len;
|
301
|
+
}
|
302
|
+
it->cur_node = (void *)cur->next;
|
303
|
+
return true;
|
304
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2024-present MongoDB, Inc.
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
#ifndef MONGOCRYPT_TEXT_SEARCH_STR_ENCODE_PRIVATE_H
|
18
|
+
#define MONGOCRYPT_TEXT_SEARCH_STR_ENCODE_PRIVATE_H
|
19
|
+
|
20
|
+
#include "mc-fle2-encryption-placeholder-private.h"
|
21
|
+
#include "mc-str-encode-string-sets-private.h"
|
22
|
+
#include "mongocrypt-status-private.h"
|
23
|
+
#include "mongocrypt.h"
|
24
|
+
|
25
|
+
// Result of a StrEncode. Contains the computed prefix, suffix, and substring trees, or NULL if empty, as well as the
|
26
|
+
// exact string.
|
27
|
+
typedef struct {
|
28
|
+
// Base string which the substring sets point to.
|
29
|
+
mc_utf8_string_with_bad_char_t *base_string;
|
30
|
+
// Set of encoded suffixes.
|
31
|
+
mc_affix_set_t *suffix_set;
|
32
|
+
// Set of encoded prefixes.
|
33
|
+
mc_affix_set_t *prefix_set;
|
34
|
+
// Set of encoded substrings.
|
35
|
+
mc_substring_set_t *substring_set;
|
36
|
+
// Encoded exact string.
|
37
|
+
_mongocrypt_buffer_t exact;
|
38
|
+
} mc_str_encode_sets_t;
|
39
|
+
|
40
|
+
// Run StrEncode with the given spec.
|
41
|
+
mc_str_encode_sets_t *mc_text_search_str_encode(const mc_FLE2TextSearchInsertSpec_t *spec, mongocrypt_status_t *status);
|
42
|
+
|
43
|
+
void mc_str_encode_sets_destroy(mc_str_encode_sets_t *sets);
|
44
|
+
|
45
|
+
#endif /* MONGOCRYPT_TEXT_SEARCH_STR_ENCODE_PRIVATE_H */
|
@@ -0,0 +1,248 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2024-present MongoDB, Inc.
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
#include "mc-str-encode-string-sets-private.h"
|
18
|
+
#include "mc-text-search-str-encode-private.h"
|
19
|
+
#include "mongocrypt-buffer-private.h"
|
20
|
+
#include "mongocrypt.h"
|
21
|
+
#include "unicode/fold.h"
|
22
|
+
#include <bson/bson.h>
|
23
|
+
#include <stdint.h>
|
24
|
+
|
25
|
+
// 16MiB - maximum length in bytes of a string to be encoded.
|
26
|
+
#define MAX_ENCODE_BYTE_LEN 16777216
|
27
|
+
// Number of bytes which are added to the base string before encryption.
|
28
|
+
#define OVERHEAD_BYTES 5
|
29
|
+
|
30
|
+
static mc_affix_set_t *generate_prefix_or_suffix_tree(const mc_utf8_string_with_bad_char_t *base_str,
|
31
|
+
uint32_t unfolded_byte_len,
|
32
|
+
uint32_t lb,
|
33
|
+
uint32_t ub,
|
34
|
+
bool is_prefix) {
|
35
|
+
BSON_ASSERT_PARAM(base_str);
|
36
|
+
// We encrypt (unfolded string + 5 bytes of extra BSON info) with a 16-byte block cipher.
|
37
|
+
uint32_t encrypted_len = 16 * (uint32_t)((unfolded_byte_len + OVERHEAD_BYTES + 15) / 16);
|
38
|
+
// Max len of a string that has this encrypted len.
|
39
|
+
uint32_t padded_len = encrypted_len - OVERHEAD_BYTES;
|
40
|
+
if (padded_len < lb) {
|
41
|
+
// No valid substrings, return empty tree
|
42
|
+
return NULL;
|
43
|
+
}
|
44
|
+
|
45
|
+
// Total number of substrings
|
46
|
+
uint32_t msize = BSON_MIN(padded_len, ub) - lb + 1;
|
47
|
+
uint32_t folded_codepoint_len = base_str->codepoint_len - 1; // remove one codepoint for 0xFF
|
48
|
+
uint32_t real_max_len = BSON_MIN(folded_codepoint_len, ub);
|
49
|
+
// Number of actual substrings, excluding padding
|
50
|
+
uint32_t real_substrings = real_max_len >= lb ? real_max_len - lb + 1 : 0;
|
51
|
+
// If real_substrings and msize differ, we need to insert padding, so allocate one extra slot.
|
52
|
+
uint32_t set_size = real_substrings == msize ? real_substrings : real_substrings + 1;
|
53
|
+
mc_affix_set_t *set = mc_affix_set_new(base_str, set_size);
|
54
|
+
uint32_t n_inserted = 0;
|
55
|
+
for (uint32_t i = lb; i < real_max_len + 1; i++, n_inserted++) {
|
56
|
+
if (is_prefix) {
|
57
|
+
// [0, lb), [0, lb + 1), ..., [0, min(len, ub))
|
58
|
+
BSON_ASSERT(mc_affix_set_insert(set, 0, i));
|
59
|
+
} else {
|
60
|
+
// [len - lb, len), [len - lb - 1, len), ..., [max(0, len - ub), len)
|
61
|
+
BSON_ASSERT(mc_affix_set_insert(set, folded_codepoint_len - i, folded_codepoint_len));
|
62
|
+
}
|
63
|
+
}
|
64
|
+
if (msize != real_substrings) {
|
65
|
+
// Insert padding to get to msize
|
66
|
+
BSON_ASSERT(mc_affix_set_insert_base_string(set, msize - real_substrings));
|
67
|
+
n_inserted++;
|
68
|
+
}
|
69
|
+
BSON_ASSERT(n_inserted == set_size);
|
70
|
+
return set;
|
71
|
+
}
|
72
|
+
|
73
|
+
static mc_affix_set_t *generate_suffix_tree(const mc_utf8_string_with_bad_char_t *base_str,
|
74
|
+
uint32_t unfolded_byte_len,
|
75
|
+
const mc_FLE2SuffixInsertSpec_t *spec) {
|
76
|
+
BSON_ASSERT_PARAM(base_str);
|
77
|
+
BSON_ASSERT_PARAM(spec);
|
78
|
+
return generate_prefix_or_suffix_tree(base_str, unfolded_byte_len, spec->lb, spec->ub, false);
|
79
|
+
}
|
80
|
+
|
81
|
+
static mc_affix_set_t *generate_prefix_tree(const mc_utf8_string_with_bad_char_t *base_str,
|
82
|
+
uint32_t unfolded_byte_len,
|
83
|
+
const mc_FLE2PrefixInsertSpec_t *spec) {
|
84
|
+
BSON_ASSERT_PARAM(base_str);
|
85
|
+
BSON_ASSERT_PARAM(spec);
|
86
|
+
return generate_prefix_or_suffix_tree(base_str, unfolded_byte_len, spec->lb, spec->ub, true);
|
87
|
+
}
|
88
|
+
|
89
|
+
static uint32_t calc_number_of_substrings(uint32_t strlen, uint32_t lb, uint32_t ub) {
|
90
|
+
// There are len - i + 1 substrings of length i in a length len string.
|
91
|
+
// Therefore, the total number of substrings with length between lb and ub
|
92
|
+
// is the sum of the integers inclusive between A = len - ub + 1 and B = len - lb + 1,
|
93
|
+
// A <= B. This has a closed form: (A + B)(B - A + 1)/2.
|
94
|
+
if (lb > strlen) {
|
95
|
+
return 0;
|
96
|
+
}
|
97
|
+
uint32_t largest_substr = BSON_MIN(strlen, ub);
|
98
|
+
uint32_t largest_substr_count = strlen - largest_substr + 1;
|
99
|
+
uint32_t smallest_substr_count = strlen - lb + 1;
|
100
|
+
return (largest_substr_count + smallest_substr_count) * (smallest_substr_count - largest_substr_count + 1) / 2;
|
101
|
+
}
|
102
|
+
|
103
|
+
static mc_substring_set_t *generate_substring_tree(const mc_utf8_string_with_bad_char_t *base_str,
|
104
|
+
uint32_t unfolded_byte_len,
|
105
|
+
const mc_FLE2SubstringInsertSpec_t *spec) {
|
106
|
+
BSON_ASSERT_PARAM(base_str);
|
107
|
+
BSON_ASSERT_PARAM(spec);
|
108
|
+
// We encrypt (unfolded string + 5 bytes of extra BSON info) with a 16-byte block cipher.
|
109
|
+
uint32_t encrypted_len = 16 * (uint32_t)((unfolded_byte_len + OVERHEAD_BYTES + 15) / 16);
|
110
|
+
// Max len of a string that has this encrypted len.
|
111
|
+
uint32_t padded_len = encrypted_len - OVERHEAD_BYTES;
|
112
|
+
if (padded_len < spec->lb) {
|
113
|
+
// No valid substrings, return empty tree
|
114
|
+
return NULL;
|
115
|
+
}
|
116
|
+
|
117
|
+
// If you are following along with the OST paper, a slightly different calculation of msize is used. The following
|
118
|
+
// justifies why that calculation and this calculation are equivalent.
|
119
|
+
// At this point, it is established that:
|
120
|
+
// beta <= mlen
|
121
|
+
// lb <= padded_len
|
122
|
+
// lb <= ub <= mlen
|
123
|
+
//
|
124
|
+
// So, the following formula for msize in the OST paper:
|
125
|
+
// maxkgram_1 = sum_(j=lb, ub, (mlen - j + 1))
|
126
|
+
// maxkgram_2 = sum_(j=lb, min(ub, padded_len), (padded_len - j + 1))
|
127
|
+
// msize = min(maxkgram_1, maxkgram_2)
|
128
|
+
// can be simplified to:
|
129
|
+
// msize = sum_(j=lb, min(ub, padded_len), (min(mlen, padded_len) - j + 1))
|
130
|
+
//
|
131
|
+
// because if padded_len <= ub, then it follows that padded_len <= ub <= mlen, and so
|
132
|
+
// maxkgram_1 = sum_(j=lb, ub, (mlen - j + 1)) # as above
|
133
|
+
// maxkgram_2 = sum_(j=lb, padded_len, (padded_len - j + 1)) # less or equal to maxkgram_1
|
134
|
+
// msize = maxkgram_2
|
135
|
+
// and if padded_len > ub, then it follows that:
|
136
|
+
// maxkgram_1 = sum_(j=lb, ub, (mlen - j + 1)) # as above
|
137
|
+
// maxkgram_2 = sum_(j=lb, ub, (padded_len - j + 1)) # same sum bounds as maxkgram_1
|
138
|
+
// msize = sum_(j=lb, ub, (min(mlen, padded_len) - j + 1))
|
139
|
+
// in both cases, msize can be rewritten as:
|
140
|
+
// msize = sum_(j=lb, min(ub, padded_len), (min(mlen, padded_len) - j + 1))
|
141
|
+
|
142
|
+
uint32_t folded_codepoint_len = base_str->codepoint_len - 1;
|
143
|
+
// If mlen < padded_len, we only need to pad to mlen
|
144
|
+
padded_len = BSON_MIN(spec->mlen, padded_len);
|
145
|
+
// Total number of substrings -- i.e. the number of valid substrings IF the string spanned the full padded length
|
146
|
+
uint32_t msize = calc_number_of_substrings(padded_len, spec->lb, spec->ub);
|
147
|
+
uint32_t n_real_substrings = 0;
|
148
|
+
mc_substring_set_t *set = mc_substring_set_new(base_str);
|
149
|
+
// If folded len < LB, there are no real substrings, so we can skip (avoiding underflow via folded len - LB)
|
150
|
+
if (folded_codepoint_len >= spec->lb) {
|
151
|
+
for (uint32_t i = 0; i < folded_codepoint_len - spec->lb + 1; i++) {
|
152
|
+
for (uint32_t j = i + spec->lb; j < BSON_MIN(folded_codepoint_len, i + spec->ub) + 1; j++) {
|
153
|
+
// Only count successful, i.e. non-duplicate inserts
|
154
|
+
if (mc_substring_set_insert(set, i, j)) {
|
155
|
+
n_real_substrings++;
|
156
|
+
}
|
157
|
+
}
|
158
|
+
}
|
159
|
+
}
|
160
|
+
if (msize != n_real_substrings) {
|
161
|
+
// Insert msize - n_real_substrings padding
|
162
|
+
BSON_ASSERT(msize > n_real_substrings);
|
163
|
+
mc_substring_set_increment_fake_string(set, msize - n_real_substrings);
|
164
|
+
}
|
165
|
+
return set;
|
166
|
+
}
|
167
|
+
|
168
|
+
static uint32_t mc_get_utf8_codepoint_length(const char *buf, uint32_t len) {
|
169
|
+
BSON_ASSERT_PARAM(buf);
|
170
|
+
const char *cur = buf;
|
171
|
+
const char *end = buf + len;
|
172
|
+
uint32_t codepoint_len = 0;
|
173
|
+
while (cur < end) {
|
174
|
+
cur = bson_utf8_next_char(cur);
|
175
|
+
codepoint_len++;
|
176
|
+
}
|
177
|
+
return codepoint_len;
|
178
|
+
}
|
179
|
+
|
180
|
+
mc_str_encode_sets_t *mc_text_search_str_encode(const mc_FLE2TextSearchInsertSpec_t *spec,
|
181
|
+
mongocrypt_status_t *status) {
|
182
|
+
BSON_ASSERT_PARAM(spec);
|
183
|
+
if (spec->len > MAX_ENCODE_BYTE_LEN) {
|
184
|
+
CLIENT_ERR("StrEncode: String passed in was too long: String was %u bytes, but max is %u bytes",
|
185
|
+
spec->len,
|
186
|
+
MAX_ENCODE_BYTE_LEN);
|
187
|
+
return NULL;
|
188
|
+
}
|
189
|
+
|
190
|
+
if (!bson_utf8_validate(spec->v, spec->len, false /* allow_null */)) {
|
191
|
+
CLIENT_ERR("StrEncode: String passed in was not valid UTF-8");
|
192
|
+
return NULL;
|
193
|
+
}
|
194
|
+
|
195
|
+
mc_utf8_string_with_bad_char_t *base_string;
|
196
|
+
if (spec->casef || spec->diacf) {
|
197
|
+
char *folded_str;
|
198
|
+
size_t folded_str_bytes_len;
|
199
|
+
if (!unicode_fold(spec->v,
|
200
|
+
spec->len,
|
201
|
+
(spec->casef * kUnicodeFoldToLower) | (spec->diacf * kUnicodeFoldRemoveDiacritics),
|
202
|
+
&folded_str,
|
203
|
+
&folded_str_bytes_len,
|
204
|
+
status)) {
|
205
|
+
return NULL;
|
206
|
+
}
|
207
|
+
base_string = mc_utf8_string_with_bad_char_from_buffer(folded_str, (uint32_t)folded_str_bytes_len);
|
208
|
+
bson_free(folded_str);
|
209
|
+
} else {
|
210
|
+
base_string = mc_utf8_string_with_bad_char_from_buffer(spec->v, spec->len);
|
211
|
+
}
|
212
|
+
|
213
|
+
mc_str_encode_sets_t *sets = bson_malloc0(sizeof(mc_str_encode_sets_t));
|
214
|
+
// Base string is the folded string plus the 0xFF character
|
215
|
+
sets->base_string = base_string;
|
216
|
+
if (spec->suffix.set) {
|
217
|
+
sets->suffix_set = generate_suffix_tree(sets->base_string, spec->len, &spec->suffix.value);
|
218
|
+
}
|
219
|
+
if (spec->prefix.set) {
|
220
|
+
sets->prefix_set = generate_prefix_tree(sets->base_string, spec->len, &spec->prefix.value);
|
221
|
+
}
|
222
|
+
if (spec->substr.set) {
|
223
|
+
uint32_t unfolded_codepoint_len = mc_get_utf8_codepoint_length(spec->v, spec->len);
|
224
|
+
if (unfolded_codepoint_len > spec->substr.value.mlen) {
|
225
|
+
CLIENT_ERR("StrEncode: String passed in was longer than the maximum length for substring indexing -- "
|
226
|
+
"String len: %u, max len: %u",
|
227
|
+
unfolded_codepoint_len,
|
228
|
+
spec->substr.value.mlen);
|
229
|
+
mc_str_encode_sets_destroy(sets);
|
230
|
+
return NULL;
|
231
|
+
}
|
232
|
+
sets->substring_set = generate_substring_tree(sets->base_string, spec->len, &spec->substr.value);
|
233
|
+
}
|
234
|
+
// Exact string is always equal to the base string up until the bad character
|
235
|
+
_mongocrypt_buffer_from_data(&sets->exact, sets->base_string->buf.data, (uint32_t)sets->base_string->buf.len - 1);
|
236
|
+
return sets;
|
237
|
+
}
|
238
|
+
|
239
|
+
void mc_str_encode_sets_destroy(mc_str_encode_sets_t *sets) {
|
240
|
+
if (!sets) {
|
241
|
+
return;
|
242
|
+
}
|
243
|
+
mc_utf8_string_with_bad_char_destroy(sets->base_string);
|
244
|
+
mc_affix_set_destroy(sets->suffix_set);
|
245
|
+
mc_affix_set_destroy(sets->prefix_set);
|
246
|
+
mc_substring_set_destroy(sets->substring_set);
|
247
|
+
bson_free(sets);
|
248
|
+
}
|