libmongocrypt-helper 1.7.4.0.1002 → 1.11.0.0.1001
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/libmongocrypt/libmongocrypt/CHANGELOG.md +40 -5
- data/ext/libmongocrypt/libmongocrypt/CMakeLists.txt +29 -24
- data/ext/libmongocrypt/libmongocrypt/CODEOWNERS +1 -4
- data/ext/libmongocrypt/libmongocrypt/Earthfile +522 -0
- data/ext/libmongocrypt/libmongocrypt/README.md +36 -40
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/CMakeLists.txt +1 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Driver.snk +0 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/AssemblyInfo.cs +2 -2
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Binary.cs +16 -2
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptClient.cs +25 -6
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptClientFactory.cs +8 -4
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Library.cs +35 -3
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/LibraryLoader.cs +81 -44
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/MongoDB.Libmongocrypt.csproj +2 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Example/MongoDB.Libmongocrypt.Example.csproj +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/BasicTests.cs +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/MongoDB.Libmongocrypt.Test.csproj +2 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test32/MongoDB.Libmongocrypt.Test32.csproj +2 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/README.md +3 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.cake +22 -26
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.config +3 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.sh +0 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/benchmarks/build.gradle.kts +28 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/benchmarks/src/main/java/com/mongodb/crypt/benchmark/BenchmarkRunner.java +217 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/benchmarks/src/main/resources/keyDocument.json +24 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/build.gradle.kts +22 -7
- 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 +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradlew +154 -108
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradlew.bat +7 -18
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/settings.gradle.kts +1 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CAPI.java +41 -6
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CAPIHelper.java +5 -5
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CipherCallback.java +27 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCryptImpl.java +34 -19
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoExplicitEncryptOptions.java +6 -4
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/resources/META-INF/native-image/jni-config.json +180 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/resources/META-INF/native-image/reflect-config.json +134 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/java/com/mongodb/crypt/capi/MongoCryptTest.java +50 -6
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit-v2/int32/encrypted-payload.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/{python/test/data/fle2-find-range-explicit → java/mongocrypt/src/test/resources/fle2-find-range-explicit-v2}/int32/rangeopts.json +3 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/README.md +4 -771
- data/ext/libmongocrypt/libmongocrypt/bindings/python/CHANGELOG.rst +86 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/README.rst +41 -20
- data/ext/libmongocrypt/libmongocrypt/bindings/python/RELEASE.rst +6 -24
- data/ext/libmongocrypt/libmongocrypt/bindings/python/build-manylinux-wheel.sh +4 -13
- data/ext/libmongocrypt/libmongocrypt/bindings/python/hatch_build.py +36 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/libmongocrypt-version.txt +1 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/__init__.py +2 -2
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/asynchronous/auto_encrypter.py +61 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/asynchronous/credentials.py +156 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/asynchronous/explicit_encrypter.py +156 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/asynchronous/state_machine.py +149 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/auto_encrypter.py +2 -46
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/binary.py +14 -17
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/binding.py +232 -296
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/compat.py +6 -31
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/credentials.py +2 -121
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/crypto.py +31 -20
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/errors.py +2 -2
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/explicit_encrypter.py +2 -233
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/mongocrypt.py +168 -254
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/options.py +265 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/state_machine.py +2 -141
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/synchronous/auto_encrypter.py +61 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/synchronous/credentials.py +156 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/synchronous/explicit_encrypter.py +156 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/synchronous/state_machine.py +149 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/version.py +2 -2
- data/ext/libmongocrypt/libmongocrypt/bindings/python/pyproject.toml +118 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/release.sh +97 -61
- data/ext/libmongocrypt/libmongocrypt/bindings/python/requirements-test.txt +7 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/requirements.txt +4 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/sbom.json +76 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/strip_header.py +6 -7
- data/ext/libmongocrypt/libmongocrypt/bindings/python/synchro.py +64 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/__init__.py +2 -10
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/collection-info.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/command.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/compact/success/encrypted-payload.json +21 -21
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/encrypted-command-reply.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/encrypted-field-config-map.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit-v2/int32/encrypted-payload.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit-v2/int32/rangeopts.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-document-azure.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-document-gcp.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-document.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-filter.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/list-collections-filter.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/mongocryptd-command.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/mongocryptd-reply.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/schema-map.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/performance/keyDocument.json +24 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/performance/perf_test.py +165 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_binding.py +8 -12
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_crypto.py +9 -11
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_mongocrypt.py +991 -343
- data/ext/libmongocrypt/libmongocrypt/bindings/python/update-sbom.sh +14 -0
- data/ext/libmongocrypt/libmongocrypt/cmake/FetchMongoC.cmake +19 -1
- data/ext/libmongocrypt/libmongocrypt/cmake/ImportBSON.cmake +31 -6
- data/ext/libmongocrypt/libmongocrypt/cmake/IntelDFP.cmake +20 -227
- data/ext/libmongocrypt/libmongocrypt/cmake/Patch.cmake +54 -0
- data/ext/libmongocrypt/libmongocrypt/cmake/Platform.cmake +50 -0
- data/ext/libmongocrypt/libmongocrypt/cmake/mongocrypt-config.cmake +21 -0
- data/ext/libmongocrypt/libmongocrypt/doc/img/cli-icon.png +0 -0
- data/ext/libmongocrypt/libmongocrypt/doc/img/reference-targets.png +0 -0
- data/ext/libmongocrypt/libmongocrypt/doc/releasing.md +153 -0
- data/ext/libmongocrypt/libmongocrypt/etc/c6-vault.repo +39 -0
- data/ext/libmongocrypt/libmongocrypt/etc/calc_release_version.py +61 -28
- data/ext/libmongocrypt/libmongocrypt/etc/calc_release_version_selftest.sh +73 -0
- data/ext/libmongocrypt/libmongocrypt/etc/cyclonedx.sbom.json +108 -0
- data/ext/libmongocrypt/libmongocrypt/etc/fle2_aead_generate_tests.py +15 -24
- data/ext/libmongocrypt/libmongocrypt/etc/fle2_crypto.py +66 -54
- data/ext/libmongocrypt/libmongocrypt/etc/fle2_generate_tests.py +14 -23
- data/ext/libmongocrypt/libmongocrypt/etc/fle2v2_aead_generate_tests.py +32 -0
- data/ext/libmongocrypt/libmongocrypt/etc/format-all.sh +12 -0
- data/ext/libmongocrypt/libmongocrypt/etc/format.sh +16 -0
- data/ext/libmongocrypt/libmongocrypt/etc/install-package.sh +48 -0
- data/ext/libmongocrypt/libmongocrypt/etc/libbson-remove-GCC-diagnostic-pragma.patch +27 -0
- data/ext/libmongocrypt/libmongocrypt/etc/mongo-inteldfp-alpine-arm-fix.patch +17 -0
- data/ext/libmongocrypt/libmongocrypt/etc/mongo-inteldfp-libmongocrypt-pr-625.patch +13 -0
- data/ext/libmongocrypt/libmongocrypt/etc/packager.py +120 -91
- data/ext/libmongocrypt/libmongocrypt/etc/purls.txt +14 -0
- data/ext/libmongocrypt/libmongocrypt/etc/repo_config.yaml +56 -0
- data/ext/libmongocrypt/libmongocrypt/etc/silk-create-asset-group.sh +70 -0
- data/ext/libmongocrypt/libmongocrypt/etc/ssdlc_compliance_report.md +37 -0
- data/ext/libmongocrypt/libmongocrypt/etc/third_party_vulnerabilities.md +42 -0
- data/ext/libmongocrypt/libmongocrypt/integrating.md +18 -1
- data/ext/libmongocrypt/libmongocrypt/kms-message/CMakeLists.txt +11 -3
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_gcp_request.c +1 -1
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_reader_writer.c +17 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_reader_writer_private.h +6 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_request.c +211 -1
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_response.c +163 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_tag_type_private.h +2 -1
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_kmip_request.h +17 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_kmip_response.h +6 -0
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_port.c +3 -2
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request.c +4 -2
- data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request_str.c +2 -2
- data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kmip_reader_writer.c +23 -2
- data/ext/libmongocrypt/libmongocrypt/src/crypto/cng.c +381 -436
- data/ext/libmongocrypt/libmongocrypt/src/crypto/commoncrypto.c +162 -227
- data/ext/libmongocrypt/libmongocrypt/src/crypto/libcrypto.c +183 -248
- data/ext/libmongocrypt/libmongocrypt/src/crypto/none.c +33 -55
- data/ext/libmongocrypt/libmongocrypt/src/csfle-markup.cpp +175 -205
- data/ext/libmongocrypt/libmongocrypt/src/mc-array-private.h +10 -21
- data/ext/libmongocrypt/libmongocrypt/src/mc-array.c +44 -56
- data/ext/libmongocrypt/libmongocrypt/src/mc-check-conversions-private.h +4 -8
- data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.h +351 -463
- data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.test.cpp +59 -66
- data/ext/libmongocrypt/libmongocrypt/src/mc-efc-private.h +21 -11
- data/ext/libmongocrypt/libmongocrypt/src/mc-efc.c +175 -99
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle-blob-subtype-private.h +18 -10
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder-private.h +69 -70
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder.c +445 -439
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-private-v2.h +41 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-private.h +11 -18
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-v2.c +135 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload.c +109 -126
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-private-v2.h +103 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-private.h +28 -31
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-v2.c +173 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload.c +106 -125
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-private-v2.h +130 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-private.h +36 -44
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-v2.c +382 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload.c +237 -278
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-private-v2.h +133 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-private.h +67 -56
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-v2.c +437 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev.c +454 -325
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-common-private.h +69 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-common.c +182 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-private.h +23 -31
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-v2-private.h +85 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-v2.c +142 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev.c +104 -231
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-range-operator-private.h +8 -7
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds-private.h +56 -56
- data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds.c +520 -580
- data/ext/libmongocrypt/libmongocrypt/src/mc-optional-private.h +47 -66
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation-private.h +67 -76
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation.c +201 -190
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding-private.h +55 -42
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding.c +809 -558
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-generator.template.h +177 -201
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-private.h +54 -53
- data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover.c +188 -240
- data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts-private.h +43 -35
- data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts.c +484 -337
- data/ext/libmongocrypt/libmongocrypt/src/mc-reader-private.h +36 -71
- data/ext/libmongocrypt/libmongocrypt/src/mc-reader.c +111 -164
- data/ext/libmongocrypt/libmongocrypt/src/mc-tokens-private.h +87 -65
- data/ext/libmongocrypt/libmongocrypt/src/mc-tokens.c +153 -125
- data/ext/libmongocrypt/libmongocrypt/src/mc-writer-private.h +66 -0
- data/ext/libmongocrypt/libmongocrypt/src/mc-writer.c +141 -0
- data/ext/libmongocrypt/libmongocrypt/src/mlib/check.hpp +37 -55
- data/ext/libmongocrypt/libmongocrypt/src/mlib/endian.h +11 -11
- data/ext/libmongocrypt/libmongocrypt/src/mlib/error.h +27 -32
- data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.h +461 -499
- data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.test.cpp +256 -334
- data/ext/libmongocrypt/libmongocrypt/src/mlib/macros.h +4 -5
- data/ext/libmongocrypt/libmongocrypt/src/mlib/path.h +196 -231
- data/ext/libmongocrypt/libmongocrypt/src/mlib/path.test.c +56 -79
- data/ext/libmongocrypt/libmongocrypt/src/mlib/str.h +411 -530
- data/ext/libmongocrypt/libmongocrypt/src/mlib/str.test.c +116 -131
- data/ext/libmongocrypt/libmongocrypt/src/mlib/thread.h +17 -26
- data/ext/libmongocrypt/libmongocrypt/src/mlib/user-check.h +2 -2
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-binary-private.h +1 -9
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-binary.c +31 -48
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-buffer-private.h +55 -131
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-buffer.c +442 -565
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-collinfo-private.h +1 -2
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-collinfo.c +28 -45
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-key-private.h +11 -17
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-key.c +104 -132
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-oauth-private.h +16 -24
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-oauth.c +110 -93
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-private.h +26 -45
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache.c +220 -273
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ciphertext-private.h +13 -25
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ciphertext.c +147 -166
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-compat.h +2 -2
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto-private.h +110 -204
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto.c +1145 -1567
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-datakey.c +510 -476
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-decrypt.c +817 -694
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-encrypt.c +2775 -2697
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-private.h +189 -184
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-rewrap-many-datakey.c +308 -351
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx.c +990 -1139
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-dll-private.h +23 -24
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endian-private.h +44 -58
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endpoint-private.h +21 -25
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endpoint.c +167 -181
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kek-private.h +42 -44
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kek.c +292 -272
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker-private.h +70 -110
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker.c +1010 -1033
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-private.h +27 -44
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key.c +349 -402
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx-private.h +127 -120
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx.c +1692 -1611
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-log-private.h +35 -67
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-log.c +49 -83
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking-private.h +31 -36
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking.c +1923 -1479
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-mutex-private.h +7 -12
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts-private.h +124 -107
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts.c +925 -419
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-private.h +99 -122
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-status-private.h +3 -8
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-status.c +92 -119
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-traverse-util-private.h +19 -29
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-traverse-util.c +136 -176
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-util-private.h +11 -21
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-util.c +98 -136
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.c +924 -1339
- data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.h +199 -313
- data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_dll.c +83 -79
- data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_mutex.c +20 -28
- data/ext/libmongocrypt/libmongocrypt/src/os_win/os_dll.c +64 -73
- data/ext/libmongocrypt/libmongocrypt/src/os_win/os_mutex.c +8 -16
- data/ext/libmongocrypt/libmongocrypt/test/crypt_shared-stub.cpp +57 -87
- data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/bypassQueryAnalysis/payload.json +53 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/jsonSchema/cmd-to-mongocryptd.json +23 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/jsonSchema/cmd.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/cmd-to-mongocryptd.json +50 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/cmd.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/collinfo.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/encrypted-field-map.json +24 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/encrypted-payload-pattern.json +53 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/mongocryptd-reply.json +62 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/unencrypted/cmd-to-mongocryptd.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/unencrypted/cmd.json +17 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/unencrypted/mongocryptd-reply.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/unencrypted/payload.json +21 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/missing-key-id/collinfo.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/no-fields/collinfo.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/no-fields/encrypted-payload.json +4 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/cmd.json +1 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/collinfo.json +63 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/encrypted-field-config-map.json +61 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/encrypted-payload-range-v2.json +37 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/encrypted-payload.json +29 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/anchor-pad/cmd.json +1 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/anchor-pad/collinfo.json +64 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/anchor-pad/encrypted-payload-range-v2.json +105 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/anchor-pad/encrypted-payload.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-range/cmd.json +1 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-range/collinfo.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-range/encrypted-field-config-map.json +47 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-range/encrypted-payload.json +23 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/collinfo.json +15 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-field-config-map.json +10 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-payload-range-v2.json +104 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-payload.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/encrypted-payload-v2.json +60 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/encrypted-payload-v2.json +67 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-csfle/collinfo.json +4 -4
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-csfle/encrypted-payload.json +5 -5
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/find-indexed-contentionFactor1-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/find-indexed-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-contentionFactor1-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-same-user-and-index-key-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/cmd.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/encrypted-field-map.json +22 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/encrypted-payload.json +40 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/mongocryptd-reply.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/cmd.json +10 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/encrypted-payload.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/mongocryptd-reply.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/cmd.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/encrypted-field-map.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/encrypted-payload.json +50 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/mongocryptd-reply.json +58 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/cmd.json +6 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/encrypted-payload.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/mongocryptd-reply.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/encrypted-field-map.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/encrypted-payload.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/mongocryptd-reply.json +52 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/encrypted-payload.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/mongocryptd-reply.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/encrypted-payload.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/mongocryptd-reply.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/encrypted-payload.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/mongocryptd-reply.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double/encrypted-payload-v2.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double-precision/encrypted-payload-v2.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32/encrypted-payload-v2.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/encrypted-payload-v2.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-openinterval/encrypted-payload-v2.json +16 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert/cmd.json +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date/RNG_DATA.h +65 -65
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/cmd.json +13 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/encrypted-payload.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/mongocryptd-reply.json +52 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128/RNG_DATA.h +132 -132
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision/RNG_DATA.h +71 -71
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/cmd.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/encrypted-field-map.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/encrypted-payload.json +53 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/mongocryptd-reply.json +61 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/cmd.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/encrypted-payload.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/mongocryptd-reply.json +52 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double/RNG_DATA.h +68 -68
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision/RNG_DATA.h +19 -19
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/encrypted-field-map.json +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/encrypted-payload.json +47 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/mongocryptd-reply.json +55 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/encrypted-payload.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/mongocryptd-reply.json +52 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32/RNG_DATA.h +25 -25
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/encrypted-payload.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/mongocryptd-reply.json +52 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64/RNG_DATA.h +65 -65
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/encrypted-field-map.json +27 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/encrypted-payload.json +44 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/mongocryptd-reply.json +52 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/RNG_DATA.h +68 -68
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/encrypted-payload-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/RNG_DATA.h +19 -19
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/encrypted-payload-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/RNG_DATA.h +25 -25
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/encrypted-payload-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/encrypted-payload-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/RNG_DATA.h +15 -15
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/encrypted-payload-v2.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/cmd.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/encrypted-field-map.json +18 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/encrypted-payload.json +14 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/mongocryptd-reply.json +41 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/cmd.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/encrypted-field-map.json +22 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/encrypted-payload.json +39 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/mongocryptd-reply.json +49 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/iev-v2/FLECrudTest-insertOneRangeV2.json +10 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/iev-v2/FLECrudTest-insertOneV2.json +10 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/kms-azure/decrypt-response.txt +16 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/kms-azure/encrypt-response.txt +16 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/kms-azure/oauth-response.txt +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/find/cmd.json +9 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/find/encrypted-field-map.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/find/encrypted-payload.json +62 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/find/mongocryptd-reply.json +69 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/insert/cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/insert/encrypted-field-map.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/insert/encrypted-payload.json +40 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/insert/mongocryptd-reply.json +47 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_decimal128.cstruct +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_double.cstruct +8637 -7958
- data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_int32.cstruct +5522 -1382
- data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_int64.cstruct +5042 -1262
- data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_decimal128.cstruct +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_decimal128_precision.cstruct +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_double.cstruct +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_double_precision.cstruct +2 -2
- data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_int32.cstruct +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_int64.cstruct +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-find-int32/cmd.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-find-int32/encrypted-field-map.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-find-int32/encrypted-payload.json +53 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-find-int32/mongocryptd-reply.json +58 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-insert-int32/cmd.json +11 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-insert-int32/encrypted-field-map.json +19 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-insert-int32/encrypted-payload.json +40 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-insert-int32/mongocryptd-reply.json +45 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-find-int32/expected.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-find-int32/to-encrypt.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-find-int32-defaults/expected.json +26 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-find-int32-defaults/to-encrypt.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-insert-double/expected.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-insert-int32/expected.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-insert-int32-defaults/expected.json +8 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/README.md +17 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/aes-ctr.json +29 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2-fixed.json +10 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2-generated.json +38 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2aead-decrypt.json +35 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2aead-fixed.json +29 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2aead-generated.json +122 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2v2-aead-fixed.json +29 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2v2-aead-generated.json +122 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/mcgrew.json +12 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/nist.json +20 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/tokens/README.md +30 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/tokens/mc.json +25 -0
- data/ext/libmongocrypt/libmongocrypt/test/data/tokens/server.json +25 -0
- data/ext/libmongocrypt/libmongocrypt/test/example-no-bson.c +4 -4
- data/ext/libmongocrypt/libmongocrypt/test/example-state-machine.c +279 -323
- data/ext/libmongocrypt/libmongocrypt/test/fuzz_kms.c +8 -7
- data/ext/libmongocrypt/libmongocrypt/test/test-dll.cpp +6 -7
- data/ext/libmongocrypt/libmongocrypt/test/test-gcp-auth.c +221 -283
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-efc.c +60 -73
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-find-equality-payload-v2.c +78 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-find-range-payload-v2.c +129 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iev-v2.c +248 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iev.c +467 -414
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup-v2.c +248 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup.c +141 -159
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-uev-v2.c +338 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-uev.c +238 -176
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-rfds.c +373 -474
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-edge-generation.c +421 -388
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-encoding.c +974 -825
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-mincover.c +499 -481
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-rangeopts.c +312 -148
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-reader.c +124 -207
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-tokens.c +249 -213
- data/ext/libmongocrypt/libmongocrypt/test/test-mc-writer.c +176 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.c +632 -808
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.h +22 -2
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert.h +168 -189
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-buffer.c +187 -211
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cache-oauth.c +118 -37
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cache.c +210 -233
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ciphertext.c +185 -220
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cleanup.c +374 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-compact.c +410 -445
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-hooks.c +798 -812
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.c +142 -135
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.h +70 -71
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto.c +394 -846
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-csfle-lib.c +159 -183
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-decrypt.c +870 -1045
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-encrypt.c +5183 -4717
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-rewrap-many-datakey.c +750 -964
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-setopt.c +1093 -1178
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-datakey.c +348 -420
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-dll.c +23 -30
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-endpoint.c +98 -111
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kek.c +49 -52
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key-broker.c +770 -920
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key-cache.c +354 -407
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key.c +197 -245
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kms-ctx.c +705 -368
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kms-responses.c +147 -166
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-local-kms.c +50 -61
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-log.c +85 -100
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-marking.c +1073 -690
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-opts.c +42 -0
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-status.c +46 -58
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-traverse-util.c +381 -451
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-util.c +55 -67
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-util.h +7 -10
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.c +879 -918
- data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.h +119 -169
- data/ext/libmongocrypt/libmongocrypt/test/test-named-kms-providers.c +2381 -0
- data/ext/libmongocrypt/libmongocrypt/test/util/HELP.autogen +3 -1
- data/ext/libmongocrypt/libmongocrypt/test/util/README.md +1 -0
- data/ext/libmongocrypt/libmongocrypt/test/util/csfle.c +512 -559
- data/ext/libmongocrypt/libmongocrypt/test/util/make_includes.py +1 -1
- data/ext/libmongocrypt/libmongocrypt/test/util/util.c +771 -882
- data/ext/libmongocrypt/libmongocrypt/test/util/util.h +33 -55
- data/lib/libmongocrypt_helper/version.rb +2 -2
- metadata +245 -111
- checksums.yaml.gz.sig +0 -0
- data/ext/libmongocrypt/libmongocrypt/VERSION_CURRENT +0 -1
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit/int32/encrypted-payload.json +0 -26
- data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit/int32/key-document.json +0 -0
- data/ext/libmongocrypt/libmongocrypt/bindings/node/CHANGELOG.md +0 -81
- data/ext/libmongocrypt/libmongocrypt/bindings/node/LICENSE +0 -201
- data/ext/libmongocrypt/libmongocrypt/bindings/node/binding.gyp +0 -79
- data/ext/libmongocrypt/libmongocrypt/bindings/node/etc/README.hbs +0 -44
- data/ext/libmongocrypt/libmongocrypt/bindings/node/etc/build-static.sh +0 -39
- data/ext/libmongocrypt/libmongocrypt/bindings/node/index.d.ts +0 -515
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/autoEncrypter.js +0 -420
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/buffer_pool.js +0 -123
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/clientEncryption.js +0 -699
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/common.js +0 -100
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/credentialsProvider.js +0 -33
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/cryptoCallbacks.js +0 -87
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/index.js +0 -42
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/mongocryptdManager.js +0 -66
- data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/stateMachine.js +0 -487
- data/ext/libmongocrypt/libmongocrypt/bindings/node/package-lock.json +0 -16051
- data/ext/libmongocrypt/libmongocrypt/bindings/node/package.json +0 -81
- data/ext/libmongocrypt/libmongocrypt/bindings/node/src/mongocrypt.cc +0 -929
- data/ext/libmongocrypt/libmongocrypt/bindings/node/src/mongocrypt.h +0 -114
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/autoEncrypter.test.js +0 -953
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/buffer_pool.test.js +0 -91
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/clientEncryption.test.js +0 -701
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/credentialsProvider.test.js +0 -163
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/cryptoCallbacks.test.js +0 -284
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/README.md +0 -5
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/cmd.json +0 -6
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/collection-info.json +0 -37
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/encrypted-document-nested.json +0 -8
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/encrypted-document.json +0 -11
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/encryptedFields.json +0 -30
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/key-document.json +0 -32
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/key1-document.json +0 -30
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/mongocryptd-reply.json +0 -18
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/mongocryptdManager.test.js +0 -48
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/release.test.js +0 -59
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/requirements.helper.js +0 -29
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/stateMachine.test.js +0 -331
- data/ext/libmongocrypt/libmongocrypt/bindings/node/test/tools/mongodb_reporter.js +0 -325
- data/ext/libmongocrypt/libmongocrypt/bindings/python/setup.py +0 -84
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit/int32/encrypted-payload.json +0 -26
- data/ext/libmongocrypt/libmongocrypt/bindings/python/test-requirements.txt +0 -12
- data/ext/libmongocrypt/libmongocrypt/debian/build_snapshot.sh +0 -79
- data/ext/libmongocrypt/libmongocrypt/debian/changelog +0 -105
- data/ext/libmongocrypt/libmongocrypt/debian/compat +0 -1
- data/ext/libmongocrypt/libmongocrypt/debian/control +0 -41
- data/ext/libmongocrypt/libmongocrypt/debian/copyright +0 -129
- data/ext/libmongocrypt/libmongocrypt/debian/gbp.conf +0 -23
- data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt-dev.dirs +0 -2
- data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt-dev.install +0 -5
- data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt0.dirs +0 -1
- data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt0.install +0 -1
- data/ext/libmongocrypt/libmongocrypt/debian/rules +0 -46
- data/ext/libmongocrypt/libmongocrypt/debian/source/format +0 -1
- data/ext/libmongocrypt/libmongocrypt/debian/source/lintian-overrides +0 -3
- data/ext/libmongocrypt/libmongocrypt/debian/source/options +0 -1
- data/ext/libmongocrypt/libmongocrypt/debian/watch +0 -3
- data/ext/libmongocrypt/libmongocrypt/test/data/aes-ctr.cstructs +0 -359
- data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/mongocryptd-reply.json +0 -72
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-aead.cstructs +0 -109
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/encrypted-payload.json +0 -26
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/rangeopts.json +0 -5
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/RNG_DATA.h +0 -70
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/encrypted-payload.json +0 -8
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/rangeopts.json +0 -5
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/value-to-encrypt.json +0 -5
- data/ext/libmongocrypt/libmongocrypt/test/data/fle2.cstructs +0 -33
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -0
- /data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/{fle2-find-range-explicit → fle2-find-range-explicit-v2}/int32/key-filter.json +0 -0
- /data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/{fle2-find-range-explicit → fle2-find-range-explicit-v2}/int32/value-to-encrypt.json +0 -0
- /data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/{fle2-find-range-explicit → fle2-find-range-explicit-v2}/int32/value-to-encrypt.json +0 -0
- /data/ext/libmongocrypt/libmongocrypt/bindings/{java/mongocrypt/src/test/resources/fle2-find-range-explicit → python/test/data/fle2-find-rangePreview-explicit}/int32/rangeopts.json +0 -0
- /data/ext/libmongocrypt/libmongocrypt/{test/data/fle2-find-range-explicit/int32-nominmax → bindings/python/test/data/fle2-find-rangePreview-explicit/int32}/value-to-encrypt.json +0 -0
- /data/ext/libmongocrypt/libmongocrypt/{bindings/node/test/data/kms-decrypt-reply.txt → test/data/kms-aws/decrypt-response.txt} +0 -0
- /data/ext/libmongocrypt/libmongocrypt/{bindings/node/test/data/kms-encrypt-reply.txt → test/data/kms-aws/encrypt-response.txt} +0 -0
- /data/ext/libmongocrypt/libmongocrypt/test/data/{gcp-auth → kms-gcp}/decrypt-response.txt +0 -0
- /data/ext/libmongocrypt/libmongocrypt/test/data/{gcp-auth → kms-gcp}/encrypt-response.txt +0 -0
- /data/ext/libmongocrypt/libmongocrypt/test/data/{gcp-auth → kms-gcp}/oauth-response.txt +0 -0
@@ -16,594 +16,612 @@
|
|
16
16
|
|
17
17
|
#include "test-mongocrypt.h"
|
18
18
|
|
19
|
+
#include "mc-array-private.h"
|
19
20
|
#include "mc-check-conversions-private.h"
|
20
21
|
#include "mc-optional-private.h"
|
22
|
+
#include "mc-range-encoding-private.h"
|
21
23
|
#include "mc-range-mincover-private.h"
|
22
|
-
#include "mc-array-private.h"
|
23
|
-
|
24
24
|
|
25
25
|
enum {
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
/// Why this number? The Decimal128 tests generate thousands of test strings,
|
27
|
+
/// but we can't set this arbitrarily high, since we'll bump up on stack
|
28
|
+
/// overflow on MSVC. This is large enough to capture all strings in all
|
29
|
+
/// Decimal128 tests without overflowing the stack.
|
30
|
+
MAX_MINCOVER_STRINGS = 4500
|
31
31
|
};
|
32
32
|
|
33
33
|
typedef struct {
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
34
|
+
int32_t lowerBound;
|
35
|
+
bool includeLowerBound;
|
36
|
+
int32_t upperBound;
|
37
|
+
bool includeUpperBound;
|
38
|
+
mc_optional_int32_t min;
|
39
|
+
mc_optional_int32_t max;
|
40
|
+
size_t sparsity;
|
41
|
+
uint32_t trimFactor;
|
42
|
+
const char *expectMincoverStrings[MAX_MINCOVER_STRINGS];
|
43
|
+
const char *expectError;
|
43
44
|
} Int32Test;
|
44
45
|
|
45
46
|
typedef struct {
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
47
|
+
int64_t lowerBound;
|
48
|
+
bool includeLowerBound;
|
49
|
+
int64_t upperBound;
|
50
|
+
bool includeUpperBound;
|
51
|
+
mc_optional_int64_t min;
|
52
|
+
mc_optional_int64_t max;
|
53
|
+
size_t sparsity;
|
54
|
+
const char *expectMincoverStrings[MAX_MINCOVER_STRINGS];
|
55
|
+
const char *expectError;
|
55
56
|
} Int64Test;
|
56
57
|
|
57
58
|
typedef struct {
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
59
|
+
double lowerBound;
|
60
|
+
bool includeLowerBound;
|
61
|
+
double upperBound;
|
62
|
+
bool includeUpperBound;
|
63
|
+
size_t sparsity;
|
64
|
+
mc_optional_double_t min;
|
65
|
+
mc_optional_double_t max;
|
66
|
+
mc_optional_int32_t precision;
|
67
|
+
const char *expectMincoverStrings[MAX_MINCOVER_STRINGS];
|
68
|
+
const char *expectError;
|
68
69
|
} DoubleTest;
|
69
70
|
|
70
71
|
#if MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
71
72
|
typedef struct {
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
73
|
+
mc_dec128 lowerBound;
|
74
|
+
bool includeLowerBound;
|
75
|
+
mc_dec128 upperBound;
|
76
|
+
bool includeUpperBound;
|
77
|
+
size_t sparsity;
|
78
|
+
mc_optional_dec128_t min;
|
79
|
+
mc_optional_dec128_t max;
|
80
|
+
mc_optional_int32_t precision;
|
81
|
+
const char *expectMincoverStrings[MAX_MINCOVER_STRINGS];
|
82
|
+
const char *expectError;
|
82
83
|
} Decimal128Test;
|
83
84
|
#endif
|
84
85
|
|
85
86
|
typedef struct _test_getMincover_args {
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
const char *const *(*expectMincoverStrings) (void *tests, size_t idx);
|
91
|
-
void (*dump) (void *tests, size_t idx, mc_mincover_t *got);
|
87
|
+
mc_mincover_t *(*getMincover)(void *tests, size_t idx, mongocrypt_status_t *status);
|
88
|
+
const char *(*expectError)(void *tests, size_t idx);
|
89
|
+
const char *const *(*expectMincoverStrings)(void *tests, size_t idx);
|
90
|
+
void (*dump)(void *tests, size_t idx, mc_mincover_t *got);
|
92
91
|
} _test_getMincover_args;
|
93
92
|
|
94
|
-
static mc_mincover_t *
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
93
|
+
static mc_mincover_t *_test_getMincover32(void *tests, size_t idx, mongocrypt_status_t *status) {
|
94
|
+
BSON_ASSERT_PARAM(tests);
|
95
|
+
|
96
|
+
Int32Test *test = (Int32Test *)tests + idx;
|
97
|
+
|
98
|
+
const bool use_range_v2 = true;
|
99
|
+
return mc_getMincoverInt32((mc_getMincoverInt32_args_t){.lowerBound = test->lowerBound,
|
100
|
+
.includeLowerBound = test->includeLowerBound,
|
101
|
+
.upperBound = test->upperBound,
|
102
|
+
.includeUpperBound = test->includeUpperBound,
|
103
|
+
.min = test->min,
|
104
|
+
.max = test->max,
|
105
|
+
.sparsity = test->sparsity,
|
106
|
+
.trimFactor = OPT_I32(test->trimFactor)},
|
107
|
+
status,
|
108
|
+
use_range_v2);
|
110
109
|
}
|
111
110
|
|
112
|
-
static mc_mincover_t *
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
111
|
+
static mc_mincover_t *_test_getMincover64(void *tests, size_t idx, mongocrypt_status_t *status) {
|
112
|
+
BSON_ASSERT_PARAM(tests);
|
113
|
+
|
114
|
+
const bool use_range_v2 = true;
|
115
|
+
const uint32_t trimFactor = 0; // At present, all test cases expect trimFactor=0.
|
116
|
+
Int64Test *const test = (Int64Test *)tests + idx;
|
117
|
+
|
118
|
+
return mc_getMincoverInt64((mc_getMincoverInt64_args_t){.lowerBound = test->lowerBound,
|
119
|
+
.includeLowerBound = test->includeLowerBound,
|
120
|
+
.upperBound = test->upperBound,
|
121
|
+
.includeUpperBound = test->includeUpperBound,
|
122
|
+
.min = test->min,
|
123
|
+
.max = test->max,
|
124
|
+
.sparsity = test->sparsity,
|
125
|
+
.trimFactor = OPT_I32(trimFactor)},
|
126
|
+
status,
|
127
|
+
use_range_v2);
|
128
128
|
}
|
129
129
|
|
130
|
-
static mc_mincover_t *
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
status);
|
130
|
+
static mc_mincover_t *_test_getMincoverDouble_helper(void *tests, size_t idx, mongocrypt_status_t *status) {
|
131
|
+
BSON_ASSERT_PARAM(tests);
|
132
|
+
|
133
|
+
const bool use_range_v2 = true;
|
134
|
+
const uint32_t trimFactor = 0; // At present, all test cases expect trimFactor=0.
|
135
|
+
DoubleTest *const test = (DoubleTest *)tests + idx;
|
136
|
+
|
137
|
+
return mc_getMincoverDouble(
|
138
|
+
(mc_getMincoverDouble_args_t){.lowerBound = test->lowerBound,
|
139
|
+
.includeLowerBound = test->includeLowerBound,
|
140
|
+
.upperBound = test->upperBound,
|
141
|
+
.includeUpperBound = test->includeUpperBound,
|
142
|
+
.sparsity = test->sparsity,
|
143
|
+
.min = test->precision.set ? test->min : (mc_optional_double_t){0},
|
144
|
+
.max = test->precision.set ? test->max : (mc_optional_double_t){0},
|
145
|
+
.precision = test->precision,
|
146
|
+
.trimFactor = OPT_I32(trimFactor)},
|
147
|
+
status,
|
148
|
+
use_range_v2);
|
150
149
|
}
|
151
150
|
|
152
151
|
#if MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
153
|
-
static mc_mincover_t *
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
status);
|
152
|
+
static mc_mincover_t *_test_getMincoverDecimal128_helper(void *tests, size_t idx, mongocrypt_status_t *status) {
|
153
|
+
BSON_ASSERT_PARAM(tests);
|
154
|
+
|
155
|
+
Decimal128Test *const test = (Decimal128Test *)tests + idx;
|
156
|
+
|
157
|
+
const bool use_range_v2 = true;
|
158
|
+
const uint32_t trimFactor = 0; // At present, all test cases expect trimFactor=0.
|
159
|
+
return mc_getMincoverDecimal128(
|
160
|
+
(mc_getMincoverDecimal128_args_t){.lowerBound = test->lowerBound,
|
161
|
+
.includeLowerBound = test->includeLowerBound,
|
162
|
+
.upperBound = test->upperBound,
|
163
|
+
.includeUpperBound = test->includeUpperBound,
|
164
|
+
.sparsity = test->sparsity,
|
165
|
+
.min = test->precision.set ? test->min : (mc_optional_dec128_t){0},
|
166
|
+
.max = test->precision.set ? test->max : (mc_optional_dec128_t){0},
|
167
|
+
.precision = test->precision,
|
168
|
+
.trimFactor = OPT_I32(trimFactor)},
|
169
|
+
status,
|
170
|
+
use_range_v2);
|
173
171
|
}
|
174
172
|
#endif // MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
175
173
|
|
176
|
-
static const char *
|
177
|
-
|
178
|
-
|
179
|
-
BSON_ASSERT_PARAM (tests);
|
180
|
-
return ((Int32Test *) tests + idx)->expectError;
|
174
|
+
static const char *_test_expectError32(void *tests, size_t idx) {
|
175
|
+
BSON_ASSERT_PARAM(tests);
|
176
|
+
return ((Int32Test *)tests + idx)->expectError;
|
181
177
|
}
|
182
178
|
|
183
|
-
static const char *
|
184
|
-
|
185
|
-
|
186
|
-
BSON_ASSERT_PARAM (tests);
|
187
|
-
return ((Int64Test *) tests + idx)->expectError;
|
179
|
+
static const char *_test_expectError64(void *tests, size_t idx) {
|
180
|
+
BSON_ASSERT_PARAM(tests);
|
181
|
+
return ((Int64Test *)tests + idx)->expectError;
|
188
182
|
}
|
189
183
|
|
190
|
-
static const char *
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
184
|
+
static const char *_test_expectErrorDouble(void *tests, size_t idx) {
|
185
|
+
BSON_ASSERT_PARAM(tests);
|
186
|
+
DoubleTest *test = ((DoubleTest *)tests + idx);
|
187
|
+
if (test->min.set && test->max.set && test->precision.set) {
|
188
|
+
// Expect an error for tests including an invalid min/max/precision.
|
189
|
+
uint32_t ignored;
|
190
|
+
mongocrypt_status_t *const status = mongocrypt_status_new();
|
191
|
+
if (!mc_canUsePrecisionModeDouble(test->min.value, test->max.value, test->precision.value, &ignored, status)) {
|
192
|
+
if (!mongocrypt_status_ok(status)) {
|
193
|
+
return mongocrypt_status_message(status, NULL);
|
194
|
+
}
|
195
|
+
|
196
|
+
return "The domain of double values specified by the min, max, and precision cannot be represented in "
|
197
|
+
"fewer than 64 bits";
|
198
|
+
}
|
199
|
+
mongocrypt_status_destroy(status);
|
200
|
+
}
|
201
|
+
return test->expectError;
|
195
202
|
}
|
196
203
|
|
197
204
|
#if MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
198
|
-
static const char *
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
205
|
+
static const char *_test_expectErrorDecimal128(void *tests, size_t idx) {
|
206
|
+
BSON_ASSERT_PARAM(tests);
|
207
|
+
Decimal128Test *test = ((Decimal128Test *)tests + idx);
|
208
|
+
if (test->min.set && test->max.set && test->precision.set) {
|
209
|
+
// Expect an error for tests including an invalid min/max/precision.
|
210
|
+
uint32_t ignored;
|
211
|
+
mongocrypt_status_t *const status = mongocrypt_status_new();
|
212
|
+
if (!mc_canUsePrecisionModeDecimal(test->min.value, test->max.value, test->precision.value, &ignored, status)) {
|
213
|
+
if (!mongocrypt_status_ok(status)) {
|
214
|
+
return mongocrypt_status_message(status, NULL);
|
215
|
+
}
|
216
|
+
|
217
|
+
return "The domain of decimal values specified by the min, max, and precision cannot be represented in "
|
218
|
+
"fewer than 128 bits";
|
219
|
+
}
|
220
|
+
}
|
221
|
+
return test->expectError;
|
203
222
|
}
|
204
223
|
#endif // MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
205
224
|
|
206
|
-
static const char *const *
|
207
|
-
|
208
|
-
|
209
|
-
BSON_ASSERT_PARAM (tests);
|
210
|
-
return ((Int32Test *) tests + idx)->expectMincoverStrings;
|
225
|
+
static const char *const *_test_expectMincover32(void *tests, size_t idx) {
|
226
|
+
BSON_ASSERT_PARAM(tests);
|
227
|
+
return ((Int32Test *)tests + idx)->expectMincoverStrings;
|
211
228
|
}
|
212
229
|
|
213
|
-
static const char *const *
|
214
|
-
|
215
|
-
|
216
|
-
BSON_ASSERT_PARAM (tests);
|
217
|
-
return ((Int64Test *) tests + idx)->expectMincoverStrings;
|
230
|
+
static const char *const *_test_expectMincover64(void *tests, size_t idx) {
|
231
|
+
BSON_ASSERT_PARAM(tests);
|
232
|
+
return ((Int64Test *)tests + idx)->expectMincoverStrings;
|
218
233
|
}
|
219
234
|
|
220
|
-
static const char *const *
|
221
|
-
|
222
|
-
|
223
|
-
BSON_ASSERT_PARAM (tests);
|
224
|
-
return ((DoubleTest *) tests + idx)->expectMincoverStrings;
|
235
|
+
static const char *const *_test_expectMincoverDouble(void *tests, size_t idx) {
|
236
|
+
BSON_ASSERT_PARAM(tests);
|
237
|
+
return ((DoubleTest *)tests + idx)->expectMincoverStrings;
|
225
238
|
}
|
226
239
|
|
227
240
|
#if MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
228
|
-
static const char *const *
|
229
|
-
|
230
|
-
|
231
|
-
BSON_ASSERT_PARAM (tests);
|
232
|
-
return ((Decimal128Test *) tests + idx)->expectMincoverStrings;
|
241
|
+
static const char *const *_test_expectMincoverDecimal128(void *tests, size_t idx) {
|
242
|
+
BSON_ASSERT_PARAM(tests);
|
243
|
+
return ((Decimal128Test *)tests + idx)->expectMincoverStrings;
|
233
244
|
}
|
234
245
|
#endif // MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
235
246
|
|
236
|
-
static void
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
fflush (stdout); // Avoid incomplete stdout output from prior tests on error
|
242
|
-
fprintf (stderr,
|
247
|
+
static void _test_dump_32(void *tests, size_t idx, mc_mincover_t *got) {
|
248
|
+
BSON_ASSERT_PARAM(tests);
|
249
|
+
Int32Test *const test = (Int32Test *)tests + idx;
|
250
|
+
fflush(stdout); // Avoid incomplete stdout output from prior tests on error
|
251
|
+
fprintf(stderr,
|
243
252
|
"testcase: lowerBound=%" PRId32 " (%s) upperBound=%" PRId32 " (%s)",
|
244
253
|
test->lowerBound,
|
245
254
|
test->includeLowerBound ? "inclusive" : "exclusive",
|
246
255
|
test->upperBound,
|
247
256
|
test->includeUpperBound ? "inclusive" : "exclusive");
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
257
|
+
if (test->min.set) {
|
258
|
+
fprintf(stderr, " min=%" PRId32, test->min.value);
|
259
|
+
}
|
260
|
+
if (test->max.set) {
|
261
|
+
fprintf(stderr, " max=%" PRId32, test->max.value);
|
262
|
+
}
|
263
|
+
fprintf(stderr, " sparsity=%zu\n", test->sparsity);
|
264
|
+
fprintf(stderr, "mincover expected ... begin\n");
|
265
|
+
for (const char **p = test->expectMincoverStrings; *p; ++p) {
|
266
|
+
fprintf(stderr, " %s\n", *p);
|
267
|
+
}
|
268
|
+
fprintf(stderr, "mincover expected ... end\n");
|
269
|
+
fprintf(stderr, "mincover got ... begin\n");
|
270
|
+
for (size_t i = 0; i < mc_mincover_len(got); i++) {
|
271
|
+
fprintf(stderr, " %s\n", mc_mincover_get(got, i));
|
272
|
+
}
|
273
|
+
fprintf(stderr, "mincover got ... end\n");
|
265
274
|
}
|
266
275
|
|
267
|
-
static void
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
fflush (stdout); // Avoid incomplete stdout output from prior tests on error
|
273
|
-
fprintf (stderr,
|
276
|
+
static void _test_dump_64(void *tests, size_t idx, mc_mincover_t *got) {
|
277
|
+
BSON_ASSERT_PARAM(tests);
|
278
|
+
Int64Test *const test = (Int64Test *)tests + idx;
|
279
|
+
fflush(stdout); // Avoid incomplete stdout output from prior tests on error
|
280
|
+
fprintf(stderr,
|
274
281
|
"testcase: lowerBound=%" PRId64 " (%s) upperBound=%" PRId64 " (%s)",
|
275
282
|
test->lowerBound,
|
276
283
|
test->includeLowerBound ? "inclusive" : "exclusive",
|
277
284
|
test->upperBound,
|
278
285
|
test->includeUpperBound ? "inclusive" : "exclusive");
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
286
|
+
if (test->min.set) {
|
287
|
+
fprintf(stderr, " min=%" PRId64, test->min.value);
|
288
|
+
}
|
289
|
+
if (test->max.set) {
|
290
|
+
fprintf(stderr, " max=%" PRId64, test->max.value);
|
291
|
+
}
|
292
|
+
fprintf(stderr, " sparsity=%zu\n", test->sparsity);
|
293
|
+
fprintf(stderr, "mincover expected ... begin\n");
|
294
|
+
for (const char **p = test->expectMincoverStrings; *p; ++p) {
|
295
|
+
fprintf(stderr, " %s\n", *p);
|
296
|
+
}
|
297
|
+
fprintf(stderr, "mincover expected ... end\n");
|
298
|
+
fprintf(stderr, "mincover got ... begin\n");
|
299
|
+
for (size_t i = 0; i < mc_mincover_len(got); i++) {
|
300
|
+
fprintf(stderr, " %s\n", mc_mincover_get(got, i));
|
301
|
+
}
|
302
|
+
fprintf(stderr, "mincover got ... end\n");
|
296
303
|
}
|
297
304
|
|
298
|
-
static void
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
fflush (stdout); // Avoid incomplete stdout output from prior tests on error
|
304
|
-
fprintf (stderr,
|
305
|
+
static void _test_dump_Double(void *tests, size_t idx, mc_mincover_t *got) {
|
306
|
+
BSON_ASSERT_PARAM(tests);
|
307
|
+
DoubleTest *const test = (DoubleTest *)tests + idx;
|
308
|
+
fflush(stdout); // Avoid incomplete stdout output from prior tests on error
|
309
|
+
fprintf(stderr,
|
305
310
|
"testcase: lowerBound=%f (%s) upperBound=%f (%s)",
|
306
311
|
test->lowerBound,
|
307
312
|
test->includeLowerBound ? "inclusive" : "exclusive",
|
308
313
|
test->upperBound,
|
309
314
|
test->includeUpperBound ? "inclusive" : "exclusive");
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
315
|
+
if (test->min.set) {
|
316
|
+
fprintf(stderr, " min=%f", test->min.value);
|
317
|
+
}
|
318
|
+
if (test->max.set) {
|
319
|
+
fprintf(stderr, " max=%f", test->max.value);
|
320
|
+
}
|
321
|
+
if (test->precision.set) {
|
322
|
+
fprintf(stderr, " precision=%" PRIu32, test->precision.value);
|
323
|
+
}
|
324
|
+
fprintf(stderr, " sparsity=%zu\n", test->sparsity);
|
325
|
+
fprintf(stderr, "mincover expected ... begin\n");
|
326
|
+
for (const char **p = test->expectMincoverStrings; *p; ++p) {
|
327
|
+
fprintf(stderr, " %s\n", *p);
|
328
|
+
}
|
329
|
+
fprintf(stderr, "mincover expected ... end\n");
|
330
|
+
fprintf(stderr, "mincover got ... begin\n");
|
331
|
+
for (size_t i = 0; i < mc_mincover_len(got); i++) {
|
332
|
+
fprintf(stderr, " %s\n", mc_mincover_get(got, i));
|
333
|
+
}
|
334
|
+
fprintf(stderr, "mincover got ... end\n");
|
330
335
|
}
|
331
336
|
|
332
337
|
#if MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
333
|
-
static void
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
fflush (stdout); // Avoid incomplete stdout output from prior tests on error
|
339
|
-
fprintf (stderr,
|
338
|
+
static void _test_dump_Decimal128(void *tests, size_t idx, mc_mincover_t *got) {
|
339
|
+
BSON_ASSERT_PARAM(tests);
|
340
|
+
Decimal128Test *const test = (Decimal128Test *)tests + idx;
|
341
|
+
fflush(stdout); // Avoid incomplete stdout output from prior tests on error
|
342
|
+
fprintf(stderr,
|
340
343
|
"testcase: lowerBound=%s (%s) upperBound=%s (%s)",
|
341
|
-
mc_dec128_to_string
|
344
|
+
mc_dec128_to_string(test->lowerBound).str,
|
342
345
|
test->includeLowerBound ? "inclusive" : "exclusive",
|
343
|
-
mc_dec128_to_string
|
346
|
+
mc_dec128_to_string(test->upperBound).str,
|
344
347
|
test->includeUpperBound ? "inclusive" : "exclusive");
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
348
|
+
if (test->min.set) {
|
349
|
+
fprintf(stderr, " min=%s", mc_dec128_to_string(test->min.value).str);
|
350
|
+
}
|
351
|
+
if (test->max.set) {
|
352
|
+
fprintf(stderr, " max=%s", mc_dec128_to_string(test->max.value).str);
|
353
|
+
}
|
354
|
+
if (test->precision.set) {
|
355
|
+
fprintf(stderr, " precision=%" PRIu32, test->precision.value);
|
356
|
+
}
|
357
|
+
fprintf(stderr, " sparsity=%zu\n", test->sparsity);
|
358
|
+
fprintf(stderr, "mincover expected ... begin\n");
|
359
|
+
for (const char **p = test->expectMincoverStrings; *p; ++p) {
|
360
|
+
fprintf(stderr, " %s\n", *p);
|
361
|
+
}
|
362
|
+
fprintf(stderr, "mincover expected ... end\n");
|
363
|
+
fprintf(stderr, "mincover got ... begin\n");
|
364
|
+
for (size_t i = 0; i < mc_mincover_len(got); i++) {
|
365
|
+
fprintf(stderr, " %s\n", mc_mincover_get(got, i));
|
366
|
+
}
|
367
|
+
fprintf(stderr, "mincover got ... end\n");
|
365
368
|
}
|
366
369
|
#endif // MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
367
370
|
|
368
|
-
static void
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
if (expectError) {
|
380
|
-
ASSERT_OR_PRINT_MSG (NULL == got, "expected error, got success");
|
381
|
-
ASSERT_STATUS_CONTAINS (status, expectError);
|
382
|
-
mongocrypt_status_destroy (status);
|
383
|
-
continue;
|
384
|
-
}
|
385
|
-
ASSERT_OK_STATUS (got != NULL, status);
|
386
|
-
|
387
|
-
size_t numGot = mc_mincover_len (got);
|
388
|
-
const char *const *expectStrings = args.expectMincoverStrings (tests, i);
|
389
|
-
|
390
|
-
const char *const *exp_iter = expectStrings;
|
391
|
-
size_t nthItem = 0;
|
392
|
-
for (; *exp_iter; ++nthItem, ++exp_iter) {
|
393
|
-
if (nthItem > numGot) {
|
394
|
-
// List length mismatch. Keep scanning, though. We'll use the
|
395
|
-
// numbers later
|
396
|
-
continue;
|
397
|
-
}
|
398
|
-
const char *gotItem = mc_mincover_get (got, nthItem);
|
399
|
-
const char *expectItem = *exp_iter;
|
400
|
-
|
401
|
-
if (0 == strcmp (gotItem, expectItem)) {
|
402
|
-
// This one matches, Keep going.
|
371
|
+
static void _test_getMincover_impl(void *tests, size_t num_tests, _test_getMincover_args args) {
|
372
|
+
BSON_ASSERT_PARAM(tests);
|
373
|
+
|
374
|
+
for (size_t i = 0; i < num_tests; i++) {
|
375
|
+
mongocrypt_status_t *const status = mongocrypt_status_new();
|
376
|
+
mc_mincover_t *got = args.getMincover(tests, i, status);
|
377
|
+
const char *expectError = args.expectError(tests, i);
|
378
|
+
if (expectError) {
|
379
|
+
ASSERT_OR_PRINT_MSG(NULL == got, "expected error, got success");
|
380
|
+
ASSERT_STATUS_CONTAINS(status, expectError);
|
381
|
+
mongocrypt_status_destroy(status);
|
403
382
|
continue;
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
383
|
+
}
|
384
|
+
ASSERT_OK_STATUS(got != NULL, status);
|
385
|
+
|
386
|
+
size_t numGot = mc_mincover_len(got);
|
387
|
+
const char *const *expectStrings = args.expectMincoverStrings(tests, i);
|
388
|
+
|
389
|
+
const char *const *exp_iter = expectStrings;
|
390
|
+
size_t nthItem = 0;
|
391
|
+
for (; *exp_iter; ++nthItem, ++exp_iter) {
|
392
|
+
if (nthItem > numGot) {
|
393
|
+
// List length mismatch. Keep scanning, though. We'll use the
|
394
|
+
// numbers later
|
395
|
+
continue;
|
396
|
+
}
|
397
|
+
const char *gotItem = mc_mincover_get(got, nthItem);
|
398
|
+
const char *expectItem = *exp_iter;
|
399
|
+
|
400
|
+
if (0 == strcmp(gotItem, expectItem)) {
|
401
|
+
// This one matches, Keep going.
|
402
|
+
continue;
|
403
|
+
}
|
404
|
+
args.dump(tests, nthItem, got);
|
405
|
+
TEST_ERROR("test %zu: mincover mismatch at index %zu:\n"
|
406
|
+
" Got: %s\n"
|
407
|
+
" Expected: %s\n",
|
408
|
+
i,
|
409
|
+
nthItem,
|
410
|
+
gotItem,
|
411
|
+
expectItem);
|
412
|
+
}
|
413
|
+
|
414
|
+
if (nthItem != numGot) {
|
415
|
+
args.dump(tests, i, got);
|
416
|
+
TEST_ERROR("test %zu: Got the wrong number of mincover items. Expected %zu "
|
417
|
+
"items, but got %zu\n",
|
418
|
+
i,
|
419
|
+
nthItem,
|
420
|
+
numGot);
|
421
|
+
}
|
422
|
+
|
423
|
+
mc_mincover_destroy(got);
|
424
|
+
mongocrypt_status_destroy(status);
|
425
|
+
}
|
428
426
|
}
|
429
427
|
|
430
|
-
static void
|
431
|
-
|
432
|
-
{
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
428
|
+
static void _test_getMincoverInt32(_mongocrypt_tester_t *tester) {
|
429
|
+
static Int32Test tests[] = {
|
430
|
+
{.lowerBound = 1,
|
431
|
+
.includeLowerBound = false,
|
432
|
+
.upperBound = 3,
|
433
|
+
.includeUpperBound = true,
|
434
|
+
.min = OPT_I32_C(0),
|
435
|
+
.max = OPT_I32_C(7),
|
436
|
+
.sparsity = 1,
|
437
|
+
.expectMincoverStrings = {"01"}},
|
438
|
+
{.lowerBound = 1,
|
439
|
+
.includeLowerBound = true,
|
440
|
+
.upperBound = 3,
|
441
|
+
.includeUpperBound = false,
|
442
|
+
.min = OPT_I32_C(0),
|
443
|
+
.max = OPT_I32_C(7),
|
444
|
+
.sparsity = 1,
|
445
|
+
.expectMincoverStrings = {"001", "010"}},
|
446
|
+
{.lowerBound = 1,
|
447
|
+
.includeLowerBound = true,
|
448
|
+
.upperBound = 3,
|
449
|
+
.includeUpperBound = true,
|
450
|
+
.min = OPT_I32_C(0),
|
451
|
+
.max = OPT_I32_C(7),
|
452
|
+
.sparsity = 1,
|
453
|
+
.expectMincoverStrings = {"001", "01"}},
|
454
|
+
{.lowerBound = 3,
|
455
|
+
.includeLowerBound = true,
|
456
|
+
.upperBound = 3,
|
457
|
+
.includeUpperBound = true,
|
458
|
+
.min = OPT_I32_C(0),
|
459
|
+
.max = OPT_I32_C(7),
|
460
|
+
.sparsity = 1,
|
461
|
+
.expectMincoverStrings = {"011"}},
|
462
|
+
{.lowerBound = 4,
|
463
|
+
.includeLowerBound = true,
|
464
|
+
.upperBound = 3,
|
465
|
+
.includeUpperBound = true,
|
466
|
+
.min = OPT_I32_C(0),
|
467
|
+
.max = OPT_I32_C(7),
|
468
|
+
.sparsity = 1,
|
469
|
+
.expectError = "must be less than or equal to"},
|
470
|
+
{.lowerBound = 1,
|
471
|
+
.includeLowerBound = true,
|
472
|
+
.upperBound = 8,
|
473
|
+
.includeUpperBound = true,
|
474
|
+
.min = OPT_I32_C(0),
|
475
|
+
.max = OPT_I32_C(7),
|
476
|
+
.sparsity = 1,
|
477
|
+
.expectError = "less than or equal to the maximum value"},
|
478
|
+
{.lowerBound = 0,
|
479
|
+
.includeLowerBound = true,
|
480
|
+
.upperBound = 7,
|
481
|
+
.includeUpperBound = true,
|
482
|
+
.min = OPT_I32_C(0),
|
483
|
+
.max = OPT_I32_C(7),
|
484
|
+
.sparsity = 1,
|
485
|
+
.expectMincoverStrings = {"root"}},
|
486
|
+
{.lowerBound = 0,
|
487
|
+
.includeLowerBound = true,
|
488
|
+
.upperBound = 7,
|
489
|
+
.includeUpperBound = true,
|
490
|
+
.min = OPT_I32_C(0),
|
491
|
+
.max = OPT_I32_C(7),
|
492
|
+
.sparsity = 1,
|
493
|
+
.trimFactor = 1,
|
494
|
+
.expectMincoverStrings = {"0", "1"}},
|
495
|
+
{.lowerBound = 0,
|
496
|
+
.includeLowerBound = true,
|
497
|
+
.upperBound = 7,
|
498
|
+
.includeUpperBound = true,
|
499
|
+
.min = OPT_I32_C(0),
|
500
|
+
.max = OPT_I32_C(7),
|
501
|
+
.sparsity = 1,
|
502
|
+
.trimFactor = 2,
|
503
|
+
.expectMincoverStrings = {"00", "01", "10", "11"}},
|
504
|
+
{.lowerBound = 0,
|
505
|
+
.includeLowerBound = true,
|
506
|
+
.upperBound = 7,
|
507
|
+
.includeUpperBound = true,
|
508
|
+
.min = OPT_I32_C(0),
|
509
|
+
.max = OPT_I32_C(7),
|
510
|
+
.sparsity = 1,
|
511
|
+
.trimFactor = 3,
|
512
|
+
.expectError =
|
513
|
+
"Trim factor must be less than the number of bits (3) used to represent an element of the domain"},
|
482
514
|
|
483
515
|
#include "./data/range-min-cover/mincover_int32.cstruct"
|
484
516
|
|
485
|
-
|
517
|
+
};
|
486
518
|
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
.dump = _test_dump_32});
|
519
|
+
_test_getMincover_impl(tests,
|
520
|
+
sizeof(tests) / sizeof(tests[0]),
|
521
|
+
(_test_getMincover_args){.getMincover = _test_getMincover32,
|
522
|
+
.expectMincoverStrings = _test_expectMincover32,
|
523
|
+
.expectError = _test_expectError32,
|
524
|
+
.dump = _test_dump_32});
|
494
525
|
}
|
495
526
|
|
496
|
-
static void
|
497
|
-
|
498
|
-
{
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
.sparsity = 1,
|
547
|
-
.expectError = "less than or equal to the maximum value"},
|
527
|
+
static void _test_getMincoverInt64(_mongocrypt_tester_t *tester) {
|
528
|
+
static Int64Test tests[] = {
|
529
|
+
{.lowerBound = 1,
|
530
|
+
.includeLowerBound = false,
|
531
|
+
.upperBound = 3,
|
532
|
+
.includeUpperBound = true,
|
533
|
+
.min = OPT_I64_C(0),
|
534
|
+
.max = OPT_I64_C(7),
|
535
|
+
.sparsity = 1,
|
536
|
+
.expectMincoverStrings = {"01"}},
|
537
|
+
{.lowerBound = 1,
|
538
|
+
.includeLowerBound = true,
|
539
|
+
.upperBound = 3,
|
540
|
+
.includeUpperBound = false,
|
541
|
+
.min = OPT_I64_C(0),
|
542
|
+
.max = OPT_I64_C(7),
|
543
|
+
.sparsity = 1,
|
544
|
+
.expectMincoverStrings = {"001", "010"}},
|
545
|
+
{.lowerBound = 1,
|
546
|
+
.includeLowerBound = true,
|
547
|
+
.upperBound = 3,
|
548
|
+
.includeUpperBound = true,
|
549
|
+
.min = OPT_I64_C(0),
|
550
|
+
.max = OPT_I64_C(7),
|
551
|
+
.sparsity = 1,
|
552
|
+
.expectMincoverStrings = {"001", "01"}},
|
553
|
+
{.lowerBound = 3,
|
554
|
+
.includeLowerBound = true,
|
555
|
+
.upperBound = 3,
|
556
|
+
.includeUpperBound = true,
|
557
|
+
.min = OPT_I64_C(0),
|
558
|
+
.max = OPT_I64_C(7),
|
559
|
+
.sparsity = 1,
|
560
|
+
.expectMincoverStrings = {"011"}},
|
561
|
+
{.lowerBound = 4,
|
562
|
+
.includeLowerBound = true,
|
563
|
+
.upperBound = 3,
|
564
|
+
.includeUpperBound = true,
|
565
|
+
.min = OPT_I64_C(0),
|
566
|
+
.max = OPT_I64_C(7),
|
567
|
+
.sparsity = 1,
|
568
|
+
.expectError = "must be less than or equal to"},
|
569
|
+
{.lowerBound = 1,
|
570
|
+
.includeLowerBound = true,
|
571
|
+
.upperBound = 8,
|
572
|
+
.includeUpperBound = true,
|
573
|
+
.min = OPT_I64_C(0),
|
574
|
+
.max = OPT_I64_C(7),
|
575
|
+
.sparsity = 1,
|
576
|
+
.expectError = "less than or equal to the maximum value"},
|
548
577
|
|
549
578
|
#include "./data/range-min-cover/mincover_int64.cstruct"
|
550
579
|
|
551
|
-
|
580
|
+
};
|
552
581
|
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
.dump = _test_dump_64});
|
582
|
+
_test_getMincover_impl(tests,
|
583
|
+
sizeof(tests) / sizeof(tests[0]),
|
584
|
+
(_test_getMincover_args){.getMincover = _test_getMincover64,
|
585
|
+
.expectMincoverStrings = _test_expectMincover64,
|
586
|
+
.expectError = _test_expectError64,
|
587
|
+
.dump = _test_dump_64});
|
560
588
|
}
|
561
589
|
|
562
|
-
static void
|
563
|
-
|
564
|
-
{
|
565
|
-
static DoubleTest tests[] = {
|
590
|
+
static void _test_getMincoverDouble(_mongocrypt_tester_t *tester) {
|
591
|
+
static DoubleTest tests[] = {
|
566
592
|
#include "./data/range-min-cover/mincover_double.cstruct"
|
567
593
|
#include "./data/range-min-cover/mincover_double_precision.cstruct"
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
.expectError = _test_expectErrorDouble,
|
577
|
-
.dump = _test_dump_Double});
|
594
|
+
};
|
595
|
+
|
596
|
+
_test_getMincover_impl(tests,
|
597
|
+
sizeof(tests) / sizeof(tests[0]),
|
598
|
+
(_test_getMincover_args){.getMincover = _test_getMincoverDouble_helper,
|
599
|
+
.expectMincoverStrings = _test_expectMincoverDouble,
|
600
|
+
.expectError = _test_expectErrorDouble,
|
601
|
+
.dump = _test_dump_Double});
|
578
602
|
}
|
579
603
|
|
580
604
|
#if MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
581
|
-
static void
|
582
|
-
|
583
|
-
{
|
584
|
-
Decimal128Test tests[] = {
|
605
|
+
static void _test_getMincoverDecimal128(_mongocrypt_tester_t *tester) {
|
606
|
+
Decimal128Test tests[] = {
|
585
607
|
#include "./data/range-min-cover/mincover_decimal128.cstruct"
|
586
608
|
#include "./data/range-min-cover/mincover_decimal128_precision.cstruct"
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
.expectError = _test_expectErrorDecimal128,
|
596
|
-
.dump = _test_dump_Decimal128});
|
609
|
+
};
|
610
|
+
|
611
|
+
_test_getMincover_impl(tests,
|
612
|
+
sizeof(tests) / sizeof(tests[0]),
|
613
|
+
(_test_getMincover_args){.getMincover = _test_getMincoverDecimal128_helper,
|
614
|
+
.expectMincoverStrings = _test_expectMincoverDecimal128,
|
615
|
+
.expectError = _test_expectErrorDecimal128,
|
616
|
+
.dump = _test_dump_Decimal128});
|
597
617
|
}
|
598
618
|
#endif // MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
599
619
|
|
600
|
-
void
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
INSTALL_TEST (_test_getMincoverInt64);
|
605
|
-
INSTALL_TEST (_test_getMincoverDouble);
|
620
|
+
void _mongocrypt_tester_install_range_mincover(_mongocrypt_tester_t *tester) {
|
621
|
+
INSTALL_TEST(_test_getMincoverInt32);
|
622
|
+
INSTALL_TEST(_test_getMincoverInt64);
|
623
|
+
INSTALL_TEST(_test_getMincoverDouble);
|
606
624
|
#if MONGOCRYPT_HAVE_DECIMAL128_SUPPORT
|
607
|
-
|
625
|
+
INSTALL_TEST(_test_getMincoverDecimal128);
|
608
626
|
#endif
|
609
627
|
}
|