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.
Files changed (600) hide show
  1. checksums.yaml +4 -4
  2. data/ext/libmongocrypt/libmongocrypt/CHANGELOG.md +40 -5
  3. data/ext/libmongocrypt/libmongocrypt/CMakeLists.txt +29 -24
  4. data/ext/libmongocrypt/libmongocrypt/CODEOWNERS +1 -4
  5. data/ext/libmongocrypt/libmongocrypt/Earthfile +522 -0
  6. data/ext/libmongocrypt/libmongocrypt/README.md +36 -40
  7. data/ext/libmongocrypt/libmongocrypt/bindings/cs/CMakeLists.txt +1 -0
  8. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Driver.snk +0 -0
  9. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/AssemblyInfo.cs +2 -2
  10. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Binary.cs +16 -2
  11. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptClient.cs +25 -6
  12. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/CryptClientFactory.cs +8 -4
  13. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/Library.cs +35 -3
  14. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/LibraryLoader.cs +81 -44
  15. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt/MongoDB.Libmongocrypt.csproj +2 -1
  16. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Example/MongoDB.Libmongocrypt.Example.csproj +1 -1
  17. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/BasicTests.cs +1 -1
  18. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test/MongoDB.Libmongocrypt.Test.csproj +2 -0
  19. data/ext/libmongocrypt/libmongocrypt/bindings/cs/MongoDB.Libmongocrypt.Test32/MongoDB.Libmongocrypt.Test32.csproj +2 -0
  20. data/ext/libmongocrypt/libmongocrypt/bindings/cs/README.md +3 -0
  21. data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.cake +22 -26
  22. data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.config +3 -0
  23. data/ext/libmongocrypt/libmongocrypt/bindings/cs/Scripts/build.sh +0 -0
  24. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/benchmarks/build.gradle.kts +28 -0
  25. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/benchmarks/src/main/java/com/mongodb/crypt/benchmark/BenchmarkRunner.java +217 -0
  26. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/benchmarks/src/main/resources/keyDocument.json +24 -0
  27. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/build.gradle.kts +22 -7
  28. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradle/wrapper/gradle-wrapper.jar +0 -0
  29. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradle/wrapper/gradle-wrapper.properties +1 -1
  30. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradlew +154 -108
  31. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/gradlew.bat +7 -18
  32. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/settings.gradle.kts +1 -0
  33. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CAPI.java +41 -6
  34. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CAPIHelper.java +5 -5
  35. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/CipherCallback.java +27 -1
  36. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoCryptImpl.java +34 -19
  37. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/java/com/mongodb/crypt/capi/MongoExplicitEncryptOptions.java +6 -4
  38. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/resources/META-INF/native-image/jni-config.json +180 -0
  39. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/main/resources/META-INF/native-image/reflect-config.json +134 -0
  40. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/java/com/mongodb/crypt/capi/MongoCryptTest.java +50 -6
  41. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit-v2/int32/encrypted-payload.json +26 -0
  42. 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
  43. data/ext/libmongocrypt/libmongocrypt/bindings/node/README.md +4 -771
  44. data/ext/libmongocrypt/libmongocrypt/bindings/python/CHANGELOG.rst +86 -0
  45. data/ext/libmongocrypt/libmongocrypt/bindings/python/README.rst +41 -20
  46. data/ext/libmongocrypt/libmongocrypt/bindings/python/RELEASE.rst +6 -24
  47. data/ext/libmongocrypt/libmongocrypt/bindings/python/build-manylinux-wheel.sh +4 -13
  48. data/ext/libmongocrypt/libmongocrypt/bindings/python/hatch_build.py +36 -0
  49. data/ext/libmongocrypt/libmongocrypt/bindings/python/libmongocrypt-version.txt +1 -0
  50. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/__init__.py +2 -2
  51. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/asynchronous/auto_encrypter.py +61 -0
  52. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/asynchronous/credentials.py +156 -0
  53. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/asynchronous/explicit_encrypter.py +156 -0
  54. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/asynchronous/state_machine.py +149 -0
  55. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/auto_encrypter.py +2 -46
  56. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/binary.py +14 -17
  57. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/binding.py +232 -296
  58. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/compat.py +6 -31
  59. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/credentials.py +2 -121
  60. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/crypto.py +31 -20
  61. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/errors.py +2 -2
  62. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/explicit_encrypter.py +2 -233
  63. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/mongocrypt.py +168 -254
  64. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/options.py +265 -0
  65. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/state_machine.py +2 -141
  66. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/synchronous/auto_encrypter.py +61 -0
  67. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/synchronous/credentials.py +156 -0
  68. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/synchronous/explicit_encrypter.py +156 -0
  69. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/synchronous/state_machine.py +149 -0
  70. data/ext/libmongocrypt/libmongocrypt/bindings/python/pymongocrypt/version.py +2 -2
  71. data/ext/libmongocrypt/libmongocrypt/bindings/python/pyproject.toml +118 -0
  72. data/ext/libmongocrypt/libmongocrypt/bindings/python/release.sh +97 -61
  73. data/ext/libmongocrypt/libmongocrypt/bindings/python/requirements-test.txt +7 -0
  74. data/ext/libmongocrypt/libmongocrypt/bindings/python/requirements.txt +4 -0
  75. data/ext/libmongocrypt/libmongocrypt/bindings/python/sbom.json +76 -0
  76. data/ext/libmongocrypt/libmongocrypt/bindings/python/strip_header.py +6 -7
  77. data/ext/libmongocrypt/libmongocrypt/bindings/python/synchro.py +64 -0
  78. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/__init__.py +2 -10
  79. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/collection-info.json +1 -1
  80. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/command.json +1 -1
  81. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/compact/success/encrypted-payload.json +21 -21
  82. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/encrypted-command-reply.json +1 -1
  83. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/encrypted-field-config-map.json +1 -1
  84. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit-v2/int32/encrypted-payload.json +26 -0
  85. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit-v2/int32/rangeopts.json +14 -0
  86. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-document-azure.json +1 -1
  87. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-document-gcp.json +1 -1
  88. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-document.json +1 -1
  89. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/key-filter.json +1 -1
  90. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/list-collections-filter.json +1 -1
  91. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/mongocryptd-command.json +1 -1
  92. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/mongocryptd-reply.json +1 -1
  93. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/schema-map.json +1 -1
  94. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/performance/keyDocument.json +24 -0
  95. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/performance/perf_test.py +165 -0
  96. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_binding.py +8 -12
  97. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_crypto.py +9 -11
  98. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/test_mongocrypt.py +991 -343
  99. data/ext/libmongocrypt/libmongocrypt/bindings/python/update-sbom.sh +14 -0
  100. data/ext/libmongocrypt/libmongocrypt/cmake/FetchMongoC.cmake +19 -1
  101. data/ext/libmongocrypt/libmongocrypt/cmake/ImportBSON.cmake +31 -6
  102. data/ext/libmongocrypt/libmongocrypt/cmake/IntelDFP.cmake +20 -227
  103. data/ext/libmongocrypt/libmongocrypt/cmake/Patch.cmake +54 -0
  104. data/ext/libmongocrypt/libmongocrypt/cmake/Platform.cmake +50 -0
  105. data/ext/libmongocrypt/libmongocrypt/cmake/mongocrypt-config.cmake +21 -0
  106. data/ext/libmongocrypt/libmongocrypt/doc/img/cli-icon.png +0 -0
  107. data/ext/libmongocrypt/libmongocrypt/doc/img/reference-targets.png +0 -0
  108. data/ext/libmongocrypt/libmongocrypt/doc/releasing.md +153 -0
  109. data/ext/libmongocrypt/libmongocrypt/etc/c6-vault.repo +39 -0
  110. data/ext/libmongocrypt/libmongocrypt/etc/calc_release_version.py +61 -28
  111. data/ext/libmongocrypt/libmongocrypt/etc/calc_release_version_selftest.sh +73 -0
  112. data/ext/libmongocrypt/libmongocrypt/etc/cyclonedx.sbom.json +108 -0
  113. data/ext/libmongocrypt/libmongocrypt/etc/fle2_aead_generate_tests.py +15 -24
  114. data/ext/libmongocrypt/libmongocrypt/etc/fle2_crypto.py +66 -54
  115. data/ext/libmongocrypt/libmongocrypt/etc/fle2_generate_tests.py +14 -23
  116. data/ext/libmongocrypt/libmongocrypt/etc/fle2v2_aead_generate_tests.py +32 -0
  117. data/ext/libmongocrypt/libmongocrypt/etc/format-all.sh +12 -0
  118. data/ext/libmongocrypt/libmongocrypt/etc/format.sh +16 -0
  119. data/ext/libmongocrypt/libmongocrypt/etc/install-package.sh +48 -0
  120. data/ext/libmongocrypt/libmongocrypt/etc/libbson-remove-GCC-diagnostic-pragma.patch +27 -0
  121. data/ext/libmongocrypt/libmongocrypt/etc/mongo-inteldfp-alpine-arm-fix.patch +17 -0
  122. data/ext/libmongocrypt/libmongocrypt/etc/mongo-inteldfp-libmongocrypt-pr-625.patch +13 -0
  123. data/ext/libmongocrypt/libmongocrypt/etc/packager.py +120 -91
  124. data/ext/libmongocrypt/libmongocrypt/etc/purls.txt +14 -0
  125. data/ext/libmongocrypt/libmongocrypt/etc/repo_config.yaml +56 -0
  126. data/ext/libmongocrypt/libmongocrypt/etc/silk-create-asset-group.sh +70 -0
  127. data/ext/libmongocrypt/libmongocrypt/etc/ssdlc_compliance_report.md +37 -0
  128. data/ext/libmongocrypt/libmongocrypt/etc/third_party_vulnerabilities.md +42 -0
  129. data/ext/libmongocrypt/libmongocrypt/integrating.md +18 -1
  130. data/ext/libmongocrypt/libmongocrypt/kms-message/CMakeLists.txt +11 -3
  131. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_gcp_request.c +1 -1
  132. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_reader_writer.c +17 -0
  133. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_reader_writer_private.h +6 -0
  134. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_request.c +211 -1
  135. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_response.c +163 -0
  136. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_kmip_tag_type_private.h +2 -1
  137. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_kmip_request.h +17 -0
  138. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_message/kms_kmip_response.h +6 -0
  139. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_port.c +3 -2
  140. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request.c +4 -2
  141. data/ext/libmongocrypt/libmongocrypt/kms-message/src/kms_request_str.c +2 -2
  142. data/ext/libmongocrypt/libmongocrypt/kms-message/test/test_kmip_reader_writer.c +23 -2
  143. data/ext/libmongocrypt/libmongocrypt/src/crypto/cng.c +381 -436
  144. data/ext/libmongocrypt/libmongocrypt/src/crypto/commoncrypto.c +162 -227
  145. data/ext/libmongocrypt/libmongocrypt/src/crypto/libcrypto.c +183 -248
  146. data/ext/libmongocrypt/libmongocrypt/src/crypto/none.c +33 -55
  147. data/ext/libmongocrypt/libmongocrypt/src/csfle-markup.cpp +175 -205
  148. data/ext/libmongocrypt/libmongocrypt/src/mc-array-private.h +10 -21
  149. data/ext/libmongocrypt/libmongocrypt/src/mc-array.c +44 -56
  150. data/ext/libmongocrypt/libmongocrypt/src/mc-check-conversions-private.h +4 -8
  151. data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.h +351 -463
  152. data/ext/libmongocrypt/libmongocrypt/src/mc-dec128.test.cpp +59 -66
  153. data/ext/libmongocrypt/libmongocrypt/src/mc-efc-private.h +21 -11
  154. data/ext/libmongocrypt/libmongocrypt/src/mc-efc.c +175 -99
  155. data/ext/libmongocrypt/libmongocrypt/src/mc-fle-blob-subtype-private.h +18 -10
  156. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder-private.h +69 -70
  157. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-encryption-placeholder.c +445 -439
  158. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-private-v2.h +41 -0
  159. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-private.h +11 -18
  160. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload-v2.c +135 -0
  161. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-equality-payload.c +109 -126
  162. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-private-v2.h +103 -0
  163. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-private.h +28 -31
  164. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload-v2.c +173 -0
  165. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-find-range-payload.c +106 -125
  166. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-private-v2.h +130 -0
  167. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-private.h +36 -44
  168. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload-v2.c +382 -0
  169. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-insert-update-payload.c +237 -278
  170. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-private-v2.h +133 -0
  171. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-private.h +67 -56
  172. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev-v2.c +437 -0
  173. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-iev.c +454 -325
  174. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-common-private.h +69 -0
  175. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-common.c +182 -0
  176. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-private.h +23 -31
  177. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-v2-private.h +85 -0
  178. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev-v2.c +142 -0
  179. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-payload-uev.c +104 -231
  180. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-range-operator-private.h +8 -7
  181. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds-private.h +56 -56
  182. data/ext/libmongocrypt/libmongocrypt/src/mc-fle2-rfds.c +520 -580
  183. data/ext/libmongocrypt/libmongocrypt/src/mc-optional-private.h +47 -66
  184. data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation-private.h +67 -76
  185. data/ext/libmongocrypt/libmongocrypt/src/mc-range-edge-generation.c +201 -190
  186. data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding-private.h +55 -42
  187. data/ext/libmongocrypt/libmongocrypt/src/mc-range-encoding.c +809 -558
  188. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-generator.template.h +177 -201
  189. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover-private.h +54 -53
  190. data/ext/libmongocrypt/libmongocrypt/src/mc-range-mincover.c +188 -240
  191. data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts-private.h +43 -35
  192. data/ext/libmongocrypt/libmongocrypt/src/mc-rangeopts.c +484 -337
  193. data/ext/libmongocrypt/libmongocrypt/src/mc-reader-private.h +36 -71
  194. data/ext/libmongocrypt/libmongocrypt/src/mc-reader.c +111 -164
  195. data/ext/libmongocrypt/libmongocrypt/src/mc-tokens-private.h +87 -65
  196. data/ext/libmongocrypt/libmongocrypt/src/mc-tokens.c +153 -125
  197. data/ext/libmongocrypt/libmongocrypt/src/mc-writer-private.h +66 -0
  198. data/ext/libmongocrypt/libmongocrypt/src/mc-writer.c +141 -0
  199. data/ext/libmongocrypt/libmongocrypt/src/mlib/check.hpp +37 -55
  200. data/ext/libmongocrypt/libmongocrypt/src/mlib/endian.h +11 -11
  201. data/ext/libmongocrypt/libmongocrypt/src/mlib/error.h +27 -32
  202. data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.h +461 -499
  203. data/ext/libmongocrypt/libmongocrypt/src/mlib/int128.test.cpp +256 -334
  204. data/ext/libmongocrypt/libmongocrypt/src/mlib/macros.h +4 -5
  205. data/ext/libmongocrypt/libmongocrypt/src/mlib/path.h +196 -231
  206. data/ext/libmongocrypt/libmongocrypt/src/mlib/path.test.c +56 -79
  207. data/ext/libmongocrypt/libmongocrypt/src/mlib/str.h +411 -530
  208. data/ext/libmongocrypt/libmongocrypt/src/mlib/str.test.c +116 -131
  209. data/ext/libmongocrypt/libmongocrypt/src/mlib/thread.h +17 -26
  210. data/ext/libmongocrypt/libmongocrypt/src/mlib/user-check.h +2 -2
  211. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-binary-private.h +1 -9
  212. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-binary.c +31 -48
  213. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-buffer-private.h +55 -131
  214. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-buffer.c +442 -565
  215. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-collinfo-private.h +1 -2
  216. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-collinfo.c +28 -45
  217. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-key-private.h +11 -17
  218. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-key.c +104 -132
  219. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-oauth-private.h +16 -24
  220. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-oauth.c +110 -93
  221. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache-private.h +26 -45
  222. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-cache.c +220 -273
  223. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ciphertext-private.h +13 -25
  224. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ciphertext.c +147 -166
  225. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-compat.h +2 -2
  226. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto-private.h +110 -204
  227. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-crypto.c +1145 -1567
  228. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-datakey.c +510 -476
  229. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-decrypt.c +817 -694
  230. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-encrypt.c +2775 -2697
  231. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-private.h +189 -184
  232. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx-rewrap-many-datakey.c +308 -351
  233. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-ctx.c +990 -1139
  234. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-dll-private.h +23 -24
  235. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endian-private.h +44 -58
  236. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endpoint-private.h +21 -25
  237. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-endpoint.c +167 -181
  238. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kek-private.h +42 -44
  239. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kek.c +292 -272
  240. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker-private.h +70 -110
  241. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-broker.c +1010 -1033
  242. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key-private.h +27 -44
  243. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-key.c +349 -402
  244. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx-private.h +127 -120
  245. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-kms-ctx.c +1692 -1611
  246. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-log-private.h +35 -67
  247. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-log.c +49 -83
  248. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking-private.h +31 -36
  249. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-marking.c +1923 -1479
  250. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-mutex-private.h +7 -12
  251. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts-private.h +124 -107
  252. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-opts.c +925 -419
  253. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-private.h +99 -122
  254. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-status-private.h +3 -8
  255. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-status.c +92 -119
  256. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-traverse-util-private.h +19 -29
  257. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-traverse-util.c +136 -176
  258. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-util-private.h +11 -21
  259. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt-util.c +98 -136
  260. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.c +924 -1339
  261. data/ext/libmongocrypt/libmongocrypt/src/mongocrypt.h +199 -313
  262. data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_dll.c +83 -79
  263. data/ext/libmongocrypt/libmongocrypt/src/os_posix/os_mutex.c +20 -28
  264. data/ext/libmongocrypt/libmongocrypt/src/os_win/os_dll.c +64 -73
  265. data/ext/libmongocrypt/libmongocrypt/src/os_win/os_mutex.c +8 -16
  266. data/ext/libmongocrypt/libmongocrypt/test/crypt_shared-stub.cpp +57 -87
  267. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/bypassQueryAnalysis/payload.json +53 -0
  268. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/jsonSchema/cmd-to-mongocryptd.json +23 -0
  269. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/jsonSchema/cmd.json +20 -0
  270. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/cmd-to-mongocryptd.json +50 -0
  271. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/cmd.json +20 -0
  272. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/collinfo.json +44 -0
  273. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/encrypted-field-map.json +24 -0
  274. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/encrypted-payload-pattern.json +53 -0
  275. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/simple/mongocryptd-reply.json +62 -0
  276. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/unencrypted/cmd-to-mongocryptd.json +30 -0
  277. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/unencrypted/cmd.json +17 -0
  278. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/unencrypted/mongocryptd-reply.json +39 -0
  279. data/ext/libmongocrypt/libmongocrypt/test/data/bulkWrite/unencrypted/payload.json +21 -0
  280. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/missing-key-id/collinfo.json +20 -0
  281. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/no-fields/collinfo.json +9 -0
  282. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/no-fields/encrypted-payload.json +4 -0
  283. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/cmd.json +1 -0
  284. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/collinfo.json +63 -0
  285. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/encrypted-field-config-map.json +61 -0
  286. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/encrypted-payload-range-v2.json +37 -0
  287. data/ext/libmongocrypt/libmongocrypt/test/data/cleanup/success/encrypted-payload.json +29 -0
  288. data/ext/libmongocrypt/libmongocrypt/test/data/compact/anchor-pad/cmd.json +1 -0
  289. data/ext/libmongocrypt/libmongocrypt/test/data/compact/anchor-pad/collinfo.json +64 -0
  290. data/ext/libmongocrypt/libmongocrypt/test/data/compact/anchor-pad/encrypted-payload-range-v2.json +105 -0
  291. data/ext/libmongocrypt/libmongocrypt/test/data/compact/anchor-pad/encrypted-payload.json +30 -0
  292. data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-range/cmd.json +1 -0
  293. data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-range/collinfo.json +49 -0
  294. data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-range/encrypted-field-config-map.json +47 -0
  295. data/ext/libmongocrypt/libmongocrypt/test/data/compact/no-range/encrypted-payload.json +23 -0
  296. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/collinfo.json +15 -0
  297. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-field-config-map.json +10 -0
  298. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-payload-range-v2.json +104 -0
  299. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/encrypted-payload.json +6 -0
  300. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/empty/encrypted-payload-v2.json +60 -0
  301. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-delete/success/encrypted-payload-v2.json +67 -0
  302. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-csfle/collinfo.json +4 -4
  303. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explain/with-csfle/encrypted-payload.json +5 -5
  304. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/find-indexed-contentionFactor1-v2.json +8 -0
  305. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/find-indexed-v2.json +8 -0
  306. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-contentionFactor1-v2.json +8 -0
  307. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-same-user-and-index-key-v2.json +8 -0
  308. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-explicit/insert-indexed-v2.json +8 -0
  309. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/cmd.json +6 -0
  310. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/encrypted-field-map.json +22 -0
  311. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/encrypted-payload.json +40 -0
  312. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-equality-v2/mongocryptd-reply.json +19 -0
  313. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/cmd.json +10 -0
  314. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/encrypted-field-map.json +27 -0
  315. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/encrypted-payload.json +41 -0
  316. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/date-v2/mongocryptd-reply.json +49 -0
  317. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/cmd.json +6 -0
  318. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/encrypted-field-map.json +30 -0
  319. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/encrypted-payload.json +50 -0
  320. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-precision-v2/mongocryptd-reply.json +58 -0
  321. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/cmd.json +6 -0
  322. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/encrypted-field-map.json +27 -0
  323. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/encrypted-payload.json +41 -0
  324. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/decimal128-v2/mongocryptd-reply.json +49 -0
  325. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/cmd.json +8 -0
  326. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/encrypted-field-map.json +30 -0
  327. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/encrypted-payload.json +44 -0
  328. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-precision-v2/mongocryptd-reply.json +52 -0
  329. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/cmd.json +8 -0
  330. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/encrypted-field-map.json +27 -0
  331. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/encrypted-payload.json +41 -0
  332. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/double-v2/mongocryptd-reply.json +49 -0
  333. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/cmd.json +8 -0
  334. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/encrypted-field-map.json +27 -0
  335. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/encrypted-payload.json +41 -0
  336. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int32-v2/mongocryptd-reply.json +49 -0
  337. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/cmd.json +8 -0
  338. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/encrypted-field-map.json +27 -0
  339. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/encrypted-payload.json +41 -0
  340. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range/int64-v2/mongocryptd-reply.json +49 -0
  341. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double/encrypted-payload-v2.json +26 -0
  342. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/double-precision/encrypted-payload-v2.json +26 -0
  343. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32/encrypted-payload-v2.json +26 -0
  344. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/encrypted-payload-v2.json +26 -0
  345. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-openinterval/encrypted-payload-v2.json +16 -0
  346. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert/cmd.json +1 -1
  347. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date/RNG_DATA.h +65 -65
  348. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/cmd.json +13 -0
  349. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/encrypted-field-map.json +27 -0
  350. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/encrypted-payload.json +44 -0
  351. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/date-v2/mongocryptd-reply.json +52 -0
  352. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128/RNG_DATA.h +132 -132
  353. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision/RNG_DATA.h +71 -71
  354. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/cmd.json +9 -0
  355. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/encrypted-field-map.json +30 -0
  356. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/encrypted-payload.json +53 -0
  357. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-precision-v2/mongocryptd-reply.json +61 -0
  358. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/cmd.json +9 -0
  359. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/encrypted-field-map.json +27 -0
  360. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/encrypted-payload.json +44 -0
  361. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/decimal128-v2/mongocryptd-reply.json +52 -0
  362. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double/RNG_DATA.h +68 -68
  363. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision/RNG_DATA.h +19 -19
  364. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/cmd.json +11 -0
  365. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/encrypted-field-map.json +30 -0
  366. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/encrypted-payload.json +47 -0
  367. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-precision-v2/mongocryptd-reply.json +55 -0
  368. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/cmd.json +11 -0
  369. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/encrypted-field-map.json +27 -0
  370. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/encrypted-payload.json +44 -0
  371. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/double-v2/mongocryptd-reply.json +52 -0
  372. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32/RNG_DATA.h +25 -25
  373. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/cmd.json +11 -0
  374. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/encrypted-field-map.json +27 -0
  375. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/encrypted-payload.json +44 -0
  376. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int32-v2/mongocryptd-reply.json +52 -0
  377. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64/RNG_DATA.h +65 -65
  378. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/cmd.json +11 -0
  379. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/encrypted-field-map.json +27 -0
  380. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/encrypted-payload.json +44 -0
  381. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range/int64-v2/mongocryptd-reply.json +52 -0
  382. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/RNG_DATA.h +68 -68
  383. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double/encrypted-payload-v2.json +8 -0
  384. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/RNG_DATA.h +19 -19
  385. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/double-precision/encrypted-payload-v2.json +8 -0
  386. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/RNG_DATA.h +25 -25
  387. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32/encrypted-payload-v2.json +8 -0
  388. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/encrypted-payload-v2.json +8 -0
  389. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/RNG_DATA.h +15 -15
  390. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/sparsity-2/encrypted-payload-v2.json +8 -0
  391. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/cmd.json +9 -0
  392. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/encrypted-field-map.json +18 -0
  393. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/encrypted-payload.json +14 -0
  394. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-unindexed-v2/mongocryptd-reply.json +41 -0
  395. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/cmd.json +9 -0
  396. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/encrypted-field-map.json +22 -0
  397. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/encrypted-payload.json +39 -0
  398. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-v2/mongocryptd-reply.json +49 -0
  399. data/ext/libmongocrypt/libmongocrypt/test/data/iev-v2/FLECrudTest-insertOneRangeV2.json +10 -0
  400. data/ext/libmongocrypt/libmongocrypt/test/data/iev-v2/FLECrudTest-insertOneV2.json +10 -0
  401. data/ext/libmongocrypt/libmongocrypt/test/data/kms-azure/decrypt-response.txt +16 -0
  402. data/ext/libmongocrypt/libmongocrypt/test/data/kms-azure/encrypt-response.txt +16 -0
  403. data/ext/libmongocrypt/libmongocrypt/test/data/kms-azure/oauth-response.txt +19 -0
  404. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/find/cmd.json +9 -0
  405. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/find/encrypted-field-map.json +19 -0
  406. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/find/encrypted-payload.json +62 -0
  407. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/find/mongocryptd-reply.json +69 -0
  408. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/insert/cmd.json +11 -0
  409. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/insert/encrypted-field-map.json +19 -0
  410. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/insert/encrypted-payload.json +40 -0
  411. data/ext/libmongocrypt/libmongocrypt/test/data/no-trimFactor/insert/mongocryptd-reply.json +47 -0
  412. data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_decimal128.cstruct +1 -1
  413. data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_double.cstruct +8637 -7958
  414. data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_int32.cstruct +5522 -1382
  415. data/ext/libmongocrypt/libmongocrypt/test/data/range-edge-generation/edges_int64.cstruct +5042 -1262
  416. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_decimal128.cstruct +1 -1
  417. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_decimal128_precision.cstruct +1 -1
  418. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_double.cstruct +1 -1
  419. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_double_precision.cstruct +2 -2
  420. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_int32.cstruct +1 -1
  421. data/ext/libmongocrypt/libmongocrypt/test/data/range-min-cover/mincover_int64.cstruct +1 -1
  422. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-find-int32/cmd.json +8 -0
  423. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-find-int32/encrypted-field-map.json +19 -0
  424. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-find-int32/encrypted-payload.json +53 -0
  425. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-find-int32/mongocryptd-reply.json +58 -0
  426. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-insert-int32/cmd.json +11 -0
  427. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-insert-int32/encrypted-field-map.json +19 -0
  428. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-insert-int32/encrypted-payload.json +40 -0
  429. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/auto-insert-int32/mongocryptd-reply.json +45 -0
  430. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-find-int32/expected.json +26 -0
  431. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-find-int32/to-encrypt.json +20 -0
  432. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-find-int32-defaults/expected.json +26 -0
  433. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-find-int32-defaults/to-encrypt.json +20 -0
  434. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-insert-double/expected.json +8 -0
  435. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-insert-int32/expected.json +8 -0
  436. data/ext/libmongocrypt/libmongocrypt/test/data/range-sends-cryptoParams/explicit-insert-int32-defaults/expected.json +8 -0
  437. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/README.md +17 -0
  438. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/aes-ctr.json +29 -0
  439. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2-fixed.json +10 -0
  440. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2-generated.json +38 -0
  441. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2aead-decrypt.json +35 -0
  442. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2aead-fixed.json +29 -0
  443. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2aead-generated.json +122 -0
  444. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2v2-aead-fixed.json +29 -0
  445. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/fle2v2-aead-generated.json +122 -0
  446. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/mcgrew.json +12 -0
  447. data/ext/libmongocrypt/libmongocrypt/test/data/roundtrip/nist.json +20 -0
  448. data/ext/libmongocrypt/libmongocrypt/test/data/tokens/README.md +30 -0
  449. data/ext/libmongocrypt/libmongocrypt/test/data/tokens/mc.json +25 -0
  450. data/ext/libmongocrypt/libmongocrypt/test/data/tokens/server.json +25 -0
  451. data/ext/libmongocrypt/libmongocrypt/test/example-no-bson.c +4 -4
  452. data/ext/libmongocrypt/libmongocrypt/test/example-state-machine.c +279 -323
  453. data/ext/libmongocrypt/libmongocrypt/test/fuzz_kms.c +8 -7
  454. data/ext/libmongocrypt/libmongocrypt/test/test-dll.cpp +6 -7
  455. data/ext/libmongocrypt/libmongocrypt/test/test-gcp-auth.c +221 -283
  456. data/ext/libmongocrypt/libmongocrypt/test/test-mc-efc.c +60 -73
  457. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-find-equality-payload-v2.c +78 -0
  458. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-find-range-payload-v2.c +129 -0
  459. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iev-v2.c +248 -0
  460. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iev.c +467 -414
  461. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup-v2.c +248 -0
  462. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-iup.c +141 -159
  463. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-uev-v2.c +338 -0
  464. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-payload-uev.c +238 -176
  465. data/ext/libmongocrypt/libmongocrypt/test/test-mc-fle2-rfds.c +373 -474
  466. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-edge-generation.c +421 -388
  467. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-encoding.c +974 -825
  468. data/ext/libmongocrypt/libmongocrypt/test/test-mc-range-mincover.c +499 -481
  469. data/ext/libmongocrypt/libmongocrypt/test/test-mc-rangeopts.c +312 -148
  470. data/ext/libmongocrypt/libmongocrypt/test/test-mc-reader.c +124 -207
  471. data/ext/libmongocrypt/libmongocrypt/test/test-mc-tokens.c +249 -213
  472. data/ext/libmongocrypt/libmongocrypt/test/test-mc-writer.c +176 -0
  473. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.c +632 -808
  474. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert-match-bson.h +22 -2
  475. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-assert.h +168 -189
  476. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-buffer.c +187 -211
  477. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cache-oauth.c +118 -37
  478. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cache.c +210 -233
  479. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ciphertext.c +185 -220
  480. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-cleanup.c +374 -0
  481. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-compact.c +410 -445
  482. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-hooks.c +798 -812
  483. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.c +142 -135
  484. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto-std-hooks.h +70 -71
  485. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-crypto.c +394 -846
  486. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-csfle-lib.c +159 -183
  487. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-decrypt.c +870 -1045
  488. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-encrypt.c +5183 -4717
  489. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-rewrap-many-datakey.c +750 -964
  490. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-ctx-setopt.c +1093 -1178
  491. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-datakey.c +348 -420
  492. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-dll.c +23 -30
  493. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-endpoint.c +98 -111
  494. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kek.c +49 -52
  495. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key-broker.c +770 -920
  496. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key-cache.c +354 -407
  497. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-key.c +197 -245
  498. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kms-ctx.c +705 -368
  499. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-kms-responses.c +147 -166
  500. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-local-kms.c +50 -61
  501. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-log.c +85 -100
  502. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-marking.c +1073 -690
  503. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-opts.c +42 -0
  504. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-status.c +46 -58
  505. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-traverse-util.c +381 -451
  506. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-util.c +55 -67
  507. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt-util.h +7 -10
  508. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.c +879 -918
  509. data/ext/libmongocrypt/libmongocrypt/test/test-mongocrypt.h +119 -169
  510. data/ext/libmongocrypt/libmongocrypt/test/test-named-kms-providers.c +2381 -0
  511. data/ext/libmongocrypt/libmongocrypt/test/util/HELP.autogen +3 -1
  512. data/ext/libmongocrypt/libmongocrypt/test/util/README.md +1 -0
  513. data/ext/libmongocrypt/libmongocrypt/test/util/csfle.c +512 -559
  514. data/ext/libmongocrypt/libmongocrypt/test/util/make_includes.py +1 -1
  515. data/ext/libmongocrypt/libmongocrypt/test/util/util.c +771 -882
  516. data/ext/libmongocrypt/libmongocrypt/test/util/util.h +33 -55
  517. data/lib/libmongocrypt_helper/version.rb +2 -2
  518. metadata +245 -111
  519. checksums.yaml.gz.sig +0 -0
  520. data/ext/libmongocrypt/libmongocrypt/VERSION_CURRENT +0 -1
  521. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit/int32/encrypted-payload.json +0 -26
  522. data/ext/libmongocrypt/libmongocrypt/bindings/java/mongocrypt/src/test/resources/fle2-find-range-explicit/int32/key-document.json +0 -0
  523. data/ext/libmongocrypt/libmongocrypt/bindings/node/CHANGELOG.md +0 -81
  524. data/ext/libmongocrypt/libmongocrypt/bindings/node/LICENSE +0 -201
  525. data/ext/libmongocrypt/libmongocrypt/bindings/node/binding.gyp +0 -79
  526. data/ext/libmongocrypt/libmongocrypt/bindings/node/etc/README.hbs +0 -44
  527. data/ext/libmongocrypt/libmongocrypt/bindings/node/etc/build-static.sh +0 -39
  528. data/ext/libmongocrypt/libmongocrypt/bindings/node/index.d.ts +0 -515
  529. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/autoEncrypter.js +0 -420
  530. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/buffer_pool.js +0 -123
  531. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/clientEncryption.js +0 -699
  532. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/common.js +0 -100
  533. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/credentialsProvider.js +0 -33
  534. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/cryptoCallbacks.js +0 -87
  535. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/index.js +0 -42
  536. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/mongocryptdManager.js +0 -66
  537. data/ext/libmongocrypt/libmongocrypt/bindings/node/lib/stateMachine.js +0 -487
  538. data/ext/libmongocrypt/libmongocrypt/bindings/node/package-lock.json +0 -16051
  539. data/ext/libmongocrypt/libmongocrypt/bindings/node/package.json +0 -81
  540. data/ext/libmongocrypt/libmongocrypt/bindings/node/src/mongocrypt.cc +0 -929
  541. data/ext/libmongocrypt/libmongocrypt/bindings/node/src/mongocrypt.h +0 -114
  542. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/autoEncrypter.test.js +0 -953
  543. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/buffer_pool.test.js +0 -91
  544. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/clientEncryption.test.js +0 -701
  545. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/credentialsProvider.test.js +0 -163
  546. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/cryptoCallbacks.test.js +0 -284
  547. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/README.md +0 -5
  548. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/cmd.json +0 -6
  549. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/collection-info.json +0 -37
  550. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/encrypted-document-nested.json +0 -8
  551. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/encrypted-document.json +0 -11
  552. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/encryptedFields.json +0 -30
  553. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/key-document.json +0 -32
  554. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/key1-document.json +0 -30
  555. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/data/mongocryptd-reply.json +0 -18
  556. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/mongocryptdManager.test.js +0 -48
  557. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/release.test.js +0 -59
  558. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/requirements.helper.js +0 -29
  559. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/stateMachine.test.js +0 -331
  560. data/ext/libmongocrypt/libmongocrypt/bindings/node/test/tools/mongodb_reporter.js +0 -325
  561. data/ext/libmongocrypt/libmongocrypt/bindings/python/setup.py +0 -84
  562. data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/fle2-find-range-explicit/int32/encrypted-payload.json +0 -26
  563. data/ext/libmongocrypt/libmongocrypt/bindings/python/test-requirements.txt +0 -12
  564. data/ext/libmongocrypt/libmongocrypt/debian/build_snapshot.sh +0 -79
  565. data/ext/libmongocrypt/libmongocrypt/debian/changelog +0 -105
  566. data/ext/libmongocrypt/libmongocrypt/debian/compat +0 -1
  567. data/ext/libmongocrypt/libmongocrypt/debian/control +0 -41
  568. data/ext/libmongocrypt/libmongocrypt/debian/copyright +0 -129
  569. data/ext/libmongocrypt/libmongocrypt/debian/gbp.conf +0 -23
  570. data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt-dev.dirs +0 -2
  571. data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt-dev.install +0 -5
  572. data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt0.dirs +0 -1
  573. data/ext/libmongocrypt/libmongocrypt/debian/libmongocrypt0.install +0 -1
  574. data/ext/libmongocrypt/libmongocrypt/debian/rules +0 -46
  575. data/ext/libmongocrypt/libmongocrypt/debian/source/format +0 -1
  576. data/ext/libmongocrypt/libmongocrypt/debian/source/lintian-overrides +0 -3
  577. data/ext/libmongocrypt/libmongocrypt/debian/source/options +0 -1
  578. data/ext/libmongocrypt/libmongocrypt/debian/watch +0 -3
  579. data/ext/libmongocrypt/libmongocrypt/test/data/aes-ctr.cstructs +0 -359
  580. data/ext/libmongocrypt/libmongocrypt/test/data/compact/success/mongocryptd-reply.json +0 -72
  581. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-aead.cstructs +0 -109
  582. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/encrypted-payload.json +0 -26
  583. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-find-range-explicit/int32-nominmax/rangeopts.json +0 -5
  584. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/RNG_DATA.h +0 -70
  585. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/encrypted-payload.json +0 -8
  586. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/rangeopts.json +0 -5
  587. data/ext/libmongocrypt/libmongocrypt/test/data/fle2-insert-range-explicit/int32-nominmax/value-to-encrypt.json +0 -5
  588. data/ext/libmongocrypt/libmongocrypt/test/data/fle2.cstructs +0 -33
  589. data.tar.gz.sig +0 -0
  590. metadata.gz.sig +0 -0
  591. /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
  592. /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
  593. /data/ext/libmongocrypt/libmongocrypt/bindings/python/test/data/{fle2-find-range-explicit → fle2-find-range-explicit-v2}/int32/value-to-encrypt.json +0 -0
  594. /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
  595. /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
  596. /data/ext/libmongocrypt/libmongocrypt/{bindings/node/test/data/kms-decrypt-reply.txt → test/data/kms-aws/decrypt-response.txt} +0 -0
  597. /data/ext/libmongocrypt/libmongocrypt/{bindings/node/test/data/kms-encrypt-reply.txt → test/data/kms-aws/encrypt-response.txt} +0 -0
  598. /data/ext/libmongocrypt/libmongocrypt/test/data/{gcp-auth → kms-gcp}/decrypt-response.txt +0 -0
  599. /data/ext/libmongocrypt/libmongocrypt/test/data/{gcp-auth → kms-gcp}/encrypt-response.txt +0 -0
  600. /data/ext/libmongocrypt/libmongocrypt/test/data/{gcp-auth → kms-gcp}/oauth-response.txt +0 -0
@@ -0,0 +1,76 @@
1
+ {
2
+ "components": [
3
+ {
4
+ "bom-ref": "pkg:github/mongodb/libmongocrypt@1.10.1",
5
+ "externalReferences": [
6
+ {
7
+ "type": "distribution",
8
+ "url": "https://github.com/mongodb/libmongocrypt/archive/refs/tags/1.10.1.tar.gz"
9
+ },
10
+ {
11
+ "type": "website",
12
+ "url": "https://github.com/mongodb/libmongocrypt/tree/1.10.1"
13
+ }
14
+ ],
15
+ "group": "mongodb",
16
+ "name": "libmongocrypt",
17
+ "purl": "pkg:github/mongodb/libmongocrypt@1.10.1",
18
+ "type": "library",
19
+ "version": "1.10.1"
20
+ }
21
+ ],
22
+ "dependencies": [
23
+ {
24
+ "ref": "pkg:github/mongodb/libmongocrypt@1.10.1"
25
+ }
26
+ ],
27
+ "metadata": {
28
+ "timestamp": "2024-06-28T19:11:17.100829+00:00",
29
+ "tools": [
30
+ {
31
+ "externalReferences": [
32
+ {
33
+ "type": "build-system",
34
+ "url": "https://github.com/CycloneDX/cyclonedx-python-lib/actions"
35
+ },
36
+ {
37
+ "type": "distribution",
38
+ "url": "https://pypi.org/project/cyclonedx-python-lib/"
39
+ },
40
+ {
41
+ "type": "documentation",
42
+ "url": "https://cyclonedx-python-library.readthedocs.io/"
43
+ },
44
+ {
45
+ "type": "issue-tracker",
46
+ "url": "https://github.com/CycloneDX/cyclonedx-python-lib/issues"
47
+ },
48
+ {
49
+ "type": "license",
50
+ "url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE"
51
+ },
52
+ {
53
+ "type": "release-notes",
54
+ "url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md"
55
+ },
56
+ {
57
+ "type": "vcs",
58
+ "url": "https://github.com/CycloneDX/cyclonedx-python-lib"
59
+ },
60
+ {
61
+ "type": "website",
62
+ "url": "https://github.com/CycloneDX/cyclonedx-python-lib/#readme"
63
+ }
64
+ ],
65
+ "name": "cyclonedx-python-lib",
66
+ "vendor": "CycloneDX",
67
+ "version": "6.4.4"
68
+ }
69
+ ]
70
+ },
71
+ "serialNumber": "urn:uuid:b09e93cf-eb1b-4d38-add5-86b01139769f",
72
+ "version": 1,
73
+ "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
74
+ "bomFormat": "CycloneDX",
75
+ "specVersion": "1.5"
76
+ }
@@ -21,16 +21,16 @@ import itertools
21
21
  import re
22
22
  import sys
23
23
 
24
- DROP_RE = re.compile(r'^\s*(#|MONGOCRYPT_EXPORT)')
24
+ DROP_RE = re.compile(r"^\s*(#|MONGOCRYPT_EXPORT)")
25
25
 
26
26
 
27
27
  def strip_file(content):
28
- fold = content.replace('\\\n', ' ')
29
- all_lines = fold.split('\n') + ['']
28
+ fold = content.replace("\\\n", " ")
29
+ all_lines = [*fold.split("\n"), ""]
30
30
  keep_lines = (line for line in all_lines if not DROP_RE.match(line))
31
- fin = ''
31
+ fin = ""
32
32
  for line, peek in itertools.pairwise(keep_lines):
33
- if peek == '' and line == '':
33
+ if peek == "" and line == "":
34
34
  # Drop adjacent empty lines
35
35
  continue
36
36
  yield line
@@ -38,11 +38,10 @@ def strip_file(content):
38
38
  yield fin
39
39
 
40
40
 
41
-
42
41
  def strip(hdr):
43
42
  with open(hdr) as fp:
44
43
  out = strip_file(fp.read())
45
- print('\n'.join(out))
44
+ print("\n".join(out)) # noqa: T201
46
45
 
47
46
 
48
47
  if __name__ == "__main__":
@@ -0,0 +1,64 @@
1
+ # Copyright 2024-present MongoDB, Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ from os import listdir
16
+ from pathlib import Path
17
+
18
+ from unasync import Rule, unasync_files
19
+
20
+ replacements = {
21
+ "asynchronous": "synchronous",
22
+ "AsyncMongoCryptCallback": "MongoCryptCallback",
23
+ "AsyncExplicitEncrypter": "ExplicitEncrypter",
24
+ "AsyncAutoEncrypter": "AutoEncrypter",
25
+ "AsyncClient": "Client",
26
+ "AsyncMongoCrypt": "MongoCrypt",
27
+ "aclose": "close",
28
+ }
29
+
30
+ _base = "pymongocrypt"
31
+
32
+ async_files = [
33
+ f"./{_base}/asynchronous/{f}"
34
+ for f in listdir("pymongocrypt/asynchronous")
35
+ if (Path(_base) / "asynchronous" / f).is_file()
36
+ ]
37
+
38
+
39
+ unasync_files(
40
+ async_files,
41
+ [
42
+ Rule(
43
+ fromdir="/pymongocrypt/asynchronous/",
44
+ todir="/pymongocrypt/synchronous/",
45
+ additional_replacements=replacements,
46
+ )
47
+ ],
48
+ )
49
+
50
+ sync_files = [
51
+ f"./{_base}/synchronous/{f}"
52
+ for f in listdir("pymongocrypt/synchronous")
53
+ if (Path(_base) / "synchronous" / f).is_file()
54
+ ]
55
+
56
+ for file in sync_files:
57
+ with open(file, "r+") as f:
58
+ lines = f.readlines()
59
+ for i in range(len(lines)):
60
+ for s in replacements:
61
+ lines[i] = lines[i].replace(s, replacements[s])
62
+ f.seek(0)
63
+ f.truncate()
64
+ f.writelines(lines)
@@ -21,17 +21,9 @@ try:
21
21
  # Enable the fault handler to dump the traceback of each running thread
22
22
  # after a segfault.
23
23
  import faulthandler
24
+
24
25
  faulthandler.enable()
25
26
  except ImportError:
26
27
  pass
27
28
 
28
- # Use assertRaisesRegex if available, otherwise use Python 2.7's
29
- # deprecated assertRaisesRegexp, with a 'p'.
30
- if not hasattr(unittest.TestCase, 'assertRaisesRegex'):
31
- unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
32
-
33
- try:
34
- from unittest import mock
35
- except ImportError: # python 2
36
- import mock
37
-
29
+ from unittest import mock
@@ -3,4 +3,4 @@
3
3
  "filter": {
4
4
  "ssn": "457-55-5462"
5
5
  }
6
- }
6
+ }
@@ -1,23 +1,23 @@
1
1
  {
2
- "compactStructuredEncryptionData": "test",
3
- "compactionTokens": {
4
- "nested.notindexed": {
5
- "$binary": {
6
- "base64": "27J6DZqcjkRzZ3lWEsxH7CsQHr4CZirrGmuPS8ZkRO0=",
7
- "subType": "00"
8
- }
9
- },
10
- "nested.encrypted": {
11
- "$binary": {
12
- "base64": "SWO8WEoZ2r2Kx/muQKb7+COizy85nIIUFiHh4K9kcvA=",
13
- "subType": "00"
14
- }
15
- },
16
- "encrypted": {
17
- "$binary": {
18
- "base64": "noN+05JsuO1oDg59yypIGj45i+eFH6HOTXOPpeZ//Mk=",
19
- "subType": "00"
20
- }
2
+ "compactStructuredEncryptionData": "test",
3
+ "compactionTokens": {
4
+ "nested.notindexed": {
5
+ "$binary": {
6
+ "base64": "27J6DZqcjkRzZ3lWEsxH7CsQHr4CZirrGmuPS8ZkRO0=",
7
+ "subType": "00"
21
8
  }
22
- }
23
- }
9
+ },
10
+ "nested.encrypted": {
11
+ "$binary": {
12
+ "base64": "SWO8WEoZ2r2Kx/muQKb7+COizy85nIIUFiHh4K9kcvA=",
13
+ "subType": "00"
14
+ }
15
+ },
16
+ "encrypted": {
17
+ "$binary": {
18
+ "base64": "noN+05JsuO1oDg59yypIGj45i+eFH6HOTXOPpeZ//Mk=",
19
+ "subType": "00"
20
+ }
21
+ }
22
+ }
23
+ }
@@ -13,4 +13,4 @@
13
13
  "ns" : "test.test"
14
14
  },
15
15
  "ok" : 1
16
- }
16
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "v": {
3
+ "$and": [
4
+ {
5
+ "age": {
6
+ "$gte": {
7
+ "$binary": {
8
+ "base64": "DQECAAADcGF5bG9hZACZAQAABGcAhQEAAAMwAH0AAAAFZAAgAAAAAInd0noBhIiJMv8QTjcfgRqnnVhxRJRRACLfvgT+CTR/BXMAIAAAAADm0EjqF/T4EmR6Dw6NaPLrL0OuzS4AFvm90czFluAAygVsACAAAAAA5MXcYWjYlzhPFUDebBEa17B5z2bupmaW9uCdtLjc7RkAAzEAfQAAAAVkACAAAAAA7lkNtT6RLw91aJ07K/blwlFs5wi9pQjqUXDcaCTxe98FcwAgAAAAAPwySffuLQihmF70Ot93KtaUMNU8KpmA+niyPRcvarNMBWwAIAAAAACDv6fJXXwRqwZH3O2kO+hdeLZ36U6bMZSui8kv0PsPtAADMgB9AAAABWQAIAAAAACcMWVTbZC4ox5VdjWeYKLgf4oBjpPlbTTAkucm9JPK0wVzACAAAAAA3tIww4ZTytkxFsUKyJbc3zwQ2w7DhkOqaNvX9g8pi3gFbAAgAAAAAGs9XR3Q1JpxV+HPW8P2GvCuCBF5bGZ8Kl1zHqzZcd5/AAASY20ABAAAAAAAAAAAEHBheWxvYWRJZAAAAAAAEGZpcnN0T3BlcmF0b3IAAgAAABBzZWNvbmRPcGVyYXRvcgAEAAAAEnNwAAEAAAAAAAAAEHRmAAAAAAAQbW4AAAAAABBteADIAAAAAA==",
9
+ "subType": "06"
10
+ }
11
+ }
12
+ }
13
+ },
14
+ {
15
+ "age": {
16
+ "$lte": {
17
+ "$binary": {
18
+ "base64": "DTsAAAAQcGF5bG9hZElkAAAAAAAQZmlyc3RPcGVyYXRvcgACAAAAEHNlY29uZE9wZXJhdG9yAAQAAAAA",
19
+ "subType": "06"
20
+ }
21
+ }
22
+ }
23
+ }
24
+ ]
25
+ }
26
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "min": {
3
+ "$numberInt": "0"
4
+ },
5
+ "max": {
6
+ "$numberInt": "200"
7
+ },
8
+ "sparsity": {
9
+ "$numberLong": "1"
10
+ },
11
+ "trimFactor": {
12
+ "$numberInt": "0"
13
+ }
14
+ }
@@ -30,4 +30,4 @@
30
30
  }
31
31
  },
32
32
  "keyAltNames": ["name1", "name2"]
33
- }
33
+ }
@@ -32,4 +32,4 @@
32
32
  }
33
33
  },
34
34
  "keyAltNames": ["name1", "name2"]
35
- }
35
+ }
@@ -30,4 +30,4 @@
30
30
  }
31
31
  },
32
32
  "keyAltNames": ["name1", "name2"]
33
- }
33
+ }
@@ -23,4 +23,4 @@
23
23
  "bsonType": "object"
24
24
  },
25
25
  "isRemoteSchema": true
26
- }
26
+ }
@@ -17,4 +17,4 @@
17
17
  }
18
18
  },
19
19
  "hasEncryptedPlaceholders": true
20
- }
20
+ }
@@ -37,4 +37,4 @@
37
37
  },
38
38
  "bsonType": "object"
39
39
  }
40
- }
40
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "_id": {
3
+ "$binary": {
4
+ "base64": "YWFhYWFhYWFhYWFhYWFhYQ==",
5
+ "subType": "04"
6
+ }
7
+ },
8
+ "keyMaterial": {
9
+ "$binary": {
10
+ "base64": "ACR7Hm33dDOAAD7l2ubZhSpSUWK8BkALUY+qW3UgBAEcTV8sBwZnaAWnzDsmrX55dgmYHWfynDlJogC/e33u6pbhyXvFTs5ow9OLCuCWBJ39T/Ivm3kMaZJybkejY0V+uc4UEdHvVVz/SbitVnzs2WXdMGmo1/HmDRrxGYZjewFslquv8wtUHF5pyB+QDlQBd/al9M444/8bJZFbMSmtIg==",
11
+ "subType": "00"
12
+ }
13
+ },
14
+ "creationDate": {
15
+ "$date": "2023-08-21T14:28:20.875Z"
16
+ },
17
+ "updateDate": {
18
+ "$date": "2023-08-21T14:28:20.875Z"
19
+ },
20
+ "status": 0,
21
+ "masterKey": {
22
+ "provider": "local"
23
+ }
24
+ }
@@ -0,0 +1,165 @@
1
+ # Copyright 2023-present MongoDB, Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """Benchmark pymongocrypt performance."""
16
+ from __future__ import annotations
17
+
18
+ import os
19
+ import sys
20
+ import time
21
+ import unittest
22
+ from concurrent.futures import ThreadPoolExecutor
23
+ from typing import List
24
+
25
+ try:
26
+ import simplejson as json
27
+ except ImportError:
28
+ import json # type: ignore[no-redef]
29
+
30
+ import bson
31
+ from bson import json_util
32
+
33
+ sys.path[0:0] = [""]
34
+
35
+
36
+ from test.test_mongocrypt import MockCallback
37
+
38
+ from pymongocrypt.binding import lib, libmongocrypt_version
39
+ from pymongocrypt.mongocrypt import MongoCrypt, MongoCryptOptions
40
+ from pymongocrypt.synchronous.explicit_encrypter import ExplicitEncrypter
41
+ from pymongocrypt.version import __version__
42
+
43
+ NUM_ITERATIONS = 10
44
+ MAX_TIME = 1
45
+ NUM_FIELDS = 1500
46
+ LOCAL_MASTER_KEY = (
47
+ b"\x9d\x94K\r\x93\xd0\xc5D\xa5r\xfd2\x1b\x940\x90#5s|\xf0\xf6\xc2\xf4\xda#V\xe7\x8f\x04"
48
+ b"\xcc\xfa\xdeu\xb4Q\x87\xf3\x8b\x97\xd7KD;\xac9\xa2\xc6M\x91\x00>\xd1\xfaJ0\xc1\xd2"
49
+ b"\xc6^\xfb\xacA\xf2H\x13<\x9bP\xfc\xa7$z.\x02c\xa3\xc6\x16%QPx>\x0f\xd8n\x84\xa6\xec"
50
+ b"\x8d-$G\xe5\xaf"
51
+ )
52
+
53
+ OUTPUT_FILE = os.environ.get("OUTPUT_FILE")
54
+
55
+ result_data: List = []
56
+
57
+
58
+ def read(filename, **kwargs):
59
+ with open(os.path.join(os.path.dirname(__file__), filename), **kwargs) as fp:
60
+ return fp.read()
61
+
62
+
63
+ def json_data(filename):
64
+ return json_util.loads(read(filename))
65
+
66
+
67
+ def bson_data(filename):
68
+ return bson.encode(json_data(filename))
69
+
70
+
71
+ def tearDownModule():
72
+ output = json.dumps(result_data, indent=4)
73
+ if OUTPUT_FILE:
74
+ with open(OUTPUT_FILE, "w") as opf:
75
+ opf.write(output)
76
+ else:
77
+ print(output)
78
+
79
+
80
+ class TestBulkDecryption(unittest.TestCase):
81
+ def setUp(self):
82
+ opts = MongoCryptOptions({"local": {"key": LOCAL_MASTER_KEY}})
83
+ callback = MockCallback(key_docs=[bson_data("keyDocument.json")])
84
+ self.mongocrypt = MongoCrypt(opts, callback)
85
+ self.encrypter = ExplicitEncrypter(callback, opts)
86
+ self.addCleanup(self.mongocrypt.close)
87
+ self.addCleanup(self.encrypter.close)
88
+
89
+ def do_task(self, encrypted, duration=MAX_TIME):
90
+ start = time.monotonic()
91
+ ops = 0
92
+ while time.monotonic() - start < duration:
93
+ with self.mongocrypt.decryption_context(encrypted) as ctx:
94
+ if ctx.state == lib.MONGOCRYPT_CTX_NEED_MONGO_KEYS:
95
+ # Key is requested on the first operation, then expected to be cached for one minute.
96
+ ctx.add_mongo_operation_result(bson_data("keyDocument.json"))
97
+ ctx.complete_mongo_operation()
98
+ self.assertEqual(ctx.state, lib.MONGOCRYPT_CTX_READY)
99
+ decrypted = ctx.finish()
100
+ ops += 1
101
+ # Assert that decryption actually occurred.
102
+ self.assertGreater(ops, 0)
103
+ doc = bson.decode(decrypted)
104
+ for val in doc.values():
105
+ self.assertIsInstance(val, str)
106
+ return ops
107
+
108
+ def percentile(self, percentile):
109
+ sorted_results = sorted(self.results)
110
+ percentile_index = int(len(sorted_results) * percentile / 100) - 1
111
+ return sorted_results[percentile_index]
112
+
113
+ def runTest(self):
114
+ doc = {}
115
+ key_id = json_data("keyDocument.json")["_id"]
116
+ for i in range(NUM_FIELDS):
117
+ val = f"value {i:04}"
118
+ val_encrypted = bson.decode(
119
+ self.encrypter.encrypt(
120
+ bson.encode({"v": val}),
121
+ "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic",
122
+ key_id=key_id,
123
+ )
124
+ )["v"]
125
+ doc[f"key{i:04}"] = val_encrypted
126
+ encrypted = bson.encode(doc)
127
+ # Warm up benchmark and discard the result.
128
+ self.do_task(encrypted, duration=2)
129
+
130
+ for n_threads in [1, 2, 8, 64]:
131
+ with ThreadPoolExecutor(max_workers=n_threads) as executor:
132
+ self.results = []
133
+ for _ in range(NUM_ITERATIONS):
134
+ start = time.monotonic()
135
+ thread_results = list(
136
+ executor.map(self.do_task, [encrypted] * n_threads)
137
+ )
138
+ interval = time.monotonic() - start
139
+ self.results.append(sum(thread_results) / interval)
140
+ median = self.percentile(50)
141
+ print(
142
+ f"Finished {self.__class__.__name__}, threads={n_threads}, median ops_per_second={median:.2f}"
143
+ )
144
+ # Remove "Test" so that TestBulkDecryption is reported as "BulkDecryption".
145
+ name = self.__class__.__name__[4:]
146
+ result_data.append(
147
+ {
148
+ "info": {
149
+ "test_name": name,
150
+ "args": {
151
+ "threads": n_threads,
152
+ },
153
+ },
154
+ "metrics": [
155
+ {"name": "ops_per_second", "type": "MEDIAN", "value": median},
156
+ ],
157
+ }
158
+ )
159
+
160
+
161
+ if __name__ == "__main__":
162
+ print(
163
+ f"Running benchmark with pymongocrypt: {__version__} libmongocrypt: {libmongocrypt_version()}"
164
+ )
165
+ unittest.main()
@@ -18,18 +18,17 @@ import sys
18
18
 
19
19
  sys.path[0:0] = [""]
20
20
 
21
- import pymongocrypt
22
- from pymongocrypt.binding import ffi, lib, _parse_version
23
-
24
21
  from test import unittest
25
22
 
23
+ import pymongocrypt
24
+ from pymongocrypt.binding import _parse_version, ffi, lib
26
25
 
27
- class TestBinding(unittest.TestCase):
28
26
 
27
+ class TestBinding(unittest.TestCase):
29
28
  def assertVersionLike(self, version):
30
29
  self.assertTrue(isinstance(version, str), msg=version)
31
30
  # There should be at least one dot: "1.0" or "1.0.0" not "1".
32
- self.assertGreaterEqual(len(version.split('.')), 2, msg=version)
31
+ self.assertGreaterEqual(len(version.split(".")), 2, msg=version)
33
32
 
34
33
  def test_pymongocrypt_version(self):
35
34
  self.assertVersionLike(pymongocrypt.__version__)
@@ -54,17 +53,14 @@ class TestBinding(unittest.TestCase):
54
53
 
55
54
  def test_parse_version(self):
56
55
  # Dev versions, betas, RCs should be less than stable releases.
57
- for v in ('1.1.0-beta1', '1.1.0-b2', '1.1.0-rc1',
58
- '1.1.0-beta1', '1.1.0-pre1'):
59
- self.assertLess(_parse_version(v),
60
- _parse_version('1.1.0'))
56
+ for v in ("1.1.0-beta1", "1.1.0-b2", "1.1.0-rc1", "1.1.0-beta1", "1.1.0-pre1"):
57
+ self.assertLess(_parse_version(v), _parse_version("1.1.0"))
61
58
 
62
59
  # Dev versions should parse correctly.
63
- _parse_version('1.1.0-beta1+20201102git80202647fc')
60
+ _parse_version("1.1.0-beta1+20201102git80202647fc")
64
61
 
65
62
  # Hyphenation in patch version should be disregarded.
66
- self.assertEqual(_parse_version('1.1.0-beta1'),
67
- _parse_version('1.1.0beta1'))
63
+ self.assertEqual(_parse_version("1.1.0-beta1"), _parse_version("1.1.0beta1"))
68
64
 
69
65
 
70
66
  if __name__ == "__main__":
@@ -19,30 +19,28 @@ import sys
19
19
  sys.path[0:0] = [""]
20
20
 
21
21
  import base64
22
+ from test import unittest
22
23
 
23
24
  from pymongocrypt.binary import MongoCryptBinaryIn
24
25
  from pymongocrypt.binding import ffi, lib
25
26
  from pymongocrypt.crypto import sign_rsaes_pkcs1_v1_5
26
27
 
27
- from test import unittest
28
-
29
28
 
30
29
  class TestCrypto(unittest.TestCase):
31
30
  def test_sign_rsaes_pkcs1_v1_5(self):
32
- key_b64 = 'MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC4JOyv5z05cL18ztpknRC7CFY2gYol4DAKerdVUoDJxCTmFMf39dVUEqD0WDiw/qcRtSO1/FRut08PlSPmvbyKetsLoxlpS8lukSzEFpFK7+L+R4miFOl6HvECyg7lbC1H/WGAhIz9yZRlXhRo9qmO/fB6PV9IeYtU+1xYuXicjCDPp36uuxBAnCz7JfvxJ3mdVc0vpSkbSb141nWuKNYR1mgyvvL6KzxO6mYsCo4hRAdhuizD9C4jDHk0V2gDCFBk0h8SLEdzStX8L0jG90/Og4y7J1b/cPo/kbYokkYisxe8cPlsvGBf+rZex7XPxc1yWaP080qeABJb+S88O//LAgMBAAECggEBAKVxP1m3FzHBUe2NZ3fYCc0Qa2zjK7xl1KPFp2u4CU+9sy0oZJUqQHUdm5CMprqWwIHPTftWboFenmCwrSXFOFzujljBO7Z3yc1WD3NJl1ZNepLcsRJ3WWFH5V+NLJ8Bdxlj1DMEZCwr7PC5+vpnCuYWzvT0qOPTl9RNVaW9VVjHouJ9Fg+s2DrShXDegFabl1iZEDdI4xScHoYBob06A5lw0WOCTayzw0Naf37lM8Y4psRAmI46XLiF/Vbuorna4hcChxDePlNLEfMipICcuxTcei1RBSlBa2t1tcnvoTy6cuYDqqImRYjp1KnMKlKQBnQ1NjS2TsRGm+F0FbreVCECgYEA4IDJlm8q/hVyNcPe4OzIcL1rsdYN3bNm2Y2O/YtRPIkQ446ItyxD06d9VuXsQpFp9jNACAPfCMSyHpPApqlxdc8z/xATlgHkcGezEOd1r4E7NdTpGg8y6Rj9b8kVlED6v4grbRhKcU6moyKUQT3+1B6ENZTOKyxuyDEgTwZHtFECgYEA0fqdv9h9s77d6eWmIioP7FSymq93pC4umxf6TVicpjpMErdD2ZfJGulN37dq8FOsOFnSmFYJdICj/PbJm6p1i8O21lsFCltEqVoVabJ7/0alPfdG2U76OeBqI8ZubL4BMnWXAB/VVEYbyWCNpQSDTjHQYs54qa2I0dJB7OgJt1sCgYEArctFQ02/7H5Rscl1yo3DBXO94SeiCFSPdC8f2Kt3MfOxvVdkAtkjkMACSbkoUsgbTVqTYSEOEc2jTgR3iQ13JgpHaFbbsq64V0QP3TAxbLIQUjYGVgQaF1UfLOBv8hrzgj45z/ST/G80lOl595+0nCUbmBcgG1AEWrmdF0/3RmECgYAKvIzKXXB3+19vcT2ga5Qq2l3TiPtOGsppRb2XrNs9qKdxIYvHmXo/9QP1V3SRW0XoD7ez8FpFabp42cmPOxUNk3FK3paQZABLxH5pzCWI9PzIAVfPDrm+sdnbgG7vAnwfL2IMMJSA3aDYGCbF9EgefG+STcpfqq7fQ6f5TBgLFwKBgCd7gn1xYL696SaKVSm7VngpXlczHVEpz3kStWR5gfzriPBxXgMVcWmcbajRser7ARpCEfbxM1UJyv6oAYZWVSNErNzNVb4POqLYcCNySuC6xKhs9FrEQnyKjyk8wI4VnrEMGrQ8e+qYSwYk9Gh6dKGoRMAPYVXQAO0fIsHF/T0a'
31
+ key_b64 = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC4JOyv5z05cL18ztpknRC7CFY2gYol4DAKerdVUoDJxCTmFMf39dVUEqD0WDiw/qcRtSO1/FRut08PlSPmvbyKetsLoxlpS8lukSzEFpFK7+L+R4miFOl6HvECyg7lbC1H/WGAhIz9yZRlXhRo9qmO/fB6PV9IeYtU+1xYuXicjCDPp36uuxBAnCz7JfvxJ3mdVc0vpSkbSb141nWuKNYR1mgyvvL6KzxO6mYsCo4hRAdhuizD9C4jDHk0V2gDCFBk0h8SLEdzStX8L0jG90/Og4y7J1b/cPo/kbYokkYisxe8cPlsvGBf+rZex7XPxc1yWaP080qeABJb+S88O//LAgMBAAECggEBAKVxP1m3FzHBUe2NZ3fYCc0Qa2zjK7xl1KPFp2u4CU+9sy0oZJUqQHUdm5CMprqWwIHPTftWboFenmCwrSXFOFzujljBO7Z3yc1WD3NJl1ZNepLcsRJ3WWFH5V+NLJ8Bdxlj1DMEZCwr7PC5+vpnCuYWzvT0qOPTl9RNVaW9VVjHouJ9Fg+s2DrShXDegFabl1iZEDdI4xScHoYBob06A5lw0WOCTayzw0Naf37lM8Y4psRAmI46XLiF/Vbuorna4hcChxDePlNLEfMipICcuxTcei1RBSlBa2t1tcnvoTy6cuYDqqImRYjp1KnMKlKQBnQ1NjS2TsRGm+F0FbreVCECgYEA4IDJlm8q/hVyNcPe4OzIcL1rsdYN3bNm2Y2O/YtRPIkQ446ItyxD06d9VuXsQpFp9jNACAPfCMSyHpPApqlxdc8z/xATlgHkcGezEOd1r4E7NdTpGg8y6Rj9b8kVlED6v4grbRhKcU6moyKUQT3+1B6ENZTOKyxuyDEgTwZHtFECgYEA0fqdv9h9s77d6eWmIioP7FSymq93pC4umxf6TVicpjpMErdD2ZfJGulN37dq8FOsOFnSmFYJdICj/PbJm6p1i8O21lsFCltEqVoVabJ7/0alPfdG2U76OeBqI8ZubL4BMnWXAB/VVEYbyWCNpQSDTjHQYs54qa2I0dJB7OgJt1sCgYEArctFQ02/7H5Rscl1yo3DBXO94SeiCFSPdC8f2Kt3MfOxvVdkAtkjkMACSbkoUsgbTVqTYSEOEc2jTgR3iQ13JgpHaFbbsq64V0QP3TAxbLIQUjYGVgQaF1UfLOBv8hrzgj45z/ST/G80lOl595+0nCUbmBcgG1AEWrmdF0/3RmECgYAKvIzKXXB3+19vcT2ga5Qq2l3TiPtOGsppRb2XrNs9qKdxIYvHmXo/9QP1V3SRW0XoD7ez8FpFabp42cmPOxUNk3FK3paQZABLxH5pzCWI9PzIAVfPDrm+sdnbgG7vAnwfL2IMMJSA3aDYGCbF9EgefG+STcpfqq7fQ6f5TBgLFwKBgCd7gn1xYL696SaKVSm7VngpXlczHVEpz3kStWR5gfzriPBxXgMVcWmcbajRser7ARpCEfbxM1UJyv6oAYZWVSNErNzNVb4POqLYcCNySuC6xKhs9FrEQnyKjyk8wI4VnrEMGrQ8e+qYSwYk9Gh6dKGoRMAPYVXQAO0fIsHF/T0a"
33
32
  ciphertext_b64 = "VocBRhpMmQ2XCzVehWSqheQLnU889gf3dhU4AnVnQTJjsKx/CM23qKDPkZDd2A/BnQsp99SN7ksIX5Raj0TPwyN5OCN/YrNFNGoOFlTsGhgP/hyE8X3Duiq6sNO0SMvRYNPFFGlJFsp1Fw3Z94eYMg4/Wpw5s4+Jo5Zm/qY7aTJIqDKDQ3CNHLeJgcMUOc9sz01/GzoUYKDVODHSxrYEk5ireFJFz9vP8P7Ha+VDUZuQIQdXer9NBbGFtYmWprY3nn4D3Dw93Sn0V0dIqYeIo91oKyslvMebmUM95S2PyIJdEpPb2DJDxjvX/0LLwSWlSXRWy9gapWoBkb4ynqZBsg=="
34
- value = b'data to sign'
33
+ value = b"data to sign"
35
34
 
36
- with MongoCryptBinaryIn(b'1' * 256) as output, \
37
- MongoCryptBinaryIn(base64.b64decode(key_b64)) as key,\
38
- MongoCryptBinaryIn(value) as value:
35
+ with MongoCryptBinaryIn(b"1" * 256) as output, MongoCryptBinaryIn(
36
+ base64.b64decode(key_b64)
37
+ ) as key, MongoCryptBinaryIn(value) as value:
39
38
  retval = sign_rsaes_pkcs1_v1_5(
40
- ffi.NULL, key.bin, value.bin, output.bin,
41
- lib.mongocrypt_status_new())
39
+ ffi.NULL, key.bin, value.bin, output.bin, lib.mongocrypt_status_new()
40
+ )
42
41
 
43
42
  self.assertTrue(retval)
44
- self.assertEqual(
45
- output.to_bytes(), base64.b64decode(ciphertext_b64))
43
+ self.assertEqual(output.to_bytes(), base64.b64decode(ciphertext_b64))
46
44
 
47
45
 
48
46
  if __name__ == "__main__":