@pairling/runtime-darwin-arm64 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/bin/pairling-connectd +0 -0
  2. package/manifest.json +4 -4
  3. package/package.json +1 -1
  4. package/python/bin/python3 +0 -0
  5. package/python/bin/python3.12 +0 -0
  6. package/python/lib/libpython3.12.dylib +0 -0
  7. package/python/lib/python3.12/__pycache__/__future__.cpython-312.pyc +0 -0
  8. package/python/lib/python3.12/__pycache__/_compression.cpython-312.pyc +0 -0
  9. package/python/lib/python3.12/__pycache__/_weakrefset.cpython-312.pyc +0 -0
  10. package/python/lib/python3.12/__pycache__/base64.cpython-312.pyc +0 -0
  11. package/python/lib/python3.12/__pycache__/bisect.cpython-312.pyc +0 -0
  12. package/python/lib/python3.12/__pycache__/bz2.cpython-312.pyc +0 -0
  13. package/python/lib/python3.12/__pycache__/calendar.cpython-312.pyc +0 -0
  14. package/python/lib/python3.12/__pycache__/contextlib.cpython-312.pyc +0 -0
  15. package/python/lib/python3.12/__pycache__/copyreg.cpython-312.pyc +0 -0
  16. package/python/lib/python3.12/__pycache__/datetime.cpython-312.pyc +0 -0
  17. package/python/lib/python3.12/__pycache__/enum.cpython-312.pyc +0 -0
  18. package/python/lib/python3.12/__pycache__/fnmatch.cpython-312.pyc +0 -0
  19. package/python/lib/python3.12/__pycache__/functools.cpython-312.pyc +0 -0
  20. package/python/lib/python3.12/__pycache__/hashlib.cpython-312.pyc +0 -0
  21. package/python/lib/python3.12/__pycache__/hmac.cpython-312.pyc +0 -0
  22. package/python/lib/python3.12/__pycache__/ipaddress.cpython-312.pyc +0 -0
  23. package/python/lib/python3.12/__pycache__/keyword.cpython-312.pyc +0 -0
  24. package/python/lib/python3.12/__pycache__/locale.cpython-312.pyc +0 -0
  25. package/python/lib/python3.12/__pycache__/lzma.cpython-312.pyc +0 -0
  26. package/python/lib/python3.12/__pycache__/operator.cpython-312.pyc +0 -0
  27. package/python/lib/python3.12/__pycache__/plistlib.cpython-312.pyc +0 -0
  28. package/python/lib/python3.12/__pycache__/pty.cpython-312.pyc +0 -0
  29. package/python/lib/python3.12/__pycache__/quopri.cpython-312.pyc +0 -0
  30. package/python/lib/python3.12/__pycache__/random.cpython-312.pyc +0 -0
  31. package/python/lib/python3.12/__pycache__/reprlib.cpython-312.pyc +0 -0
  32. package/python/lib/python3.12/__pycache__/selectors.cpython-312.pyc +0 -0
  33. package/python/lib/python3.12/__pycache__/shutil.cpython-312.pyc +0 -0
  34. package/python/lib/python3.12/__pycache__/signal.cpython-312.pyc +0 -0
  35. package/python/lib/python3.12/__pycache__/socket.cpython-312.pyc +0 -0
  36. package/python/lib/python3.12/__pycache__/ssl.cpython-312.pyc +0 -0
  37. package/python/lib/python3.12/__pycache__/string.cpython-312.pyc +0 -0
  38. package/python/lib/python3.12/__pycache__/struct.cpython-312.pyc +0 -0
  39. package/python/lib/python3.12/__pycache__/subprocess.cpython-312.pyc +0 -0
  40. package/python/lib/python3.12/__pycache__/tempfile.cpython-312.pyc +0 -0
  41. package/python/lib/python3.12/__pycache__/threading.cpython-312.pyc +0 -0
  42. package/python/lib/python3.12/__pycache__/tty.cpython-312.pyc +0 -0
  43. package/python/lib/python3.12/__pycache__/types.cpython-312.pyc +0 -0
  44. package/python/lib/python3.12/__pycache__/typing.cpython-312.pyc +0 -0
  45. package/python/lib/python3.12/__pycache__/warnings.cpython-312.pyc +0 -0
  46. package/python/lib/python3.12/__pycache__/weakref.cpython-312.pyc +0 -0
  47. package/python/lib/python3.12/collections/__pycache__/__init__.cpython-312.pyc +0 -0
  48. package/python/lib/python3.12/collections/__pycache__/abc.cpython-312.pyc +0 -0
  49. package/python/lib/python3.12/email/__pycache__/__init__.cpython-312.pyc +0 -0
  50. package/python/lib/python3.12/email/__pycache__/_encoded_words.cpython-312.pyc +0 -0
  51. package/python/lib/python3.12/email/__pycache__/_parseaddr.cpython-312.pyc +0 -0
  52. package/python/lib/python3.12/email/__pycache__/_policybase.cpython-312.pyc +0 -0
  53. package/python/lib/python3.12/email/__pycache__/base64mime.cpython-312.pyc +0 -0
  54. package/python/lib/python3.12/email/__pycache__/charset.cpython-312.pyc +0 -0
  55. package/python/lib/python3.12/email/__pycache__/encoders.cpython-312.pyc +0 -0
  56. package/python/lib/python3.12/email/__pycache__/errors.cpython-312.pyc +0 -0
  57. package/python/lib/python3.12/email/__pycache__/feedparser.cpython-312.pyc +0 -0
  58. package/python/lib/python3.12/email/__pycache__/header.cpython-312.pyc +0 -0
  59. package/python/lib/python3.12/email/__pycache__/iterators.cpython-312.pyc +0 -0
  60. package/python/lib/python3.12/email/__pycache__/message.cpython-312.pyc +0 -0
  61. package/python/lib/python3.12/email/__pycache__/parser.cpython-312.pyc +0 -0
  62. package/python/lib/python3.12/email/__pycache__/quoprimime.cpython-312.pyc +0 -0
  63. package/python/lib/python3.12/email/__pycache__/utils.cpython-312.pyc +0 -0
  64. package/python/lib/python3.12/encodings/__pycache__/__init__.cpython-312.pyc +0 -0
  65. package/python/lib/python3.12/encodings/__pycache__/aliases.cpython-312.pyc +0 -0
  66. package/python/lib/python3.12/encodings/__pycache__/utf_8.cpython-312.pyc +0 -0
  67. package/python/lib/python3.12/http/__pycache__/__init__.cpython-312.pyc +0 -0
  68. package/python/lib/python3.12/http/__pycache__/client.cpython-312.pyc +0 -0
  69. package/python/lib/python3.12/json/__pycache__/__init__.cpython-312.pyc +0 -0
  70. package/python/lib/python3.12/json/__pycache__/decoder.cpython-312.pyc +0 -0
  71. package/python/lib/python3.12/json/__pycache__/encoder.cpython-312.pyc +0 -0
  72. package/python/lib/python3.12/json/__pycache__/scanner.cpython-312.pyc +0 -0
  73. package/python/lib/python3.12/lib-dynload/_crypt.cpython-312-darwin.so +0 -0
  74. package/python/lib/python3.12/lib-dynload/_dbm.cpython-312-darwin.so +0 -0
  75. package/python/lib/python3.12/re/__pycache__/__init__.cpython-312.pyc +0 -0
  76. package/python/lib/python3.12/re/__pycache__/_casefix.cpython-312.pyc +0 -0
  77. package/python/lib/python3.12/re/__pycache__/_compiler.cpython-312.pyc +0 -0
  78. package/python/lib/python3.12/re/__pycache__/_constants.cpython-312.pyc +0 -0
  79. package/python/lib/python3.12/re/__pycache__/_parser.cpython-312.pyc +0 -0
  80. package/python/lib/python3.12/site-packages/_cffi_backend.cpython-312-darwin.so +0 -0
  81. package/python/lib/python3.12/site-packages/cffi/__init__.py +14 -0
  82. package/python/lib/python3.12/site-packages/cffi/__pycache__/__init__.cpython-312.pyc +0 -0
  83. package/python/lib/python3.12/site-packages/cffi/__pycache__/api.cpython-312.pyc +0 -0
  84. package/python/lib/python3.12/site-packages/cffi/__pycache__/error.cpython-312.pyc +0 -0
  85. package/python/lib/python3.12/site-packages/cffi/__pycache__/lock.cpython-312.pyc +0 -0
  86. package/python/lib/python3.12/site-packages/cffi/__pycache__/model.cpython-312.pyc +0 -0
  87. package/python/lib/python3.12/site-packages/cffi/_cffi_errors.h +149 -0
  88. package/python/lib/python3.12/site-packages/cffi/_cffi_include.h +389 -0
  89. package/python/lib/python3.12/site-packages/cffi/_embedding.h +550 -0
  90. package/python/lib/python3.12/site-packages/cffi/_imp_emulation.py +83 -0
  91. package/python/lib/python3.12/site-packages/cffi/_shimmed_dist_utils.py +45 -0
  92. package/python/lib/python3.12/site-packages/cffi/api.py +967 -0
  93. package/python/lib/python3.12/site-packages/cffi/backend_ctypes.py +1121 -0
  94. package/python/lib/python3.12/site-packages/cffi/cffi_opcode.py +187 -0
  95. package/python/lib/python3.12/site-packages/cffi/commontypes.py +82 -0
  96. package/python/lib/python3.12/site-packages/cffi/cparser.py +1015 -0
  97. package/python/lib/python3.12/site-packages/cffi/error.py +31 -0
  98. package/python/lib/python3.12/site-packages/cffi/ffiplatform.py +113 -0
  99. package/python/lib/python3.12/site-packages/cffi/lock.py +30 -0
  100. package/python/lib/python3.12/site-packages/cffi/model.py +618 -0
  101. package/python/lib/python3.12/site-packages/cffi/parse_c_type.h +181 -0
  102. package/python/lib/python3.12/site-packages/cffi/pkgconfig.py +121 -0
  103. package/python/lib/python3.12/site-packages/cffi/recompiler.py +1598 -0
  104. package/python/lib/python3.12/site-packages/cffi/setuptools_ext.py +229 -0
  105. package/python/lib/python3.12/site-packages/cffi/vengine_cpy.py +1087 -0
  106. package/python/lib/python3.12/site-packages/cffi/vengine_gen.py +679 -0
  107. package/python/lib/python3.12/site-packages/cffi/verifier.py +306 -0
  108. package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/INSTALLER +1 -0
  109. package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/METADATA +68 -0
  110. package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/RECORD +31 -0
  111. package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/WHEEL +6 -0
  112. package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/entry_points.txt +2 -0
  113. package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/licenses/AUTHORS +8 -0
  114. package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/licenses/LICENSE +23 -0
  115. package/python/lib/python3.12/site-packages/cffi-2.0.0.dist-info/top_level.txt +2 -0
  116. package/python/lib/python3.12/site-packages/cryptography/__about__.py +17 -0
  117. package/python/lib/python3.12/site-packages/cryptography/__init__.py +26 -0
  118. package/python/lib/python3.12/site-packages/cryptography/__pycache__/__about__.cpython-312.pyc +0 -0
  119. package/python/lib/python3.12/site-packages/cryptography/__pycache__/__init__.cpython-312.pyc +0 -0
  120. package/python/lib/python3.12/site-packages/cryptography/__pycache__/utils.cpython-312.pyc +0 -0
  121. package/python/lib/python3.12/site-packages/cryptography/exceptions.py +52 -0
  122. package/python/lib/python3.12/site-packages/cryptography/fernet.py +224 -0
  123. package/python/lib/python3.12/site-packages/cryptography/hazmat/__init__.py +13 -0
  124. package/python/lib/python3.12/site-packages/cryptography/hazmat/_oid.py +348 -0
  125. package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/__init__.py +13 -0
  126. package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/openssl/__init__.py +9 -0
  127. package/python/lib/python3.12/site-packages/cryptography/hazmat/backends/openssl/backend.py +308 -0
  128. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/__init__.py +3 -0
  129. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/__init__.pyi +37 -0
  130. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/_openssl.pyi +8 -0
  131. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/asn1.pyi +7 -0
  132. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/exceptions.pyi +17 -0
  133. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/ocsp.pyi +117 -0
  134. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/__init__.pyi +75 -0
  135. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/aead.pyi +107 -0
  136. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ciphers.pyi +38 -0
  137. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/cmac.pyi +18 -0
  138. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/dh.pyi +51 -0
  139. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/dsa.pyi +41 -0
  140. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ec.pyi +52 -0
  141. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed25519.pyi +13 -0
  142. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/ed448.pyi +13 -0
  143. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/hashes.pyi +28 -0
  144. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/hmac.pyi +22 -0
  145. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/kdf.pyi +49 -0
  146. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/keys.pyi +34 -0
  147. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/poly1305.pyi +15 -0
  148. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/rsa.pyi +55 -0
  149. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/x25519.pyi +13 -0
  150. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/openssl/x448.pyi +13 -0
  151. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/pkcs12.pyi +52 -0
  152. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/pkcs7.pyi +50 -0
  153. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/test_support.pyi +23 -0
  154. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust/x509.pyi +313 -0
  155. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/_rust.abi3.so +0 -0
  156. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/__init__.py +3 -0
  157. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/_conditional.py +191 -0
  158. package/python/lib/python3.12/site-packages/cryptography/hazmat/bindings/openssl/binding.py +122 -0
  159. package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/__init__.py +5 -0
  160. package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/ciphers/__init__.py +5 -0
  161. package/python/lib/python3.12/site-packages/cryptography/hazmat/decrepit/ciphers/algorithms.py +112 -0
  162. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/__init__.py +3 -0
  163. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_asymmetric.py +19 -0
  164. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_cipheralgorithm.py +60 -0
  165. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/_serialization.py +168 -0
  166. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/__init__.py +3 -0
  167. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/dh.py +147 -0
  168. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/dsa.py +167 -0
  169. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ec.py +447 -0
  170. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ed25519.py +129 -0
  171. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/ed448.py +131 -0
  172. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/padding.py +113 -0
  173. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/rsa.py +277 -0
  174. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/types.py +111 -0
  175. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/utils.py +24 -0
  176. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/x25519.py +122 -0
  177. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/asymmetric/x448.py +125 -0
  178. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/__init__.py +27 -0
  179. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/aead.py +23 -0
  180. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py +183 -0
  181. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/base.py +146 -0
  182. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/ciphers/modes.py +268 -0
  183. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/cmac.py +10 -0
  184. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/constant_time.py +14 -0
  185. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/hashes.py +246 -0
  186. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/hmac.py +13 -0
  187. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/__init__.py +23 -0
  188. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/argon2.py +13 -0
  189. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/concatkdf.py +125 -0
  190. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/hkdf.py +101 -0
  191. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.py +305 -0
  192. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/pbkdf2.py +62 -0
  193. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/scrypt.py +19 -0
  194. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/kdf/x963kdf.py +61 -0
  195. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/keywrap.py +177 -0
  196. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/padding.py +69 -0
  197. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/poly1305.py +11 -0
  198. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/__init__.py +65 -0
  199. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/base.py +14 -0
  200. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/pkcs12.py +176 -0
  201. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/pkcs7.py +411 -0
  202. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/serialization/ssh.py +1619 -0
  203. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/__init__.py +9 -0
  204. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/hotp.py +101 -0
  205. package/python/lib/python3.12/site-packages/cryptography/hazmat/primitives/twofactor/totp.py +56 -0
  206. package/python/lib/python3.12/site-packages/cryptography/py.typed +0 -0
  207. package/python/lib/python3.12/site-packages/cryptography/utils.py +139 -0
  208. package/python/lib/python3.12/site-packages/cryptography/x509/__init__.py +270 -0
  209. package/python/lib/python3.12/site-packages/cryptography/x509/base.py +848 -0
  210. package/python/lib/python3.12/site-packages/cryptography/x509/certificate_transparency.py +35 -0
  211. package/python/lib/python3.12/site-packages/cryptography/x509/extensions.py +2528 -0
  212. package/python/lib/python3.12/site-packages/cryptography/x509/general_name.py +281 -0
  213. package/python/lib/python3.12/site-packages/cryptography/x509/name.py +477 -0
  214. package/python/lib/python3.12/site-packages/cryptography/x509/ocsp.py +379 -0
  215. package/python/lib/python3.12/site-packages/cryptography/x509/oid.py +37 -0
  216. package/python/lib/python3.12/site-packages/cryptography/x509/verification.py +34 -0
  217. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/INSTALLER +1 -0
  218. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/METADATA +139 -0
  219. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/RECORD +106 -0
  220. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/REQUESTED +0 -0
  221. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/WHEEL +4 -0
  222. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE +3 -0
  223. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE.APACHE +202 -0
  224. package/python/lib/python3.12/site-packages/cryptography-45.0.7.dist-info/licenses/LICENSE.BSD +27 -0
  225. package/python/lib/python3.12/site-packages/pycparser/__init__.py +99 -0
  226. package/python/lib/python3.12/site-packages/pycparser/_ast_gen.py +355 -0
  227. package/python/lib/python3.12/site-packages/pycparser/_c_ast.cfg +195 -0
  228. package/python/lib/python3.12/site-packages/pycparser/ast_transforms.py +174 -0
  229. package/python/lib/python3.12/site-packages/pycparser/c_ast.py +1341 -0
  230. package/python/lib/python3.12/site-packages/pycparser/c_generator.py +573 -0
  231. package/python/lib/python3.12/site-packages/pycparser/c_lexer.py +706 -0
  232. package/python/lib/python3.12/site-packages/pycparser/c_parser.py +2376 -0
  233. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/INSTALLER +1 -0
  234. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/METADATA +244 -0
  235. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/RECORD +14 -0
  236. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/WHEEL +5 -0
  237. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/licenses/LICENSE +27 -0
  238. package/python/lib/python3.12/site-packages/pycparser-3.0.dist-info/top_level.txt +1 -0
  239. package/python/lib/python3.12/sqlite3/__pycache__/__init__.cpython-312.pyc +0 -0
  240. package/python/lib/python3.12/sqlite3/__pycache__/dbapi2.cpython-312.pyc +0 -0
  241. package/python/lib/python3.12/urllib/__pycache__/__init__.cpython-312.pyc +0 -0
  242. package/python/lib/python3.12/urllib/__pycache__/error.cpython-312.pyc +0 -0
  243. package/python/lib/python3.12/urllib/__pycache__/parse.cpython-312.pyc +0 -0
  244. package/python/lib/python3.12/urllib/__pycache__/request.cpython-312.pyc +0 -0
  245. package/python/lib/python3.12/urllib/__pycache__/response.cpython-312.pyc +0 -0
  246. package/python/lib/python3.12/xml/__pycache__/__init__.cpython-312.pyc +0 -0
  247. package/python/lib/python3.12/xml/parsers/__pycache__/__init__.cpython-312.pyc +0 -0
  248. package/python/lib/python3.12/xml/parsers/__pycache__/expat.cpython-312.pyc +0 -0
@@ -0,0 +1,125 @@
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ from __future__ import annotations
6
+
7
+ import typing
8
+ from collections.abc import Callable
9
+
10
+ from cryptography import utils
11
+ from cryptography.exceptions import AlreadyFinalized, InvalidKey
12
+ from cryptography.hazmat.primitives import constant_time, hashes, hmac
13
+ from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
14
+
15
+
16
+ def _int_to_u32be(n: int) -> bytes:
17
+ return n.to_bytes(length=4, byteorder="big")
18
+
19
+
20
+ def _common_args_checks(
21
+ algorithm: hashes.HashAlgorithm,
22
+ length: int,
23
+ otherinfo: bytes | None,
24
+ ) -> None:
25
+ max_length = algorithm.digest_size * (2**32 - 1)
26
+ if length > max_length:
27
+ raise ValueError(f"Cannot derive keys larger than {max_length} bits.")
28
+ if otherinfo is not None:
29
+ utils._check_bytes("otherinfo", otherinfo)
30
+
31
+
32
+ def _concatkdf_derive(
33
+ key_material: utils.Buffer,
34
+ length: int,
35
+ auxfn: Callable[[], hashes.HashContext],
36
+ otherinfo: bytes,
37
+ ) -> bytes:
38
+ utils._check_byteslike("key_material", key_material)
39
+ output = [b""]
40
+ outlen = 0
41
+ counter = 1
42
+
43
+ while length > outlen:
44
+ h = auxfn()
45
+ h.update(_int_to_u32be(counter))
46
+ h.update(key_material)
47
+ h.update(otherinfo)
48
+ output.append(h.finalize())
49
+ outlen += len(output[-1])
50
+ counter += 1
51
+
52
+ return b"".join(output)[:length]
53
+
54
+
55
+ class ConcatKDFHash(KeyDerivationFunction):
56
+ def __init__(
57
+ self,
58
+ algorithm: hashes.HashAlgorithm,
59
+ length: int,
60
+ otherinfo: bytes | None,
61
+ backend: typing.Any = None,
62
+ ):
63
+ _common_args_checks(algorithm, length, otherinfo)
64
+ self._algorithm = algorithm
65
+ self._length = length
66
+ self._otherinfo: bytes = otherinfo if otherinfo is not None else b""
67
+
68
+ self._used = False
69
+
70
+ def _hash(self) -> hashes.Hash:
71
+ return hashes.Hash(self._algorithm)
72
+
73
+ def derive(self, key_material: utils.Buffer) -> bytes:
74
+ if self._used:
75
+ raise AlreadyFinalized
76
+ self._used = True
77
+ return _concatkdf_derive(
78
+ key_material, self._length, self._hash, self._otherinfo
79
+ )
80
+
81
+ def verify(self, key_material: bytes, expected_key: bytes) -> None:
82
+ if not constant_time.bytes_eq(self.derive(key_material), expected_key):
83
+ raise InvalidKey
84
+
85
+
86
+ class ConcatKDFHMAC(KeyDerivationFunction):
87
+ def __init__(
88
+ self,
89
+ algorithm: hashes.HashAlgorithm,
90
+ length: int,
91
+ salt: bytes | None,
92
+ otherinfo: bytes | None,
93
+ backend: typing.Any = None,
94
+ ):
95
+ _common_args_checks(algorithm, length, otherinfo)
96
+ self._algorithm = algorithm
97
+ self._length = length
98
+ self._otherinfo: bytes = otherinfo if otherinfo is not None else b""
99
+
100
+ if algorithm.block_size is None:
101
+ raise TypeError(f"{algorithm.name} is unsupported for ConcatKDF")
102
+
103
+ if salt is None:
104
+ salt = b"\x00" * algorithm.block_size
105
+ else:
106
+ utils._check_bytes("salt", salt)
107
+
108
+ self._salt = salt
109
+
110
+ self._used = False
111
+
112
+ def _hmac(self) -> hmac.HMAC:
113
+ return hmac.HMAC(self._salt, self._algorithm)
114
+
115
+ def derive(self, key_material: utils.Buffer) -> bytes:
116
+ if self._used:
117
+ raise AlreadyFinalized
118
+ self._used = True
119
+ return _concatkdf_derive(
120
+ key_material, self._length, self._hmac, self._otherinfo
121
+ )
122
+
123
+ def verify(self, key_material: bytes, expected_key: bytes) -> None:
124
+ if not constant_time.bytes_eq(self.derive(key_material), expected_key):
125
+ raise InvalidKey
@@ -0,0 +1,101 @@
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ from __future__ import annotations
6
+
7
+ import typing
8
+
9
+ from cryptography import utils
10
+ from cryptography.exceptions import AlreadyFinalized, InvalidKey
11
+ from cryptography.hazmat.primitives import constant_time, hashes, hmac
12
+ from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
13
+
14
+
15
+ class HKDF(KeyDerivationFunction):
16
+ def __init__(
17
+ self,
18
+ algorithm: hashes.HashAlgorithm,
19
+ length: int,
20
+ salt: bytes | None,
21
+ info: bytes | None,
22
+ backend: typing.Any = None,
23
+ ):
24
+ self._algorithm = algorithm
25
+
26
+ if salt is None:
27
+ salt = b"\x00" * self._algorithm.digest_size
28
+ else:
29
+ utils._check_bytes("salt", salt)
30
+
31
+ self._salt = salt
32
+
33
+ self._hkdf_expand = HKDFExpand(self._algorithm, length, info)
34
+
35
+ def _extract(self, key_material: utils.Buffer) -> bytes:
36
+ h = hmac.HMAC(self._salt, self._algorithm)
37
+ h.update(key_material)
38
+ return h.finalize()
39
+
40
+ def derive(self, key_material: utils.Buffer) -> bytes:
41
+ utils._check_byteslike("key_material", key_material)
42
+ return self._hkdf_expand.derive(self._extract(key_material))
43
+
44
+ def verify(self, key_material: bytes, expected_key: bytes) -> None:
45
+ if not constant_time.bytes_eq(self.derive(key_material), expected_key):
46
+ raise InvalidKey
47
+
48
+
49
+ class HKDFExpand(KeyDerivationFunction):
50
+ def __init__(
51
+ self,
52
+ algorithm: hashes.HashAlgorithm,
53
+ length: int,
54
+ info: bytes | None,
55
+ backend: typing.Any = None,
56
+ ):
57
+ self._algorithm = algorithm
58
+
59
+ max_length = 255 * algorithm.digest_size
60
+
61
+ if length > max_length:
62
+ raise ValueError(
63
+ f"Cannot derive keys larger than {max_length} octets."
64
+ )
65
+
66
+ self._length = length
67
+
68
+ if info is None:
69
+ info = b""
70
+ else:
71
+ utils._check_bytes("info", info)
72
+
73
+ self._info = info
74
+
75
+ self._used = False
76
+
77
+ def _expand(self, key_material: utils.Buffer) -> bytes:
78
+ output = [b""]
79
+ counter = 1
80
+
81
+ while self._algorithm.digest_size * (len(output) - 1) < self._length:
82
+ h = hmac.HMAC(key_material, self._algorithm)
83
+ h.update(output[-1])
84
+ h.update(self._info)
85
+ h.update(bytes([counter]))
86
+ output.append(h.finalize())
87
+ counter += 1
88
+
89
+ return b"".join(output)[: self._length]
90
+
91
+ def derive(self, key_material: utils.Buffer) -> bytes:
92
+ utils._check_byteslike("key_material", key_material)
93
+ if self._used:
94
+ raise AlreadyFinalized
95
+
96
+ self._used = True
97
+ return self._expand(key_material)
98
+
99
+ def verify(self, key_material: bytes, expected_key: bytes) -> None:
100
+ if not constant_time.bytes_eq(self.derive(key_material), expected_key):
101
+ raise InvalidKey
@@ -0,0 +1,305 @@
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ from __future__ import annotations
6
+
7
+ import typing
8
+ from collections.abc import Callable
9
+
10
+ from cryptography import utils
11
+ from cryptography.exceptions import (
12
+ AlreadyFinalized,
13
+ InvalidKey,
14
+ UnsupportedAlgorithm,
15
+ _Reasons,
16
+ )
17
+ from cryptography.hazmat.primitives import (
18
+ ciphers,
19
+ cmac,
20
+ constant_time,
21
+ hashes,
22
+ hmac,
23
+ )
24
+ from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
25
+
26
+
27
+ class Mode(utils.Enum):
28
+ CounterMode = "ctr"
29
+
30
+
31
+ class CounterLocation(utils.Enum):
32
+ BeforeFixed = "before_fixed"
33
+ AfterFixed = "after_fixed"
34
+ MiddleFixed = "middle_fixed"
35
+
36
+
37
+ class _KBKDFDeriver:
38
+ def __init__(
39
+ self,
40
+ prf: Callable,
41
+ mode: Mode,
42
+ length: int,
43
+ rlen: int,
44
+ llen: int | None,
45
+ location: CounterLocation,
46
+ break_location: int | None,
47
+ label: bytes | None,
48
+ context: bytes | None,
49
+ fixed: bytes | None,
50
+ ):
51
+ assert callable(prf)
52
+
53
+ if not isinstance(mode, Mode):
54
+ raise TypeError("mode must be of type Mode")
55
+
56
+ if not isinstance(location, CounterLocation):
57
+ raise TypeError("location must be of type CounterLocation")
58
+
59
+ if break_location is None and location is CounterLocation.MiddleFixed:
60
+ raise ValueError("Please specify a break_location")
61
+
62
+ if (
63
+ break_location is not None
64
+ and location != CounterLocation.MiddleFixed
65
+ ):
66
+ raise ValueError(
67
+ "break_location is ignored when location is not"
68
+ " CounterLocation.MiddleFixed"
69
+ )
70
+
71
+ if break_location is not None and not isinstance(break_location, int):
72
+ raise TypeError("break_location must be an integer")
73
+
74
+ if break_location is not None and break_location < 0:
75
+ raise ValueError("break_location must be a positive integer")
76
+
77
+ if (label or context) and fixed:
78
+ raise ValueError(
79
+ "When supplying fixed data, label and context are ignored."
80
+ )
81
+
82
+ if rlen is None or not self._valid_byte_length(rlen):
83
+ raise ValueError("rlen must be between 1 and 4")
84
+
85
+ if llen is None and fixed is None:
86
+ raise ValueError("Please specify an llen")
87
+
88
+ if llen is not None and not isinstance(llen, int):
89
+ raise TypeError("llen must be an integer")
90
+
91
+ if llen == 0:
92
+ raise ValueError("llen must be non-zero")
93
+
94
+ if label is None:
95
+ label = b""
96
+
97
+ if context is None:
98
+ context = b""
99
+
100
+ utils._check_bytes("label", label)
101
+ utils._check_bytes("context", context)
102
+ self._prf = prf
103
+ self._mode = mode
104
+ self._length = length
105
+ self._rlen = rlen
106
+ self._llen = llen
107
+ self._location = location
108
+ self._break_location = break_location
109
+ self._label = label
110
+ self._context = context
111
+ self._used = False
112
+ self._fixed_data = fixed
113
+
114
+ @staticmethod
115
+ def _valid_byte_length(value: int) -> bool:
116
+ if not isinstance(value, int):
117
+ raise TypeError("value must be of type int")
118
+
119
+ value_bin = utils.int_to_bytes(1, value)
120
+ if not 1 <= len(value_bin) <= 4:
121
+ return False
122
+ return True
123
+
124
+ def derive(
125
+ self, key_material: utils.Buffer, prf_output_size: int
126
+ ) -> bytes:
127
+ if self._used:
128
+ raise AlreadyFinalized
129
+
130
+ utils._check_byteslike("key_material", key_material)
131
+ self._used = True
132
+
133
+ # inverse floor division (equivalent to ceiling)
134
+ rounds = -(-self._length // prf_output_size)
135
+
136
+ output = [b""]
137
+
138
+ # For counter mode, the number of iterations shall not be
139
+ # larger than 2^r-1, where r <= 32 is the binary length of the counter
140
+ # This ensures that the counter values used as an input to the
141
+ # PRF will not repeat during a particular call to the KDF function.
142
+ r_bin = utils.int_to_bytes(1, self._rlen)
143
+ if rounds > pow(2, len(r_bin) * 8) - 1:
144
+ raise ValueError("There are too many iterations.")
145
+
146
+ fixed = self._generate_fixed_input()
147
+
148
+ if self._location == CounterLocation.BeforeFixed:
149
+ data_before_ctr = b""
150
+ data_after_ctr = fixed
151
+ elif self._location == CounterLocation.AfterFixed:
152
+ data_before_ctr = fixed
153
+ data_after_ctr = b""
154
+ else:
155
+ if isinstance(
156
+ self._break_location, int
157
+ ) and self._break_location > len(fixed):
158
+ raise ValueError("break_location offset > len(fixed)")
159
+ data_before_ctr = fixed[: self._break_location]
160
+ data_after_ctr = fixed[self._break_location :]
161
+
162
+ for i in range(1, rounds + 1):
163
+ h = self._prf(key_material)
164
+
165
+ counter = utils.int_to_bytes(i, self._rlen)
166
+ input_data = data_before_ctr + counter + data_after_ctr
167
+
168
+ h.update(input_data)
169
+
170
+ output.append(h.finalize())
171
+
172
+ return b"".join(output)[: self._length]
173
+
174
+ def _generate_fixed_input(self) -> bytes:
175
+ if self._fixed_data and isinstance(self._fixed_data, bytes):
176
+ return self._fixed_data
177
+
178
+ l_val = utils.int_to_bytes(self._length * 8, self._llen)
179
+
180
+ return b"".join([self._label, b"\x00", self._context, l_val])
181
+
182
+
183
+ class KBKDFHMAC(KeyDerivationFunction):
184
+ def __init__(
185
+ self,
186
+ algorithm: hashes.HashAlgorithm,
187
+ mode: Mode,
188
+ length: int,
189
+ rlen: int,
190
+ llen: int | None,
191
+ location: CounterLocation,
192
+ label: bytes | None,
193
+ context: bytes | None,
194
+ fixed: bytes | None,
195
+ backend: typing.Any = None,
196
+ *,
197
+ break_location: int | None = None,
198
+ ):
199
+ if not isinstance(algorithm, hashes.HashAlgorithm):
200
+ raise UnsupportedAlgorithm(
201
+ "Algorithm supplied is not a supported hash algorithm.",
202
+ _Reasons.UNSUPPORTED_HASH,
203
+ )
204
+
205
+ from cryptography.hazmat.backends.openssl.backend import (
206
+ backend as ossl,
207
+ )
208
+
209
+ if not ossl.hmac_supported(algorithm):
210
+ raise UnsupportedAlgorithm(
211
+ "Algorithm supplied is not a supported hmac algorithm.",
212
+ _Reasons.UNSUPPORTED_HASH,
213
+ )
214
+
215
+ self._algorithm = algorithm
216
+
217
+ self._deriver = _KBKDFDeriver(
218
+ self._prf,
219
+ mode,
220
+ length,
221
+ rlen,
222
+ llen,
223
+ location,
224
+ break_location,
225
+ label,
226
+ context,
227
+ fixed,
228
+ )
229
+
230
+ def _prf(self, key_material: bytes) -> hmac.HMAC:
231
+ return hmac.HMAC(key_material, self._algorithm)
232
+
233
+ def derive(self, key_material: utils.Buffer) -> bytes:
234
+ return self._deriver.derive(key_material, self._algorithm.digest_size)
235
+
236
+ def verify(self, key_material: bytes, expected_key: bytes) -> None:
237
+ if not constant_time.bytes_eq(self.derive(key_material), expected_key):
238
+ raise InvalidKey
239
+
240
+
241
+ class KBKDFCMAC(KeyDerivationFunction):
242
+ def __init__(
243
+ self,
244
+ algorithm,
245
+ mode: Mode,
246
+ length: int,
247
+ rlen: int,
248
+ llen: int | None,
249
+ location: CounterLocation,
250
+ label: bytes | None,
251
+ context: bytes | None,
252
+ fixed: bytes | None,
253
+ backend: typing.Any = None,
254
+ *,
255
+ break_location: int | None = None,
256
+ ):
257
+ if not issubclass(
258
+ algorithm, ciphers.BlockCipherAlgorithm
259
+ ) or not issubclass(algorithm, ciphers.CipherAlgorithm):
260
+ raise UnsupportedAlgorithm(
261
+ "Algorithm supplied is not a supported cipher algorithm.",
262
+ _Reasons.UNSUPPORTED_CIPHER,
263
+ )
264
+
265
+ self._algorithm = algorithm
266
+ self._cipher: ciphers.BlockCipherAlgorithm | None = None
267
+
268
+ self._deriver = _KBKDFDeriver(
269
+ self._prf,
270
+ mode,
271
+ length,
272
+ rlen,
273
+ llen,
274
+ location,
275
+ break_location,
276
+ label,
277
+ context,
278
+ fixed,
279
+ )
280
+
281
+ def _prf(self, _: bytes) -> cmac.CMAC:
282
+ assert self._cipher is not None
283
+
284
+ return cmac.CMAC(self._cipher)
285
+
286
+ def derive(self, key_material: utils.Buffer) -> bytes:
287
+ self._cipher = self._algorithm(key_material)
288
+
289
+ assert self._cipher is not None
290
+
291
+ from cryptography.hazmat.backends.openssl.backend import (
292
+ backend as ossl,
293
+ )
294
+
295
+ if not ossl.cmac_algorithm_supported(self._cipher):
296
+ raise UnsupportedAlgorithm(
297
+ "Algorithm supplied is not a supported cipher algorithm.",
298
+ _Reasons.UNSUPPORTED_CIPHER,
299
+ )
300
+
301
+ return self._deriver.derive(key_material, self._cipher.block_size // 8)
302
+
303
+ def verify(self, key_material: bytes, expected_key: bytes) -> None:
304
+ if not constant_time.bytes_eq(self.derive(key_material), expected_key):
305
+ raise InvalidKey
@@ -0,0 +1,62 @@
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ from __future__ import annotations
6
+
7
+ import typing
8
+
9
+ from cryptography import utils
10
+ from cryptography.exceptions import (
11
+ AlreadyFinalized,
12
+ InvalidKey,
13
+ UnsupportedAlgorithm,
14
+ _Reasons,
15
+ )
16
+ from cryptography.hazmat.bindings._rust import openssl as rust_openssl
17
+ from cryptography.hazmat.primitives import constant_time, hashes
18
+ from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
19
+
20
+
21
+ class PBKDF2HMAC(KeyDerivationFunction):
22
+ def __init__(
23
+ self,
24
+ algorithm: hashes.HashAlgorithm,
25
+ length: int,
26
+ salt: bytes,
27
+ iterations: int,
28
+ backend: typing.Any = None,
29
+ ):
30
+ from cryptography.hazmat.backends.openssl.backend import (
31
+ backend as ossl,
32
+ )
33
+
34
+ if not ossl.pbkdf2_hmac_supported(algorithm):
35
+ raise UnsupportedAlgorithm(
36
+ f"{algorithm.name} is not supported for PBKDF2.",
37
+ _Reasons.UNSUPPORTED_HASH,
38
+ )
39
+ self._used = False
40
+ self._algorithm = algorithm
41
+ self._length = length
42
+ utils._check_bytes("salt", salt)
43
+ self._salt = salt
44
+ self._iterations = iterations
45
+
46
+ def derive(self, key_material: utils.Buffer) -> bytes:
47
+ if self._used:
48
+ raise AlreadyFinalized("PBKDF2 instances can only be used once.")
49
+ self._used = True
50
+
51
+ return rust_openssl.kdf.derive_pbkdf2_hmac(
52
+ key_material,
53
+ self._algorithm,
54
+ self._salt,
55
+ self._iterations,
56
+ self._length,
57
+ )
58
+
59
+ def verify(self, key_material: bytes, expected_key: bytes) -> None:
60
+ derived_key = self.derive(key_material)
61
+ if not constant_time.bytes_eq(derived_key, expected_key):
62
+ raise InvalidKey("Keys do not match.")
@@ -0,0 +1,19 @@
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ from __future__ import annotations
6
+
7
+ import sys
8
+
9
+ from cryptography.hazmat.bindings._rust import openssl as rust_openssl
10
+ from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
11
+
12
+ # This is used by the scrypt tests to skip tests that require more memory
13
+ # than the MEM_LIMIT
14
+ _MEM_LIMIT = sys.maxsize // 2
15
+
16
+ Scrypt = rust_openssl.kdf.Scrypt
17
+ KeyDerivationFunction.register(Scrypt)
18
+
19
+ __all__ = ["Scrypt"]
@@ -0,0 +1,61 @@
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+
5
+ from __future__ import annotations
6
+
7
+ import typing
8
+
9
+ from cryptography import utils
10
+ from cryptography.exceptions import AlreadyFinalized, InvalidKey
11
+ from cryptography.hazmat.primitives import constant_time, hashes
12
+ from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
13
+
14
+
15
+ def _int_to_u32be(n: int) -> bytes:
16
+ return n.to_bytes(length=4, byteorder="big")
17
+
18
+
19
+ class X963KDF(KeyDerivationFunction):
20
+ def __init__(
21
+ self,
22
+ algorithm: hashes.HashAlgorithm,
23
+ length: int,
24
+ sharedinfo: bytes | None,
25
+ backend: typing.Any = None,
26
+ ):
27
+ max_len = algorithm.digest_size * (2**32 - 1)
28
+ if length > max_len:
29
+ raise ValueError(f"Cannot derive keys larger than {max_len} bits.")
30
+ if sharedinfo is not None:
31
+ utils._check_bytes("sharedinfo", sharedinfo)
32
+
33
+ self._algorithm = algorithm
34
+ self._length = length
35
+ self._sharedinfo = sharedinfo
36
+ self._used = False
37
+
38
+ def derive(self, key_material: utils.Buffer) -> bytes:
39
+ if self._used:
40
+ raise AlreadyFinalized
41
+ self._used = True
42
+ utils._check_byteslike("key_material", key_material)
43
+ output = [b""]
44
+ outlen = 0
45
+ counter = 1
46
+
47
+ while self._length > outlen:
48
+ h = hashes.Hash(self._algorithm)
49
+ h.update(key_material)
50
+ h.update(_int_to_u32be(counter))
51
+ if self._sharedinfo is not None:
52
+ h.update(self._sharedinfo)
53
+ output.append(h.finalize())
54
+ outlen += len(output[-1])
55
+ counter += 1
56
+
57
+ return b"".join(output)[: self._length]
58
+
59
+ def verify(self, key_material: bytes, expected_key: bytes) -> None:
60
+ if not constant_time.bytes_eq(self.derive(key_material), expected_key):
61
+ raise InvalidKey