@ohos-ports/react-native-quick-crypto 0.0.0-stage → 1.1.8-beta.0
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.
- package/QuickCrypto.podspec +259 -0
- package/README.md +170 -2
- package/android/CMakeLists.txt +155 -0
- package/android/build.gradle +176 -0
- package/android/gradle.properties +6 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/cpp/cpp-adapter.cpp +8 -0
- package/android/src/main/java/com/margelo/nitro/quickcrypto/QuickCryptoPackage.java +41 -0
- package/app.plugin.js +3 -0
- package/cpp/argon2/HybridArgon2.cpp +110 -0
- package/cpp/argon2/HybridArgon2.hpp +32 -0
- package/cpp/blake3/HybridBlake3.cpp +120 -0
- package/cpp/blake3/HybridBlake3.hpp +35 -0
- package/cpp/certificate/HybridCertificate.cpp +42 -0
- package/cpp/certificate/HybridCertificate.hpp +16 -0
- package/cpp/cipher/CCMCipher.cpp +211 -0
- package/cpp/cipher/CCMCipher.hpp +24 -0
- package/cpp/cipher/ChaCha20Cipher.cpp +91 -0
- package/cpp/cipher/ChaCha20Cipher.hpp +23 -0
- package/cpp/cipher/ChaCha20Poly1305Cipher.cpp +175 -0
- package/cpp/cipher/ChaCha20Poly1305Cipher.hpp +27 -0
- package/cpp/cipher/GCMCipher.cpp +65 -0
- package/cpp/cipher/GCMCipher.hpp +14 -0
- package/cpp/cipher/HybridCipher.cpp +403 -0
- package/cpp/cipher/HybridCipher.hpp +90 -0
- package/cpp/cipher/HybridCipherFactory.hpp +119 -0
- package/cpp/cipher/HybridRsaCipher.cpp +477 -0
- package/cpp/cipher/HybridRsaCipher.hpp +33 -0
- package/cpp/cipher/OCBCipher.cpp +55 -0
- package/cpp/cipher/OCBCipher.hpp +19 -0
- package/cpp/cipher/XChaCha20Poly1305Cipher.cpp +158 -0
- package/cpp/cipher/XChaCha20Poly1305Cipher.hpp +42 -0
- package/cpp/cipher/XSalsa20Cipher.cpp +127 -0
- package/cpp/cipher/XSalsa20Cipher.hpp +55 -0
- package/cpp/cipher/XSalsa20Poly1305Cipher.cpp +138 -0
- package/cpp/cipher/XSalsa20Poly1305Cipher.hpp +41 -0
- package/cpp/dh/HybridDhKeyPair.cpp +179 -0
- package/cpp/dh/HybridDhKeyPair.hpp +37 -0
- package/cpp/dh/HybridDiffieHellman.cpp +482 -0
- package/cpp/dh/HybridDiffieHellman.hpp +42 -0
- package/cpp/dsa/HybridDsaKeyPair.cpp +128 -0
- package/cpp/dsa/HybridDsaKeyPair.hpp +32 -0
- package/cpp/ec/HybridEcKeyPair.cpp +481 -0
- package/cpp/ec/HybridEcKeyPair.hpp +45 -0
- package/cpp/ecdh/HybridECDH.cpp +251 -0
- package/cpp/ecdh/HybridECDH.hpp +43 -0
- package/cpp/ed25519/HybridEdKeyPair.cpp +360 -0
- package/cpp/ed25519/HybridEdKeyPair.hpp +67 -0
- package/cpp/hash/HybridHash.cpp +190 -0
- package/cpp/hash/HybridHash.hpp +43 -0
- package/cpp/hkdf/HybridHkdf.cpp +115 -0
- package/cpp/hkdf/HybridHkdf.hpp +29 -0
- package/cpp/hmac/HybridHmac.cpp +102 -0
- package/cpp/hmac/HybridHmac.hpp +32 -0
- package/cpp/keys/HybridKeyObjectHandle.cpp +1519 -0
- package/cpp/keys/HybridKeyObjectHandle.hpp +78 -0
- package/cpp/keys/KeyObjectData.cpp +298 -0
- package/cpp/keys/KeyObjectData.hpp +73 -0
- package/cpp/keys/node.h +5 -0
- package/cpp/kmac/HybridKmac.cpp +83 -0
- package/cpp/kmac/HybridKmac.hpp +31 -0
- package/cpp/mldsa/HybridMlDsaKeyPair.cpp +243 -0
- package/cpp/mldsa/HybridMlDsaKeyPair.hpp +49 -0
- package/cpp/mlkem/HybridMlKemKeyPair.cpp +315 -0
- package/cpp/mlkem/HybridMlKemKeyPair.hpp +48 -0
- package/cpp/pbkdf2/HybridPbkdf2.cpp +50 -0
- package/cpp/pbkdf2/HybridPbkdf2.hpp +24 -0
- package/cpp/prime/HybridPrime.cpp +81 -0
- package/cpp/prime/HybridPrime.hpp +20 -0
- package/cpp/random/HybridRandom.cpp +48 -0
- package/cpp/random/HybridRandom.hpp +32 -0
- package/cpp/rsa/HybridRsaKeyPair.cpp +151 -0
- package/cpp/rsa/HybridRsaKeyPair.hpp +40 -0
- package/cpp/scrypt/HybridScrypt.cpp +64 -0
- package/cpp/scrypt/HybridScrypt.hpp +28 -0
- package/cpp/sign/HybridSignHandle.cpp +241 -0
- package/cpp/sign/HybridSignHandle.hpp +36 -0
- package/cpp/sign/HybridVerifyHandle.cpp +207 -0
- package/cpp/sign/HybridVerifyHandle.hpp +36 -0
- package/cpp/sign/SignUtils.hpp +91 -0
- package/cpp/slhdsa/HybridSlhDsaKeyPair.cpp +245 -0
- package/cpp/slhdsa/HybridSlhDsaKeyPair.hpp +48 -0
- package/cpp/turboshake/HybridTurboShake.cpp +379 -0
- package/cpp/turboshake/HybridTurboShake.hpp +28 -0
- package/cpp/utils/HybridUtils.cpp +399 -0
- package/cpp/utils/HybridUtils.hpp +28 -0
- package/cpp/utils/Macros.hpp +68 -0
- package/cpp/utils/QuickCryptoUtils.cpp +44 -0
- package/cpp/utils/QuickCryptoUtils.hpp +186 -0
- package/cpp/utils/base64.h +309 -0
- package/cpp/x509/HybridX509Certificate.cpp +174 -0
- package/cpp/x509/HybridX509Certificate.hpp +51 -0
- package/deps/blake3/LICENSE_A2 +202 -0
- package/deps/blake3/LICENSE_A2LLVM +219 -0
- package/deps/blake3/LICENSE_CC0 +121 -0
- package/deps/blake3/README.md +228 -0
- package/deps/blake3/c/README.md +403 -0
- package/deps/blake3/c/blake3.c +651 -0
- package/deps/blake3/c/blake3.h +86 -0
- package/deps/blake3/c/blake3_dispatch.c +332 -0
- package/deps/blake3/c/blake3_impl.h +333 -0
- package/deps/blake3/c/blake3_neon.c +367 -0
- package/deps/blake3/c/blake3_portable.c +160 -0
- package/deps/fastpbkdf2/fastpbkdf2.c +356 -0
- package/deps/fastpbkdf2/fastpbkdf2.h +68 -0
- package/deps/ncrypto/LICENSE +21 -0
- package/deps/ncrypto/README.md +18 -0
- package/deps/ncrypto/include/dh-primes.h +67 -0
- package/deps/ncrypto/include/ncrypto/aead.h +137 -0
- package/deps/ncrypto/include/ncrypto/version.h +14 -0
- package/deps/ncrypto/include/ncrypto.h +1759 -0
- package/deps/ncrypto/src/aead.cpp +302 -0
- package/deps/ncrypto/src/engine.cpp +93 -0
- package/deps/ncrypto/src/ncrypto.cpp +5426 -0
- package/deps/simdutf/LICENSE-APACHE +201 -0
- package/deps/simdutf/LICENSE-MIT +18 -0
- package/deps/simdutf/README.md +2782 -0
- package/deps/simdutf/include/simdutf/avx512.h +79 -0
- package/deps/simdutf/include/simdutf/base64_implementation.h +158 -0
- package/deps/simdutf/include/simdutf/base64_tables.h +887 -0
- package/deps/simdutf/include/simdutf/common_defs.h +186 -0
- package/deps/simdutf/include/simdutf/compiler_check.h +50 -0
- package/deps/simdutf/include/simdutf/constexpr_ptr.h +138 -0
- package/deps/simdutf/include/simdutf/encoding_types.h +189 -0
- package/deps/simdutf/include/simdutf/error.h +126 -0
- package/deps/simdutf/include/simdutf/implementation.h +7081 -0
- package/deps/simdutf/include/simdutf/internal/isadetection.h +325 -0
- package/deps/simdutf/include/simdutf/portability.h +285 -0
- package/deps/simdutf/include/simdutf/scalar/ascii.h +86 -0
- package/deps/simdutf/include/simdutf/scalar/atomic_util.h +105 -0
- package/deps/simdutf/include/simdutf/scalar/base64.h +911 -0
- package/deps/simdutf/include/simdutf/scalar/latin1.h +26 -0
- package/deps/simdutf/include/simdutf/scalar/latin1_to_utf16/latin1_to_utf16.h +52 -0
- package/deps/simdutf/include/simdutf/scalar/latin1_to_utf32/latin1_to_utf32.h +27 -0
- package/deps/simdutf/include/simdutf/scalar/latin1_to_utf8/latin1_to_utf8.h +191 -0
- package/deps/simdutf/include/simdutf/scalar/swap_bytes.h +35 -0
- package/deps/simdutf/include/simdutf/scalar/utf16.h +226 -0
- package/deps/simdutf/include/simdutf/scalar/utf16_to_latin1/utf16_to_latin1.h +108 -0
- package/deps/simdutf/include/simdutf/scalar/utf16_to_latin1/valid_utf16_to_latin1.h +40 -0
- package/deps/simdutf/include/simdutf/scalar/utf16_to_utf32/utf16_to_utf32.h +86 -0
- package/deps/simdutf/include/simdutf/scalar/utf16_to_utf32/valid_utf16_to_utf32.h +44 -0
- package/deps/simdutf/include/simdutf/scalar/utf16_to_utf8/utf16_to_utf8.h +295 -0
- package/deps/simdutf/include/simdutf/scalar/utf16_to_utf8/valid_utf16_to_utf8.h +91 -0
- package/deps/simdutf/include/simdutf/scalar/utf32.h +82 -0
- package/deps/simdutf/include/simdutf/scalar/utf32_to_latin1/utf32_to_latin1.h +68 -0
- package/deps/simdutf/include/simdutf/scalar/utf32_to_latin1/valid_utf32_to_latin1.h +67 -0
- package/deps/simdutf/include/simdutf/scalar/utf32_to_utf16/utf32_to_utf16.h +84 -0
- package/deps/simdutf/include/simdutf/scalar/utf32_to_utf16/valid_utf32_to_utf16.h +44 -0
- package/deps/simdutf/include/simdutf/scalar/utf32_to_utf8/utf32_to_utf8.h +142 -0
- package/deps/simdutf/include/simdutf/scalar/utf32_to_utf8/valid_utf32_to_utf8.h +72 -0
- package/deps/simdutf/include/simdutf/scalar/utf8.h +326 -0
- package/deps/simdutf/include/simdutf/scalar/utf8_to_latin1/utf8_to_latin1.h +225 -0
- package/deps/simdutf/include/simdutf/scalar/utf8_to_latin1/valid_utf8_to_latin1.h +87 -0
- package/deps/simdutf/include/simdutf/scalar/utf8_to_utf16/utf8_to_utf16.h +342 -0
- package/deps/simdutf/include/simdutf/scalar/utf8_to_utf16/valid_utf8_to_utf16.h +106 -0
- package/deps/simdutf/include/simdutf/scalar/utf8_to_utf32/utf8_to_utf32.h +299 -0
- package/deps/simdutf/include/simdutf/scalar/utf8_to_utf32/valid_utf8_to_utf32.h +83 -0
- package/deps/simdutf/include/simdutf/simdutf_version.h +26 -0
- package/deps/simdutf/include/simdutf.h +26 -0
- package/deps/simdutf/include/simdutf_c.h +342 -0
- package/deps/simdutf/src/arm64/arm_base64.cpp +791 -0
- package/deps/simdutf/src/arm64/arm_convert_latin1_to_utf16.cpp +24 -0
- package/deps/simdutf/src/arm64/arm_convert_latin1_to_utf32.cpp +24 -0
- package/deps/simdutf/src/arm64/arm_convert_latin1_to_utf8.cpp +70 -0
- package/deps/simdutf/src/arm64/arm_convert_utf16_to_latin1.cpp +61 -0
- package/deps/simdutf/src/arm64/arm_convert_utf16_to_utf32.cpp +185 -0
- package/deps/simdutf/src/arm64/arm_convert_utf16_to_utf8.cpp +780 -0
- package/deps/simdutf/src/arm64/arm_convert_utf32_to_latin1.cpp +60 -0
- package/deps/simdutf/src/arm64/arm_convert_utf32_to_utf16.cpp +208 -0
- package/deps/simdutf/src/arm64/arm_convert_utf32_to_utf8.cpp +505 -0
- package/deps/simdutf/src/arm64/arm_convert_utf8_to_latin1.cpp +69 -0
- package/deps/simdutf/src/arm64/arm_convert_utf8_to_utf16.cpp +313 -0
- package/deps/simdutf/src/arm64/arm_convert_utf8_to_utf32.cpp +179 -0
- package/deps/simdutf/src/arm64/arm_find.cpp +199 -0
- package/deps/simdutf/src/arm64/arm_utf16fix.cpp +185 -0
- package/deps/simdutf/src/arm64/arm_validate_utf16.cpp +165 -0
- package/deps/simdutf/src/arm64/arm_validate_utf32le.cpp +65 -0
- package/deps/simdutf/src/arm64/implementation.cpp +1442 -0
- package/deps/simdutf/src/encoding_types.cpp +67 -0
- package/deps/simdutf/src/error.cpp +3 -0
- package/deps/simdutf/src/fallback/implementation.cpp +589 -0
- package/deps/simdutf/src/generic/ascii_validation.h +50 -0
- package/deps/simdutf/src/generic/base64.h +233 -0
- package/deps/simdutf/src/generic/base64lengths.h +63 -0
- package/deps/simdutf/src/generic/buf_block_reader.h +109 -0
- package/deps/simdutf/src/generic/find.h +75 -0
- package/deps/simdutf/src/generic/utf16/change_endianness.h +24 -0
- package/deps/simdutf/src/generic/utf16/count_code_points_bytemask.h +58 -0
- package/deps/simdutf/src/generic/utf16/to_well_formed.h +93 -0
- package/deps/simdutf/src/generic/utf16/utf32_length_from_utf16.h +15 -0
- package/deps/simdutf/src/generic/utf16/utf8_length_from_utf16.h +35 -0
- package/deps/simdutf/src/generic/utf16/utf8_length_from_utf16_bytemask.h +199 -0
- package/deps/simdutf/src/generic/utf16.h +73 -0
- package/deps/simdutf/src/generic/utf32.h +136 -0
- package/deps/simdutf/src/generic/utf8/utf16_length_from_utf8_bytemask.h +53 -0
- package/deps/simdutf/src/generic/utf8.h +92 -0
- package/deps/simdutf/src/generic/utf8_to_latin1/utf8_to_latin1.h +316 -0
- package/deps/simdutf/src/generic/utf8_to_latin1/valid_utf8_to_latin1.h +78 -0
- package/deps/simdutf/src/generic/utf8_to_utf16/utf8_to_utf16.h +332 -0
- package/deps/simdutf/src/generic/utf8_to_utf16/valid_utf8_to_utf16.h +74 -0
- package/deps/simdutf/src/generic/utf8_to_utf32/utf8_to_utf32.h +318 -0
- package/deps/simdutf/src/generic/utf8_to_utf32/valid_utf8_to_utf32.h +42 -0
- package/deps/simdutf/src/generic/utf8_validation/utf8_lookup4_algorithm.h +223 -0
- package/deps/simdutf/src/generic/utf8_validation/utf8_validator.h +84 -0
- package/deps/simdutf/src/generic/validate_utf16.h +164 -0
- package/deps/simdutf/src/generic/validate_utf32.h +99 -0
- package/deps/simdutf/src/haswell/avx2_base64.cpp +837 -0
- package/deps/simdutf/src/haswell/avx2_convert_latin1_to_utf16.cpp +28 -0
- package/deps/simdutf/src/haswell/avx2_convert_latin1_to_utf32.cpp +20 -0
- package/deps/simdutf/src/haswell/avx2_convert_latin1_to_utf8.cpp +83 -0
- package/deps/simdutf/src/haswell/avx2_convert_utf16_to_latin1.cpp +83 -0
- package/deps/simdutf/src/haswell/avx2_convert_utf16_to_utf32.cpp +210 -0
- package/deps/simdutf/src/haswell/avx2_convert_utf16_to_utf8.cpp +602 -0
- package/deps/simdutf/src/haswell/avx2_convert_utf32_to_latin1.cpp +116 -0
- package/deps/simdutf/src/haswell/avx2_convert_utf32_to_utf16.cpp +164 -0
- package/deps/simdutf/src/haswell/avx2_convert_utf32_to_utf8.cpp +569 -0
- package/deps/simdutf/src/haswell/avx2_convert_utf8_to_latin1.cpp +60 -0
- package/deps/simdutf/src/haswell/avx2_convert_utf8_to_utf16.cpp +195 -0
- package/deps/simdutf/src/haswell/avx2_convert_utf8_to_utf32.cpp +135 -0
- package/deps/simdutf/src/haswell/avx2_utf16fix.cpp +173 -0
- package/deps/simdutf/src/haswell/avx2_validate_utf16.cpp +17 -0
- package/deps/simdutf/src/haswell/implementation.cpp +1447 -0
- package/deps/simdutf/src/icelake/icelake_ascii_validation.inl.cpp +19 -0
- package/deps/simdutf/src/icelake/icelake_base64.inl.cpp +630 -0
- package/deps/simdutf/src/icelake/icelake_common.inl.cpp +37 -0
- package/deps/simdutf/src/icelake/icelake_convert_latin1_to_utf16.inl.cpp +36 -0
- package/deps/simdutf/src/icelake/icelake_convert_latin1_to_utf32.inl.cpp +23 -0
- package/deps/simdutf/src/icelake/icelake_convert_latin1_to_utf8.inl.cpp +107 -0
- package/deps/simdutf/src/icelake/icelake_convert_utf16_to_latin1.inl.cpp +103 -0
- package/deps/simdutf/src/icelake/icelake_convert_utf16_to_utf32.inl.cpp +136 -0
- package/deps/simdutf/src/icelake/icelake_convert_utf16_to_utf8.inl.cpp +206 -0
- package/deps/simdutf/src/icelake/icelake_convert_utf32_to_latin1.inl.cpp +74 -0
- package/deps/simdutf/src/icelake/icelake_convert_utf32_to_utf16.inl.cpp +338 -0
- package/deps/simdutf/src/icelake/icelake_convert_utf32_to_utf8.inl.cpp +574 -0
- package/deps/simdutf/src/icelake/icelake_convert_utf8_to_latin1.inl.cpp +104 -0
- package/deps/simdutf/src/icelake/icelake_convert_utf8_to_utf16.inl.cpp +75 -0
- package/deps/simdutf/src/icelake/icelake_convert_valid_utf8_to_latin1.inl.cpp +69 -0
- package/deps/simdutf/src/icelake/icelake_find.inl.cpp +146 -0
- package/deps/simdutf/src/icelake/icelake_from_utf8.inl.cpp +266 -0
- package/deps/simdutf/src/icelake/icelake_from_valid_utf8.inl.cpp +136 -0
- package/deps/simdutf/src/icelake/icelake_macros.inl.cpp +143 -0
- package/deps/simdutf/src/icelake/icelake_utf16fix.cpp +138 -0
- package/deps/simdutf/src/icelake/icelake_utf32_validation.inl.cpp +63 -0
- package/deps/simdutf/src/icelake/icelake_utf8_common.inl.cpp +753 -0
- package/deps/simdutf/src/icelake/icelake_utf8_length_from_utf16.inl.cpp +269 -0
- package/deps/simdutf/src/icelake/icelake_utf8_validation.inl.cpp +116 -0
- package/deps/simdutf/src/icelake/implementation.cpp +1903 -0
- package/deps/simdutf/src/implementation.cpp +2526 -0
- package/deps/simdutf/src/lasx/implementation.cpp +1531 -0
- package/deps/simdutf/src/lasx/lasx_base64.cpp +695 -0
- package/deps/simdutf/src/lasx/lasx_convert_latin1_to_utf16.cpp +76 -0
- package/deps/simdutf/src/lasx/lasx_convert_latin1_to_utf32.cpp +55 -0
- package/deps/simdutf/src/lasx/lasx_convert_latin1_to_utf8.cpp +65 -0
- package/deps/simdutf/src/lasx/lasx_convert_utf16_to_latin1.cpp +64 -0
- package/deps/simdutf/src/lasx/lasx_convert_utf16_to_utf32.cpp +183 -0
- package/deps/simdutf/src/lasx/lasx_convert_utf16_to_utf8.cpp +550 -0
- package/deps/simdutf/src/lasx/lasx_convert_utf32_to_latin1.cpp +73 -0
- package/deps/simdutf/src/lasx/lasx_convert_utf32_to_utf16.cpp +218 -0
- package/deps/simdutf/src/lasx/lasx_convert_utf32_to_utf8.cpp +589 -0
- package/deps/simdutf/src/lasx/lasx_convert_utf8_to_latin1.cpp +72 -0
- package/deps/simdutf/src/lasx/lasx_convert_utf8_to_utf16.cpp +296 -0
- package/deps/simdutf/src/lasx/lasx_convert_utf8_to_utf32.cpp +190 -0
- package/deps/simdutf/src/lasx/lasx_find.cpp +64 -0
- package/deps/simdutf/src/lasx/lasx_validate_utf16.cpp +13 -0
- package/deps/simdutf/src/lasx/lasx_validate_utf32le.cpp +84 -0
- package/deps/simdutf/src/lsx/implementation.cpp +1417 -0
- package/deps/simdutf/src/lsx/lsx_base64.cpp +675 -0
- package/deps/simdutf/src/lsx/lsx_convert_latin1_to_utf16.cpp +39 -0
- package/deps/simdutf/src/lsx/lsx_convert_latin1_to_utf32.cpp +27 -0
- package/deps/simdutf/src/lsx/lsx_convert_latin1_to_utf8.cpp +56 -0
- package/deps/simdutf/src/lsx/lsx_convert_utf16_to_latin1.cpp +64 -0
- package/deps/simdutf/src/lsx/lsx_convert_utf16_to_utf32.cpp +133 -0
- package/deps/simdutf/src/lsx/lsx_convert_utf16_to_utf8.cpp +518 -0
- package/deps/simdutf/src/lsx/lsx_convert_utf32_to_latin1.cpp +66 -0
- package/deps/simdutf/src/lsx/lsx_convert_utf32_to_utf16.cpp +155 -0
- package/deps/simdutf/src/lsx/lsx_convert_utf32_to_utf8.cpp +459 -0
- package/deps/simdutf/src/lsx/lsx_convert_utf8_to_latin1.cpp +75 -0
- package/deps/simdutf/src/lsx/lsx_convert_utf8_to_utf16.cpp +291 -0
- package/deps/simdutf/src/lsx/lsx_convert_utf8_to_utf32.cpp +179 -0
- package/deps/simdutf/src/lsx/lsx_find.cpp +60 -0
- package/deps/simdutf/src/lsx/lsx_validate_utf16.cpp +13 -0
- package/deps/simdutf/src/lsx/lsx_validate_utf32le.cpp +68 -0
- package/deps/simdutf/src/ppc64/implementation.cpp +992 -0
- package/deps/simdutf/src/ppc64/ppc64_base64.cpp +480 -0
- package/deps/simdutf/src/ppc64/ppc64_base64_internal_tests.cpp +401 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_latin1_to_utf16.cpp +12 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_latin1_to_utf32.cpp +12 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_latin1_to_utf8.cpp +149 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_utf16_to_latin1.cpp +67 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_utf16_to_utf32.cpp +87 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_utf16_to_utf8.cpp +296 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_utf32_to_latin1.cpp +57 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_utf32_to_utf16.cpp +117 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_utf32_to_utf8.cpp +166 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_utf8_to_latin1.cpp +69 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_utf8_to_utf16.cpp +211 -0
- package/deps/simdutf/src/ppc64/ppc64_convert_utf8_to_utf32.cpp +153 -0
- package/deps/simdutf/src/ppc64/ppc64_utf16_to_utf8_tables.h +1011 -0
- package/deps/simdutf/src/ppc64/ppc64_utf8_length_from_latin1.cpp +37 -0
- package/deps/simdutf/src/ppc64/ppc64_validate_utf16.cpp +19 -0
- package/deps/simdutf/src/ppc64/templates.cpp +91 -0
- package/deps/simdutf/src/rvv/implementation.cpp +138 -0
- package/deps/simdutf/src/rvv/rvv_find.cpp +27 -0
- package/deps/simdutf/src/rvv/rvv_helpers.inl.cpp +23 -0
- package/deps/simdutf/src/rvv/rvv_latin1_to.inl.cpp +71 -0
- package/deps/simdutf/src/rvv/rvv_length_from.inl.cpp +164 -0
- package/deps/simdutf/src/rvv/rvv_utf16_to.inl.cpp +399 -0
- package/deps/simdutf/src/rvv/rvv_utf16fix.cpp +110 -0
- package/deps/simdutf/src/rvv/rvv_utf32_to.inl.cpp +307 -0
- package/deps/simdutf/src/rvv/rvv_utf8_to.inl.cpp +435 -0
- package/deps/simdutf/src/rvv/rvv_validate.inl.cpp +275 -0
- package/deps/simdutf/src/simdutf/arm64/begin.h +2 -0
- package/deps/simdutf/src/simdutf/arm64/bitmanipulation.h +34 -0
- package/deps/simdutf/src/simdutf/arm64/end.h +2 -0
- package/deps/simdutf/src/simdutf/arm64/implementation.h +307 -0
- package/deps/simdutf/src/simdutf/arm64/intrinsics.h +10 -0
- package/deps/simdutf/src/simdutf/arm64/simd.h +547 -0
- package/deps/simdutf/src/simdutf/arm64/simd16-inl.h +403 -0
- package/deps/simdutf/src/simdutf/arm64/simd32-inl.h +129 -0
- package/deps/simdutf/src/simdutf/arm64/simd64-inl.h +28 -0
- package/deps/simdutf/src/simdutf/arm64.h +43 -0
- package/deps/simdutf/src/simdutf/fallback/begin.h +1 -0
- package/deps/simdutf/src/simdutf/fallback/bitmanipulation.h +13 -0
- package/deps/simdutf/src/simdutf/fallback/end.h +1 -0
- package/deps/simdutf/src/simdutf/fallback/implementation.h +331 -0
- package/deps/simdutf/src/simdutf/fallback.h +42 -0
- package/deps/simdutf/src/simdutf/haswell/begin.h +15 -0
- package/deps/simdutf/src/simdutf/haswell/bitmanipulation.h +35 -0
- package/deps/simdutf/src/simdutf/haswell/end.h +13 -0
- package/deps/simdutf/src/simdutf/haswell/implementation.h +338 -0
- package/deps/simdutf/src/simdutf/haswell/intrinsics.h +67 -0
- package/deps/simdutf/src/simdutf/haswell/simd.h +363 -0
- package/deps/simdutf/src/simdutf/haswell/simd16-inl.h +261 -0
- package/deps/simdutf/src/simdutf/haswell/simd32-inl.h +111 -0
- package/deps/simdutf/src/simdutf/haswell/simd64-inl.h +34 -0
- package/deps/simdutf/src/simdutf/haswell.h +63 -0
- package/deps/simdutf/src/simdutf/icelake/begin.h +14 -0
- package/deps/simdutf/src/simdutf/icelake/bitmanipulation.h +44 -0
- package/deps/simdutf/src/simdutf/icelake/end.h +12 -0
- package/deps/simdutf/src/simdutf/icelake/implementation.h +346 -0
- package/deps/simdutf/src/simdutf/icelake/intrinsics.h +138 -0
- package/deps/simdutf/src/simdutf/icelake/simd.h +17 -0
- package/deps/simdutf/src/simdutf/icelake/simd16-inl.h +90 -0
- package/deps/simdutf/src/simdutf/icelake/simd32-inl.h +47 -0
- package/deps/simdutf/src/simdutf/icelake.h +81 -0
- package/deps/simdutf/src/simdutf/lasx/begin.h +8 -0
- package/deps/simdutf/src/simdutf/lasx/bitmanipulation.h +25 -0
- package/deps/simdutf/src/simdutf/lasx/end.h +8 -0
- package/deps/simdutf/src/simdutf/lasx/implementation.h +310 -0
- package/deps/simdutf/src/simdutf/lasx/intrinsics.h +319 -0
- package/deps/simdutf/src/simdutf/lasx/simd.h +551 -0
- package/deps/simdutf/src/simdutf/lasx/simd16-inl.h +234 -0
- package/deps/simdutf/src/simdutf/lasx/simd32-inl.h +74 -0
- package/deps/simdutf/src/simdutf/lasx/simd64-inl.h +52 -0
- package/deps/simdutf/src/simdutf/lasx.h +49 -0
- package/deps/simdutf/src/simdutf/lsx/begin.h +2 -0
- package/deps/simdutf/src/simdutf/lsx/bitmanipulation.h +25 -0
- package/deps/simdutf/src/simdutf/lsx/end.h +2 -0
- package/deps/simdutf/src/simdutf/lsx/implementation.h +309 -0
- package/deps/simdutf/src/simdutf/lsx/intrinsics.h +196 -0
- package/deps/simdutf/src/simdutf/lsx/simd.h +421 -0
- package/deps/simdutf/src/simdutf/lsx/simd16-inl.h +242 -0
- package/deps/simdutf/src/simdutf/lsx/simd32-inl.h +69 -0
- package/deps/simdutf/src/simdutf/lsx/simd64-inl.h +50 -0
- package/deps/simdutf/src/simdutf/lsx.h +52 -0
- package/deps/simdutf/src/simdutf/ppc64/begin.h +1 -0
- package/deps/simdutf/src/simdutf/ppc64/bitmanipulation.h +29 -0
- package/deps/simdutf/src/simdutf/ppc64/end.h +1 -0
- package/deps/simdutf/src/simdutf/ppc64/implementation.h +348 -0
- package/deps/simdutf/src/simdutf/ppc64/intrinsics.h +19 -0
- package/deps/simdutf/src/simdutf/ppc64/simd.h +177 -0
- package/deps/simdutf/src/simdutf/ppc64/simd16-inl.h +327 -0
- package/deps/simdutf/src/simdutf/ppc64/simd32-inl.h +247 -0
- package/deps/simdutf/src/simdutf/ppc64/simd8-inl.h +618 -0
- package/deps/simdutf/src/simdutf/ppc64.h +40 -0
- package/deps/simdutf/src/simdutf/rvv/begin.h +7 -0
- package/deps/simdutf/src/simdutf/rvv/end.h +7 -0
- package/deps/simdutf/src/simdutf/rvv/implementation.h +321 -0
- package/deps/simdutf/src/simdutf/rvv/intrinsics.h +131 -0
- package/deps/simdutf/src/simdutf/rvv.h +41 -0
- package/deps/simdutf/src/simdutf/westmere/begin.h +8 -0
- package/deps/simdutf/src/simdutf/westmere/bitmanipulation.h +37 -0
- package/deps/simdutf/src/simdutf/westmere/end.h +8 -0
- package/deps/simdutf/src/simdutf/westmere/implementation.h +338 -0
- package/deps/simdutf/src/simdutf/westmere/intrinsics.h +38 -0
- package/deps/simdutf/src/simdutf/westmere/simd.h +379 -0
- package/deps/simdutf/src/simdutf/westmere/simd16-inl.h +242 -0
- package/deps/simdutf/src/simdutf/westmere/simd32-inl.h +151 -0
- package/deps/simdutf/src/simdutf/westmere/simd64-inl.h +33 -0
- package/deps/simdutf/src/simdutf/westmere.h +59 -0
- package/deps/simdutf/src/simdutf.cpp +152 -0
- package/deps/simdutf/src/simdutf_c.cpp +525 -0
- package/deps/simdutf/src/tables/utf16_to_utf8_tables.h +768 -0
- package/deps/simdutf/src/tables/utf32_to_utf16_tables.h +53 -0
- package/deps/simdutf/src/tables/utf8_to_utf16_tables.h +826 -0
- package/deps/simdutf/src/westmere/implementation.cpp +1479 -0
- package/deps/simdutf/src/westmere/internal/loader.cpp +7 -0
- package/deps/simdutf/src/westmere/internal/write_v_u16_11bits_to_utf8.cpp +66 -0
- package/deps/simdutf/src/westmere/sse_base64.cpp +672 -0
- package/deps/simdutf/src/westmere/sse_convert_latin1_to_utf16.cpp +21 -0
- package/deps/simdutf/src/westmere/sse_convert_latin1_to_utf32.cpp +31 -0
- package/deps/simdutf/src/westmere/sse_convert_latin1_to_utf8.cpp +71 -0
- package/deps/simdutf/src/westmere/sse_convert_utf16_to_latin1.cpp +70 -0
- package/deps/simdutf/src/westmere/sse_convert_utf16_to_utf32.cpp +206 -0
- package/deps/simdutf/src/westmere/sse_convert_utf16_to_utf8.cpp +504 -0
- package/deps/simdutf/src/westmere/sse_convert_utf32_to_latin1.cpp +82 -0
- package/deps/simdutf/src/westmere/sse_convert_utf32_to_utf16.cpp +209 -0
- package/deps/simdutf/src/westmere/sse_convert_utf32_to_utf8.cpp +589 -0
- package/deps/simdutf/src/westmere/sse_convert_utf8_to_latin1.cpp +58 -0
- package/deps/simdutf/src/westmere/sse_convert_utf8_to_utf16.cpp +197 -0
- package/deps/simdutf/src/westmere/sse_convert_utf8_to_utf32.cpp +141 -0
- package/deps/simdutf/src/westmere/sse_utf16fix.cpp +82 -0
- package/deps/simdutf/src/westmere/sse_validate_utf16.cpp +17 -0
- package/jest/index.js +16 -0
- package/lib/commonjs/argon2.js +88 -0
- package/lib/commonjs/argon2.js.map +1 -0
- package/lib/commonjs/blake3.js +99 -0
- package/lib/commonjs/blake3.js.map +1 -0
- package/lib/commonjs/certificate.js +35 -0
- package/lib/commonjs/certificate.js.map +1 -0
- package/lib/commonjs/cipher.js +299 -0
- package/lib/commonjs/cipher.js.map +1 -0
- package/lib/commonjs/constants.js +32 -0
- package/lib/commonjs/constants.js.map +1 -0
- package/lib/commonjs/dh-groups.js +29 -0
- package/lib/commonjs/dh-groups.js.map +1 -0
- package/lib/commonjs/dhKeyPair.js +112 -0
- package/lib/commonjs/dhKeyPair.js.map +1 -0
- package/lib/commonjs/diffie-hellman.js +151 -0
- package/lib/commonjs/diffie-hellman.js.map +1 -0
- package/lib/commonjs/dsa.js +101 -0
- package/lib/commonjs/dsa.js.map +1 -0
- package/lib/commonjs/ec.js +370 -0
- package/lib/commonjs/ec.js.map +1 -0
- package/lib/commonjs/ecdh.js +109 -0
- package/lib/commonjs/ecdh.js.map +1 -0
- package/lib/commonjs/ed.js +443 -0
- package/lib/commonjs/ed.js.map +1 -0
- package/lib/commonjs/expo-plugin/@types.js +2 -0
- package/lib/commonjs/expo-plugin/@types.js.map +1 -0
- package/lib/commonjs/expo-plugin/withRNQC.js +25 -0
- package/lib/commonjs/expo-plugin/withRNQC.js.map +1 -0
- package/lib/commonjs/expo-plugin/withSodiumAndroid.js +25 -0
- package/lib/commonjs/expo-plugin/withSodiumAndroid.js.map +1 -0
- package/lib/commonjs/expo-plugin/withSodiumIos.js +23 -0
- package/lib/commonjs/expo-plugin/withSodiumIos.js.map +1 -0
- package/lib/commonjs/expo-plugin/withXCode.js +109 -0
- package/lib/commonjs/expo-plugin/withXCode.js.map +1 -0
- package/lib/commonjs/hash.js +291 -0
- package/lib/commonjs/hash.js.map +1 -0
- package/lib/commonjs/hkdf.js +178 -0
- package/lib/commonjs/hkdf.js.map +1 -0
- package/lib/commonjs/hmac.js +125 -0
- package/lib/commonjs/hmac.js.map +1 -0
- package/lib/commonjs/index.js +356 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/keys/classes.js +280 -0
- package/lib/commonjs/keys/classes.js.map +1 -0
- package/lib/commonjs/keys/generateKeyPair.js +237 -0
- package/lib/commonjs/keys/generateKeyPair.js.map +1 -0
- package/lib/commonjs/keys/index.js +381 -0
- package/lib/commonjs/keys/index.js.map +1 -0
- package/lib/commonjs/keys/publicCipher.js +171 -0
- package/lib/commonjs/keys/publicCipher.js.map +1 -0
- package/lib/commonjs/keys/signVerify.js +227 -0
- package/lib/commonjs/keys/signVerify.js.map +1 -0
- package/lib/commonjs/keys/utils.js +181 -0
- package/lib/commonjs/keys/utils.js.map +1 -0
- package/lib/commonjs/mldsa.js +69 -0
- package/lib/commonjs/mldsa.js.map +1 -0
- package/lib/commonjs/mlkem.js +219 -0
- package/lib/commonjs/mlkem.js.map +1 -0
- package/lib/commonjs/native-nitro-bridge.js +344 -0
- package/lib/commonjs/nitro-node-shim.js +23 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/pbkdf2.js +106 -0
- package/lib/commonjs/pbkdf2.js.map +1 -0
- package/lib/commonjs/prime.js +84 -0
- package/lib/commonjs/prime.js.map +1 -0
- package/lib/commonjs/random.js +296 -0
- package/lib/commonjs/random.js.map +1 -0
- package/lib/commonjs/rsa.js +213 -0
- package/lib/commonjs/rsa.js.map +1 -0
- package/lib/commonjs/scrypt.js +139 -0
- package/lib/commonjs/scrypt.js.map +1 -0
- package/lib/commonjs/slhdsa.js +70 -0
- package/lib/commonjs/slhdsa.js.map +1 -0
- package/lib/commonjs/specs/argon2.nitro.js +6 -0
- package/lib/commonjs/specs/argon2.nitro.js.map +1 -0
- package/lib/commonjs/specs/blake3.nitro.js +6 -0
- package/lib/commonjs/specs/blake3.nitro.js.map +1 -0
- package/lib/commonjs/specs/certificate.nitro.js +6 -0
- package/lib/commonjs/specs/certificate.nitro.js.map +1 -0
- package/lib/commonjs/specs/cipher.nitro.js +6 -0
- package/lib/commonjs/specs/cipher.nitro.js.map +1 -0
- package/lib/commonjs/specs/dhKeyPair.nitro.js +6 -0
- package/lib/commonjs/specs/dhKeyPair.nitro.js.map +1 -0
- package/lib/commonjs/specs/diffie-hellman.nitro.js +6 -0
- package/lib/commonjs/specs/diffie-hellman.nitro.js.map +1 -0
- package/lib/commonjs/specs/dsaKeyPair.nitro.js +6 -0
- package/lib/commonjs/specs/dsaKeyPair.nitro.js.map +1 -0
- package/lib/commonjs/specs/ecKeyPair.nitro.js +6 -0
- package/lib/commonjs/specs/ecKeyPair.nitro.js.map +1 -0
- package/lib/commonjs/specs/ecdh.nitro.js +6 -0
- package/lib/commonjs/specs/ecdh.nitro.js.map +1 -0
- package/lib/commonjs/specs/edKeyPair.nitro.js +6 -0
- package/lib/commonjs/specs/edKeyPair.nitro.js.map +1 -0
- package/lib/commonjs/specs/hash.nitro.js +6 -0
- package/lib/commonjs/specs/hash.nitro.js.map +1 -0
- package/lib/commonjs/specs/hkdf.nitro.js +6 -0
- package/lib/commonjs/specs/hkdf.nitro.js.map +1 -0
- package/lib/commonjs/specs/hmac.nitro.js +6 -0
- package/lib/commonjs/specs/hmac.nitro.js.map +1 -0
- package/lib/commonjs/specs/keyObjectHandle.nitro.js +6 -0
- package/lib/commonjs/specs/keyObjectHandle.nitro.js.map +1 -0
- package/lib/commonjs/specs/kmac.nitro.js +6 -0
- package/lib/commonjs/specs/kmac.nitro.js.map +1 -0
- package/lib/commonjs/specs/mlDsaKeyPair.nitro.js +6 -0
- package/lib/commonjs/specs/mlDsaKeyPair.nitro.js.map +1 -0
- package/lib/commonjs/specs/mlKemKeyPair.nitro.js +6 -0
- package/lib/commonjs/specs/mlKemKeyPair.nitro.js.map +1 -0
- package/lib/commonjs/specs/pbkdf2.nitro.js +6 -0
- package/lib/commonjs/specs/pbkdf2.nitro.js.map +1 -0
- package/lib/commonjs/specs/prime.nitro.js +6 -0
- package/lib/commonjs/specs/prime.nitro.js.map +1 -0
- package/lib/commonjs/specs/random.nitro.js +6 -0
- package/lib/commonjs/specs/random.nitro.js.map +1 -0
- package/lib/commonjs/specs/rsaCipher.nitro.js +6 -0
- package/lib/commonjs/specs/rsaCipher.nitro.js.map +1 -0
- package/lib/commonjs/specs/rsaKeyPair.nitro.js +6 -0
- package/lib/commonjs/specs/rsaKeyPair.nitro.js.map +1 -0
- package/lib/commonjs/specs/scrypt.nitro.js +6 -0
- package/lib/commonjs/specs/scrypt.nitro.js.map +1 -0
- package/lib/commonjs/specs/sign.nitro.js +6 -0
- package/lib/commonjs/specs/sign.nitro.js.map +1 -0
- package/lib/commonjs/specs/slhDsaKeyPair.nitro.js +6 -0
- package/lib/commonjs/specs/slhDsaKeyPair.nitro.js.map +1 -0
- package/lib/commonjs/specs/turboshake.nitro.js +6 -0
- package/lib/commonjs/specs/turboshake.nitro.js.map +1 -0
- package/lib/commonjs/specs/utils.nitro.js +6 -0
- package/lib/commonjs/specs/utils.nitro.js.map +1 -0
- package/lib/commonjs/specs/x509certificate.nitro.js +6 -0
- package/lib/commonjs/specs/x509certificate.nitro.js.map +1 -0
- package/lib/commonjs/subtle.js +3211 -0
- package/lib/commonjs/subtle.js.map +1 -0
- package/lib/commonjs/utils/cipher.js +75 -0
- package/lib/commonjs/utils/cipher.js.map +1 -0
- package/lib/commonjs/utils/conversion.js +249 -0
- package/lib/commonjs/utils/conversion.js.map +1 -0
- package/lib/commonjs/utils/errors.js +73 -0
- package/lib/commonjs/utils/errors.js.map +1 -0
- package/lib/commonjs/utils/hashnames.js +122 -0
- package/lib/commonjs/utils/hashnames.js.map +1 -0
- package/lib/commonjs/utils/index.js +83 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/commonjs/utils/noble.js +82 -0
- package/lib/commonjs/utils/noble.js.map +1 -0
- package/lib/commonjs/utils/timingSafeEqual.js +29 -0
- package/lib/commonjs/utils/timingSafeEqual.js.map +1 -0
- package/lib/commonjs/utils/types.js +55 -0
- package/lib/commonjs/utils/types.js.map +1 -0
- package/lib/commonjs/utils/validation.js +144 -0
- package/lib/commonjs/utils/validation.js.map +1 -0
- package/lib/commonjs/x509certificate.js +189 -0
- package/lib/commonjs/x509certificate.js.map +1 -0
- package/lib/module/argon2.js +83 -0
- package/lib/module/argon2.js.map +1 -0
- package/lib/module/blake3.js +91 -0
- package/lib/module/blake3.js.map +1 -0
- package/lib/module/certificate.js +30 -0
- package/lib/module/certificate.js.map +1 -0
- package/lib/module/cipher.js +291 -0
- package/lib/module/cipher.js.map +1 -0
- package/lib/module/constants.js +28 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/dh-groups.js +25 -0
- package/lib/module/dh-groups.js.map +1 -0
- package/lib/module/dhKeyPair.js +105 -0
- package/lib/module/dhKeyPair.js.map +1 -0
- package/lib/module/diffie-hellman.js +145 -0
- package/lib/module/diffie-hellman.js.map +1 -0
- package/lib/module/dsa.js +94 -0
- package/lib/module/dsa.js.map +1 -0
- package/lib/module/ec.js +358 -0
- package/lib/module/ec.js.map +1 -0
- package/lib/module/ecdh.js +103 -0
- package/lib/module/ecdh.js.map +1 -0
- package/lib/module/ed.js +433 -0
- package/lib/module/ed.js.map +1 -0
- package/lib/module/expo-plugin/@types.js +2 -0
- package/lib/module/expo-plugin/@types.js.map +1 -0
- package/lib/module/expo-plugin/withRNQC.js +21 -0
- package/lib/module/expo-plugin/withRNQC.js.map +1 -0
- package/lib/module/expo-plugin/withSodiumAndroid.js +20 -0
- package/lib/module/expo-plugin/withSodiumAndroid.js.map +1 -0
- package/lib/module/expo-plugin/withSodiumIos.js +17 -0
- package/lib/module/expo-plugin/withSodiumIos.js.map +1 -0
- package/lib/module/expo-plugin/withXCode.js +101 -0
- package/lib/module/expo-plugin/withXCode.js.map +1 -0
- package/lib/module/hash.js +282 -0
- package/lib/module/hash.js.map +1 -0
- package/lib/module/hkdf.js +168 -0
- package/lib/module/hkdf.js.map +1 -0
- package/lib/module/hmac.js +120 -0
- package/lib/module/hmac.js.map +1 -0
- package/lib/module/index.js +115 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/keys/classes.js +271 -0
- package/lib/module/keys/classes.js.map +1 -0
- package/lib/module/keys/generateKeyPair.js +231 -0
- package/lib/module/keys/generateKeyPair.js.map +1 -0
- package/lib/module/keys/index.js +246 -0
- package/lib/module/keys/index.js.map +1 -0
- package/lib/module/keys/publicCipher.js +164 -0
- package/lib/module/keys/publicCipher.js.map +1 -0
- package/lib/module/keys/signVerify.js +217 -0
- package/lib/module/keys/signVerify.js.map +1 -0
- package/lib/module/keys/utils.js +170 -0
- package/lib/module/keys/utils.js.map +1 -0
- package/lib/module/mldsa.js +63 -0
- package/lib/module/mldsa.js.map +1 -0
- package/lib/module/mlkem.js +211 -0
- package/lib/module/mlkem.js.map +1 -0
- package/lib/module/pbkdf2.js +100 -0
- package/lib/module/pbkdf2.js.map +1 -0
- package/lib/module/prime.js +77 -0
- package/lib/module/prime.js.map +1 -0
- package/lib/module/random.js +284 -0
- package/lib/module/random.js.map +1 -0
- package/lib/module/rsa.js +205 -0
- package/lib/module/rsa.js.map +1 -0
- package/lib/module/scrypt.js +134 -0
- package/lib/module/scrypt.js.map +1 -0
- package/lib/module/slhdsa.js +64 -0
- package/lib/module/slhdsa.js.map +1 -0
- package/lib/module/specs/argon2.nitro.js +4 -0
- package/lib/module/specs/argon2.nitro.js.map +1 -0
- package/lib/module/specs/blake3.nitro.js +4 -0
- package/lib/module/specs/blake3.nitro.js.map +1 -0
- package/lib/module/specs/certificate.nitro.js +4 -0
- package/lib/module/specs/certificate.nitro.js.map +1 -0
- package/lib/module/specs/cipher.nitro.js +4 -0
- package/lib/module/specs/cipher.nitro.js.map +1 -0
- package/lib/module/specs/dhKeyPair.nitro.js +4 -0
- package/lib/module/specs/dhKeyPair.nitro.js.map +1 -0
- package/lib/module/specs/diffie-hellman.nitro.js +4 -0
- package/lib/module/specs/diffie-hellman.nitro.js.map +1 -0
- package/lib/module/specs/dsaKeyPair.nitro.js +4 -0
- package/lib/module/specs/dsaKeyPair.nitro.js.map +1 -0
- package/lib/module/specs/ecKeyPair.nitro.js +4 -0
- package/lib/module/specs/ecKeyPair.nitro.js.map +1 -0
- package/lib/module/specs/ecdh.nitro.js +4 -0
- package/lib/module/specs/ecdh.nitro.js.map +1 -0
- package/lib/module/specs/edKeyPair.nitro.js +4 -0
- package/lib/module/specs/edKeyPair.nitro.js.map +1 -0
- package/lib/module/specs/hash.nitro.js +4 -0
- package/lib/module/specs/hash.nitro.js.map +1 -0
- package/lib/module/specs/hkdf.nitro.js +4 -0
- package/lib/module/specs/hkdf.nitro.js.map +1 -0
- package/lib/module/specs/hmac.nitro.js +4 -0
- package/lib/module/specs/hmac.nitro.js.map +1 -0
- package/lib/module/specs/keyObjectHandle.nitro.js +4 -0
- package/lib/module/specs/keyObjectHandle.nitro.js.map +1 -0
- package/lib/module/specs/kmac.nitro.js +4 -0
- package/lib/module/specs/kmac.nitro.js.map +1 -0
- package/lib/module/specs/mlDsaKeyPair.nitro.js +4 -0
- package/lib/module/specs/mlDsaKeyPair.nitro.js.map +1 -0
- package/lib/module/specs/mlKemKeyPair.nitro.js +4 -0
- package/lib/module/specs/mlKemKeyPair.nitro.js.map +1 -0
- package/lib/module/specs/pbkdf2.nitro.js +4 -0
- package/lib/module/specs/pbkdf2.nitro.js.map +1 -0
- package/lib/module/specs/prime.nitro.js +4 -0
- package/lib/module/specs/prime.nitro.js.map +1 -0
- package/lib/module/specs/random.nitro.js +4 -0
- package/lib/module/specs/random.nitro.js.map +1 -0
- package/lib/module/specs/rsaCipher.nitro.js +4 -0
- package/lib/module/specs/rsaCipher.nitro.js.map +1 -0
- package/lib/module/specs/rsaKeyPair.nitro.js +4 -0
- package/lib/module/specs/rsaKeyPair.nitro.js.map +1 -0
- package/lib/module/specs/scrypt.nitro.js +4 -0
- package/lib/module/specs/scrypt.nitro.js.map +1 -0
- package/lib/module/specs/sign.nitro.js +4 -0
- package/lib/module/specs/sign.nitro.js.map +1 -0
- package/lib/module/specs/slhDsaKeyPair.nitro.js +4 -0
- package/lib/module/specs/slhDsaKeyPair.nitro.js.map +1 -0
- package/lib/module/specs/turboshake.nitro.js +4 -0
- package/lib/module/specs/turboshake.nitro.js.map +1 -0
- package/lib/module/specs/utils.nitro.js +4 -0
- package/lib/module/specs/utils.nitro.js.map +1 -0
- package/lib/module/specs/x509certificate.nitro.js +4 -0
- package/lib/module/specs/x509certificate.nitro.js.map +1 -0
- package/lib/module/subtle.js +3205 -0
- package/lib/module/subtle.js.map +1 -0
- package/lib/module/utils/cipher.js +67 -0
- package/lib/module/utils/cipher.js.map +1 -0
- package/lib/module/utils/conversion.js +205 -0
- package/lib/module/utils/conversion.js.map +1 -0
- package/lib/module/utils/errors.js +67 -0
- package/lib/module/utils/errors.js.map +1 -0
- package/lib/module/utils/hashnames.js +120 -0
- package/lib/module/utils/hashnames.js.map +1 -0
- package/lib/module/utils/index.js +10 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/module/utils/noble.js +76 -0
- package/lib/module/utils/noble.js.map +1 -0
- package/lib/module/utils/timingSafeEqual.js +25 -0
- package/lib/module/utils/timingSafeEqual.js.map +1 -0
- package/lib/module/utils/types.js +57 -0
- package/lib/module/utils/types.js.map +1 -0
- package/lib/module/utils/validation.js +131 -0
- package/lib/module/utils/validation.js.map +1 -0
- package/lib/module/x509certificate.js +184 -0
- package/lib/module/x509certificate.js.map +1 -0
- package/lib/typescript/argon2.d.ts +16 -0
- package/lib/typescript/argon2.d.ts.map +1 -0
- package/lib/typescript/blake3.d.ts +33 -0
- package/lib/typescript/blake3.d.ts.map +1 -0
- package/lib/typescript/certificate.d.ts +8 -0
- package/lib/typescript/certificate.d.ts.map +1 -0
- package/lib/typescript/cipher.d.ts +75 -0
- package/lib/typescript/cipher.d.ts.map +1 -0
- package/lib/typescript/constants.d.ts +21 -0
- package/lib/typescript/constants.d.ts.map +1 -0
- package/lib/typescript/dh-groups.d.ts +5 -0
- package/lib/typescript/dh-groups.d.ts.map +1 -0
- package/lib/typescript/dhKeyPair.d.ts +19 -0
- package/lib/typescript/dhKeyPair.d.ts.map +1 -0
- package/lib/typescript/diffie-hellman.d.ts +18 -0
- package/lib/typescript/diffie-hellman.d.ts.map +1 -0
- package/lib/typescript/dsa.d.ts +19 -0
- package/lib/typescript/dsa.d.ts.map +1 -0
- package/lib/typescript/ec.d.ts +24 -0
- package/lib/typescript/ec.d.ts.map +1 -0
- package/lib/typescript/ecdh.d.ts +19 -0
- package/lib/typescript/ecdh.d.ts.map +1 -0
- package/lib/typescript/ed.d.ts +47 -0
- package/lib/typescript/ed.d.ts.map +1 -0
- package/lib/typescript/expo-plugin/@types.d.ts +8 -0
- package/lib/typescript/expo-plugin/@types.d.ts.map +1 -0
- package/lib/typescript/expo-plugin/withRNQC.d.ts +4 -0
- package/lib/typescript/expo-plugin/withRNQC.d.ts.map +1 -0
- package/lib/typescript/expo-plugin/withSodiumAndroid.d.ts +4 -0
- package/lib/typescript/expo-plugin/withSodiumAndroid.d.ts.map +1 -0
- package/lib/typescript/expo-plugin/withSodiumIos.d.ts +4 -0
- package/lib/typescript/expo-plugin/withSodiumIos.d.ts.map +1 -0
- package/lib/typescript/expo-plugin/withXCode.d.ts +23 -0
- package/lib/typescript/expo-plugin/withXCode.d.ts.map +1 -0
- package/lib/typescript/hash.d.ts +126 -0
- package/lib/typescript/hash.d.ts.map +1 -0
- package/lib/typescript/hkdf.d.ts +26 -0
- package/lib/typescript/hkdf.d.ts.map +1 -0
- package/lib/typescript/hmac.d.ts +66 -0
- package/lib/typescript/hmac.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +240 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/keys/classes.d.ts +95 -0
- package/lib/typescript/keys/classes.d.ts.map +1 -0
- package/lib/typescript/keys/generateKeyPair.d.ts +17 -0
- package/lib/typescript/keys/generateKeyPair.d.ts.map +1 -0
- package/lib/typescript/keys/index.d.ts +26 -0
- package/lib/typescript/keys/index.d.ts.map +1 -0
- package/lib/typescript/keys/publicCipher.d.ts +23 -0
- package/lib/typescript/keys/publicCipher.d.ts.map +1 -0
- package/lib/typescript/keys/signVerify.d.ts +35 -0
- package/lib/typescript/keys/signVerify.d.ts.map +1 -0
- package/lib/typescript/keys/utils.d.ts +51 -0
- package/lib/typescript/keys/utils.d.ts.map +1 -0
- package/lib/typescript/mldsa.d.ts +18 -0
- package/lib/typescript/mldsa.d.ts.map +1 -0
- package/lib/typescript/mlkem.d.ts +30 -0
- package/lib/typescript/mlkem.d.ts.map +1 -0
- package/lib/typescript/pbkdf2.d.ts +12 -0
- package/lib/typescript/pbkdf2.d.ts.map +1 -0
- package/lib/typescript/prime.d.ts +19 -0
- package/lib/typescript/prime.d.ts.map +1 -0
- package/lib/typescript/random.d.ts +31 -0
- package/lib/typescript/random.d.ts.map +1 -0
- package/lib/typescript/rsa.d.ts +20 -0
- package/lib/typescript/rsa.d.ts.map +1 -0
- package/lib/typescript/scrypt.d.ts +18 -0
- package/lib/typescript/scrypt.d.ts.map +1 -0
- package/lib/typescript/slhdsa.d.ts +19 -0
- package/lib/typescript/slhdsa.d.ts.map +1 -0
- package/lib/typescript/specs/argon2.nitro.d.ts +9 -0
- package/lib/typescript/specs/argon2.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/blake3.nitro.d.ts +15 -0
- package/lib/typescript/specs/blake3.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/certificate.nitro.d.ts +10 -0
- package/lib/typescript/specs/certificate.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/cipher.nitro.d.ts +38 -0
- package/lib/typescript/specs/cipher.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/dhKeyPair.nitro.d.ts +14 -0
- package/lib/typescript/specs/dhKeyPair.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/diffie-hellman.nitro.d.ts +18 -0
- package/lib/typescript/specs/diffie-hellman.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/dsaKeyPair.nitro.d.ts +13 -0
- package/lib/typescript/specs/dsaKeyPair.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/ecKeyPair.nitro.d.ts +21 -0
- package/lib/typescript/specs/ecKeyPair.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/ecdh.nitro.d.ts +15 -0
- package/lib/typescript/specs/ecdh.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/edKeyPair.nitro.d.ts +17 -0
- package/lib/typescript/specs/edKeyPair.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/hash.nitro.d.ts +13 -0
- package/lib/typescript/specs/hash.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/hkdf.nitro.d.ts +10 -0
- package/lib/typescript/specs/hkdf.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/hmac.nitro.d.ts +10 -0
- package/lib/typescript/specs/hmac.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/keyObjectHandle.nitro.d.ts +27 -0
- package/lib/typescript/specs/keyObjectHandle.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/kmac.nitro.d.ts +10 -0
- package/lib/typescript/specs/kmac.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/mlDsaKeyPair.nitro.d.ts +16 -0
- package/lib/typescript/specs/mlDsaKeyPair.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/mlKemKeyPair.nitro.d.ts +18 -0
- package/lib/typescript/specs/mlKemKeyPair.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/pbkdf2.nitro.d.ts +9 -0
- package/lib/typescript/specs/pbkdf2.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/prime.nitro.d.ts +11 -0
- package/lib/typescript/specs/prime.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/random.nitro.d.ts +9 -0
- package/lib/typescript/specs/random.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/rsaCipher.nitro.d.ts +54 -0
- package/lib/typescript/specs/rsaCipher.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/rsaKeyPair.nitro.d.ts +20 -0
- package/lib/typescript/specs/rsaKeyPair.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/scrypt.nitro.d.ts +9 -0
- package/lib/typescript/specs/scrypt.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/sign.nitro.d.ts +19 -0
- package/lib/typescript/specs/sign.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/slhDsaKeyPair.nitro.d.ts +16 -0
- package/lib/typescript/specs/slhDsaKeyPair.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/turboshake.nitro.d.ts +11 -0
- package/lib/typescript/specs/turboshake.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/utils.nitro.d.ts +8 -0
- package/lib/typescript/specs/utils.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/x509certificate.nitro.d.ts +34 -0
- package/lib/typescript/specs/x509certificate.nitro.d.ts.map +1 -0
- package/lib/typescript/subtle.d.ts +33 -0
- package/lib/typescript/subtle.d.ts.map +1 -0
- package/lib/typescript/utils/cipher.d.ts +19 -0
- package/lib/typescript/utils/cipher.d.ts.map +1 -0
- package/lib/typescript/utils/conversion.d.ts +36 -0
- package/lib/typescript/utils/conversion.d.ts.map +1 -0
- package/lib/typescript/utils/errors.d.ts +19 -0
- package/lib/typescript/utils/errors.d.ts.map +1 -0
- package/lib/typescript/utils/hashnames.d.ts +13 -0
- package/lib/typescript/utils/hashnames.d.ts.map +1 -0
- package/lib/typescript/utils/index.d.ts +8 -0
- package/lib/typescript/utils/index.d.ts.map +1 -0
- package/lib/typescript/utils/noble.d.ts +19 -0
- package/lib/typescript/utils/noble.d.ts.map +1 -0
- package/lib/typescript/utils/timingSafeEqual.d.ts +3 -0
- package/lib/typescript/utils/timingSafeEqual.d.ts.map +1 -0
- package/lib/typescript/utils/types.d.ts +314 -0
- package/lib/typescript/utils/types.d.ts.map +1 -0
- package/lib/typescript/utils/validation.d.ts +15 -0
- package/lib/typescript/utils/validation.d.ts.map +1 -0
- package/lib/typescript/x509certificate.d.ts +64 -0
- package/lib/typescript/x509certificate.d.ts.map +1 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/QuickCrypto+autolinking.cmake +110 -0
- package/nitrogen/generated/android/QuickCrypto+autolinking.gradle +27 -0
- package/nitrogen/generated/android/QuickCryptoOnLoad.cpp +334 -0
- package/nitrogen/generated/android/QuickCryptoOnLoad.hpp +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/crypto/QuickCryptoOnLoad.kt +35 -0
- package/nitrogen/generated/ios/QuickCrypto+autolinking.rb +60 -0
- package/nitrogen/generated/ios/QuickCrypto-Swift-Cxx-Bridge.cpp +17 -0
- package/nitrogen/generated/ios/QuickCrypto-Swift-Cxx-Bridge.hpp +27 -0
- package/nitrogen/generated/ios/QuickCrypto-Swift-Cxx-Umbrella.hpp +38 -0
- package/nitrogen/generated/ios/QuickCryptoAutolinking.mm +325 -0
- package/nitrogen/generated/ios/QuickCryptoAutolinking.swift +16 -0
- package/nitrogen/generated/shared/c++/AsymmetricKeyType.hpp +176 -0
- package/nitrogen/generated/shared/c++/CipherArgs.hpp +101 -0
- package/nitrogen/generated/shared/c++/CipherInfo.hpp +104 -0
- package/nitrogen/generated/shared/c++/HkdfMode.hpp +80 -0
- package/nitrogen/generated/shared/c++/HybridArgon2Spec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridArgon2Spec.hpp +66 -0
- package/nitrogen/generated/shared/c++/HybridBlake3Spec.cpp +28 -0
- package/nitrogen/generated/shared/c++/HybridBlake3Spec.hpp +74 -0
- package/nitrogen/generated/shared/c++/HybridCertificateSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridCertificateSpec.hpp +64 -0
- package/nitrogen/generated/shared/c++/HybridCipherFactorySpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridCipherFactorySpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/HybridCipherSpec.cpp +29 -0
- package/nitrogen/generated/shared/c++/HybridCipherSpec.hpp +78 -0
- package/nitrogen/generated/shared/c++/HybridDhKeyPairSpec.cpp +27 -0
- package/nitrogen/generated/shared/c++/HybridDhKeyPairSpec.hpp +69 -0
- package/nitrogen/generated/shared/c++/HybridDiffieHellmanSpec.cpp +31 -0
- package/nitrogen/generated/shared/c++/HybridDiffieHellmanSpec.hpp +72 -0
- package/nitrogen/generated/shared/c++/HybridDsaKeyPairSpec.cpp +26 -0
- package/nitrogen/generated/shared/c++/HybridDsaKeyPairSpec.hpp +68 -0
- package/nitrogen/generated/shared/c++/HybridECDHSpec.cpp +28 -0
- package/nitrogen/generated/shared/c++/HybridECDHSpec.hpp +70 -0
- package/nitrogen/generated/shared/c++/HybridEcKeyPairSpec.cpp +30 -0
- package/nitrogen/generated/shared/c++/HybridEcKeyPairSpec.hpp +76 -0
- package/nitrogen/generated/shared/c++/HybridEdKeyPairSpec.cpp +30 -0
- package/nitrogen/generated/shared/c++/HybridEdKeyPairSpec.hpp +74 -0
- package/nitrogen/generated/shared/c++/HybridHashSpec.cpp +26 -0
- package/nitrogen/generated/shared/c++/HybridHashSpec.hpp +74 -0
- package/nitrogen/generated/shared/c++/HybridHkdfSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridHkdfSpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/HybridHmacSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridHmacSpec.hpp +66 -0
- package/nitrogen/generated/shared/c++/HybridKeyObjectHandleSpec.cpp +39 -0
- package/nitrogen/generated/shared/c++/HybridKeyObjectHandleSpec.hpp +107 -0
- package/nitrogen/generated/shared/c++/HybridKmacSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridKmacSpec.hpp +66 -0
- package/nitrogen/generated/shared/c++/HybridMlDsaKeyPairSpec.cpp +29 -0
- package/nitrogen/generated/shared/c++/HybridMlDsaKeyPairSpec.hpp +72 -0
- package/nitrogen/generated/shared/c++/HybridMlKemKeyPairSpec.cpp +31 -0
- package/nitrogen/generated/shared/c++/HybridMlKemKeyPairSpec.hpp +74 -0
- package/nitrogen/generated/shared/c++/HybridPbkdf2Spec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridPbkdf2Spec.hpp +65 -0
- package/nitrogen/generated/shared/c++/HybridPrimeSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridPrimeSpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/HybridRandomSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridRandomSpec.hpp +64 -0
- package/nitrogen/generated/shared/c++/HybridRsaCipherSpec.cpp +25 -0
- package/nitrogen/generated/shared/c++/HybridRsaCipherSpec.hpp +71 -0
- package/nitrogen/generated/shared/c++/HybridRsaKeyPairSpec.cpp +29 -0
- package/nitrogen/generated/shared/c++/HybridRsaKeyPairSpec.hpp +75 -0
- package/nitrogen/generated/shared/c++/HybridScryptSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridScryptSpec.hpp +64 -0
- package/nitrogen/generated/shared/c++/HybridSignHandleSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridSignHandleSpec.hpp +69 -0
- package/nitrogen/generated/shared/c++/HybridSlhDsaKeyPairSpec.cpp +29 -0
- package/nitrogen/generated/shared/c++/HybridSlhDsaKeyPairSpec.hpp +72 -0
- package/nitrogen/generated/shared/c++/HybridTurboShakeSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridTurboShakeSpec.hpp +70 -0
- package/nitrogen/generated/shared/c++/HybridUtilsSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridUtilsSpec.hpp +62 -0
- package/nitrogen/generated/shared/c++/HybridVerifyHandleSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridVerifyHandleSpec.hpp +69 -0
- package/nitrogen/generated/shared/c++/HybridX509CertificateHandleSpec.cpp +46 -0
- package/nitrogen/generated/shared/c++/HybridX509CertificateHandleSpec.hpp +96 -0
- package/nitrogen/generated/shared/c++/JWK.hpp +185 -0
- package/nitrogen/generated/shared/c++/JWKkty.hpp +92 -0
- package/nitrogen/generated/shared/c++/JWKuse.hpp +76 -0
- package/nitrogen/generated/shared/c++/KFormatType.hpp +63 -0
- package/nitrogen/generated/shared/c++/KangarooTwelveVariant.hpp +76 -0
- package/nitrogen/generated/shared/c++/KeyDetail.hpp +108 -0
- package/nitrogen/generated/shared/c++/KeyEncoding.hpp +64 -0
- package/nitrogen/generated/shared/c++/KeyObject.hpp +83 -0
- package/nitrogen/generated/shared/c++/KeyType.hpp +63 -0
- package/nitrogen/generated/shared/c++/KeyUsage.hpp +116 -0
- package/nitrogen/generated/shared/c++/NamedCurve.hpp +80 -0
- package/nitrogen/generated/shared/c++/TurboShakeVariant.hpp +76 -0
- package/ohos/binding.gyp +33 -0
- package/ohos/build/Release/quick_crypto.node +0 -0
- package/ohos/quick_crypto_napi.cpp +1316 -0
- package/package.json +158 -4
- package/src/argon2.ts +161 -0
- package/src/blake3.ts +124 -0
- package/src/certificate.ts +41 -0
- package/src/cipher.ts +497 -0
- package/src/constants.ts +32 -0
- package/src/dh-groups.ts +27 -0
- package/src/dhKeyPair.ts +164 -0
- package/src/diffie-hellman.ts +195 -0
- package/src/dsa.ts +146 -0
- package/src/ec.ts +580 -0
- package/src/ecdh.ts +132 -0
- package/src/ed.ts +605 -0
- package/src/expo-plugin/@types.ts +7 -0
- package/src/expo-plugin/withRNQC.ts +23 -0
- package/src/expo-plugin/withSodiumAndroid.ts +24 -0
- package/src/expo-plugin/withSodiumIos.ts +25 -0
- package/src/expo-plugin/withXCode.ts +134 -0
- package/src/hash.ts +433 -0
- package/src/hkdf.ts +327 -0
- package/src/hmac.ts +150 -0
- package/src/index.ts +126 -0
- package/src/keys/classes.ts +369 -0
- package/src/keys/generateKeyPair.ts +358 -0
- package/src/keys/index.ts +383 -0
- package/src/keys/publicCipher.ts +256 -0
- package/src/keys/signVerify.ts +329 -0
- package/src/keys/utils.ts +263 -0
- package/src/mldsa.ts +125 -0
- package/src/mlkem.ts +350 -0
- package/src/pbkdf2.ts +183 -0
- package/src/prime.ts +134 -0
- package/src/random.ts +427 -0
- package/src/rsa.ts +333 -0
- package/src/scrypt.ts +201 -0
- package/src/slhdsa.ts +146 -0
- package/src/specs/argon2.nitro.ts +29 -0
- package/src/specs/blake3.nitro.ts +12 -0
- package/src/specs/certificate.nitro.ts +8 -0
- package/src/specs/cipher.nitro.ts +39 -0
- package/src/specs/dhKeyPair.nitro.ts +14 -0
- package/src/specs/diffie-hellman.nitro.ts +16 -0
- package/src/specs/dsaKeyPair.nitro.ts +13 -0
- package/src/specs/ecKeyPair.nitro.ts +40 -0
- package/src/specs/ecdh.nitro.ts +12 -0
- package/src/specs/edKeyPair.nitro.ts +43 -0
- package/src/specs/hash.nitro.ts +10 -0
- package/src/specs/hkdf.nitro.ts +25 -0
- package/src/specs/hmac.nitro.ts +7 -0
- package/src/specs/keyObjectHandle.nitro.ts +56 -0
- package/src/specs/kmac.nitro.ts +12 -0
- package/src/specs/mlDsaKeyPair.nitro.ts +29 -0
- package/src/specs/mlKemKeyPair.nitro.ts +32 -0
- package/src/specs/pbkdf2.nitro.ts +18 -0
- package/src/specs/prime.nitro.ts +18 -0
- package/src/specs/random.nitro.ts +14 -0
- package/src/specs/rsaCipher.nitro.ts +82 -0
- package/src/specs/rsaKeyPair.nitro.ts +33 -0
- package/src/specs/scrypt.nitro.ts +23 -0
- package/src/specs/sign.nitro.ts +31 -0
- package/src/specs/slhDsaKeyPair.nitro.ts +29 -0
- package/src/specs/turboshake.nitro.ts +21 -0
- package/src/specs/utils.nitro.ts +5 -0
- package/src/specs/x509certificate.nitro.ts +38 -0
- package/src/subtle.ts +4545 -0
- package/src/utils/cipher.ts +82 -0
- package/src/utils/conversion.ts +285 -0
- package/src/utils/errors.ts +83 -0
- package/src/utils/hashnames.ts +129 -0
- package/src/utils/index.ts +7 -0
- package/src/utils/noble.ts +85 -0
- package/src/utils/timingSafeEqual.ts +28 -0
- package/src/utils/types.ts +617 -0
- package/src/utils/validation.ts +199 -0
- package/src/x509certificate.ts +276 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Certificate = void 0;
|
|
7
|
+
var _reactNativeNitroModules = require("./nitro-node-shim");
|
|
8
|
+
var _reactNativeBuffer = require("@craftzdog/react-native-buffer");
|
|
9
|
+
var _utils = require("./utils");
|
|
10
|
+
let native;
|
|
11
|
+
function getNative() {
|
|
12
|
+
if (native == null) {
|
|
13
|
+
native = _reactNativeNitroModules.NitroModules.createHybridObject('Certificate');
|
|
14
|
+
}
|
|
15
|
+
return native;
|
|
16
|
+
}
|
|
17
|
+
function toArrayBuffer(spkac, encoding) {
|
|
18
|
+
if (typeof spkac === 'string') {
|
|
19
|
+
return (0, _utils.binaryLikeToArrayBuffer)(spkac, encoding || 'utf8');
|
|
20
|
+
}
|
|
21
|
+
return (0, _utils.binaryLikeToArrayBuffer)(spkac);
|
|
22
|
+
}
|
|
23
|
+
class Certificate {
|
|
24
|
+
static exportChallenge(spkac, encoding) {
|
|
25
|
+
return _reactNativeBuffer.Buffer.from(getNative().exportChallenge(toArrayBuffer(spkac, encoding)));
|
|
26
|
+
}
|
|
27
|
+
static exportPublicKey(spkac, encoding) {
|
|
28
|
+
return _reactNativeBuffer.Buffer.from(getNative().exportPublicKey(toArrayBuffer(spkac, encoding)));
|
|
29
|
+
}
|
|
30
|
+
static verifySpkac(spkac, encoding) {
|
|
31
|
+
return getNative().verifySpkac(toArrayBuffer(spkac, encoding));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.Certificate = Certificate;
|
|
35
|
+
//# sourceMappingURL=certificate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNativeNitroModules","require","_reactNativeBuffer","_utils","native","getNative","NitroModules","createHybridObject","toArrayBuffer","spkac","encoding","binaryLikeToArrayBuffer","Certificate","exportChallenge","Buffer","from","exportPublicKey","verifySpkac","exports"],"sourceRoot":"../../src","sources":["certificate.ts"],"mappings":";;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAGA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAIG,MAAyB;AAC7B,SAASC,SAASA,CAAA,EAAsB;EACtC,IAAID,MAAM,IAAI,IAAI,EAAE;IAClBA,MAAM,GAAGE,qCAAY,CAACC,kBAAkB,CAAoB,aAAa,CAAC;EAC5E;EACA,OAAOH,MAAM;AACf;AAEA,SAASI,aAAaA,CACpBC,KAAiB,EACjBC,QAAyB,EACZ;EACb,IAAI,OAAOD,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAO,IAAAE,8BAAuB,EAACF,KAAK,EAAEC,QAAQ,IAAI,MAAM,CAAC;EAC3D;EACA,OAAO,IAAAC,8BAAuB,EAACF,KAAK,CAAC;AACvC;AAEO,MAAMG,WAAW,CAAC;EACvB,OAAOC,eAAeA,CAACJ,KAAiB,EAAEC,QAAyB,EAAU;IAC3E,OAAOI,yBAAM,CAACC,IAAI,CAChBV,SAAS,CAAC,CAAC,CAACQ,eAAe,CAACL,aAAa,CAACC,KAAK,EAAEC,QAAQ,CAAC,CAC5D,CAAC;EACH;EAEA,OAAOM,eAAeA,CAACP,KAAiB,EAAEC,QAAyB,EAAU;IAC3E,OAAOI,yBAAM,CAACC,IAAI,CAChBV,SAAS,CAAC,CAAC,CAACW,eAAe,CAACR,aAAa,CAACC,KAAK,EAAEC,QAAQ,CAAC,CAC5D,CAAC;EACH;EAEA,OAAOO,WAAWA,CAACR,KAAiB,EAAEC,QAAyB,EAAW;IACxE,OAAOL,SAAS,CAAC,CAAC,CAACY,WAAW,CAACT,aAAa,CAACC,KAAK,EAAEC,QAAQ,CAAC,CAAC;EAChE;AACF;AAACQ,OAAA,CAAAN,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createCipheriv = createCipheriv;
|
|
7
|
+
exports.createDecipheriv = createDecipheriv;
|
|
8
|
+
exports.getCipherInfo = getCipherInfo;
|
|
9
|
+
exports.getCiphers = getCiphers;
|
|
10
|
+
exports.xsalsa20 = xsalsa20;
|
|
11
|
+
var _reactNativeNitroModules = require("./nitro-node-shim");
|
|
12
|
+
var _readableStream = _interopRequireDefault(require("readable-stream"));
|
|
13
|
+
var _string_decoder = require("string_decoder");
|
|
14
|
+
var _reactNativeBuffer = require("@craftzdog/react-native-buffer");
|
|
15
|
+
var _utils = require("./utils");
|
|
16
|
+
var _cipher = require("./utils/cipher");
|
|
17
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
|
+
// @types/node
|
|
19
|
+
|
|
20
|
+
class CipherUtils {
|
|
21
|
+
static native = _reactNativeNitroModules.NitroModules.createHybridObject('Cipher');
|
|
22
|
+
static getSupportedCiphers() {
|
|
23
|
+
return this.native.getSupportedCiphers();
|
|
24
|
+
}
|
|
25
|
+
static getCipherInfo(name, keyLength, ivLength) {
|
|
26
|
+
return this.native.getCipherInfo(name, keyLength, ivLength);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function getCiphers() {
|
|
30
|
+
return CipherUtils.getSupportedCiphers();
|
|
31
|
+
}
|
|
32
|
+
function getCipherInfo(name, options) {
|
|
33
|
+
if (typeof name !== 'string' || name.length === 0) return undefined;
|
|
34
|
+
return CipherUtils.getCipherInfo(name, options?.keyLength, options?.ivLength);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// libsodium ciphers aren't visible to OpenSSL's EVP_CIPHER_fetch, so
|
|
38
|
+
// getCipherInfo() returns undefined for them. Hard-code the (key, iv)
|
|
39
|
+
// byte-lengths the C++ factory will accept.
|
|
40
|
+
const LIBSODIUM_CIPHER_PARAMS = {
|
|
41
|
+
xsalsa20: {
|
|
42
|
+
keyLength: 32,
|
|
43
|
+
ivLength: 24
|
|
44
|
+
},
|
|
45
|
+
'xsalsa20-poly1305': {
|
|
46
|
+
keyLength: 32,
|
|
47
|
+
ivLength: 24
|
|
48
|
+
},
|
|
49
|
+
'xchacha20-poly1305': {
|
|
50
|
+
keyLength: 32,
|
|
51
|
+
ivLength: 24
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
function validateCipherParams(cipherType, keyByteLength, ivByteLength) {
|
|
55
|
+
if (typeof cipherType !== 'string' || cipherType.length === 0) {
|
|
56
|
+
throw new TypeError('cipher algorithm must be a non-empty string');
|
|
57
|
+
}
|
|
58
|
+
// ArrayBuffer.byteLength is always a non-negative integer, so the only
|
|
59
|
+
// out-of-range value we need to guard is 0 — empty key buffers must not
|
|
60
|
+
// reach OpenSSL's EVP_CipherInit_ex.
|
|
61
|
+
if (keyByteLength === 0) {
|
|
62
|
+
throw new RangeError(`Invalid key length 0 for cipher ${cipherType}`);
|
|
63
|
+
}
|
|
64
|
+
const lower = cipherType.toLowerCase();
|
|
65
|
+
const sodium = LIBSODIUM_CIPHER_PARAMS[lower];
|
|
66
|
+
if (sodium) {
|
|
67
|
+
// libsodium parlance: "nonce" rather than "iv". Phrase the expected
|
|
68
|
+
// size as a natural-language clause so callers asserting on either
|
|
69
|
+
// `key must be N bytes` or `Invalid key length N` both match.
|
|
70
|
+
if (keyByteLength !== sodium.keyLength) {
|
|
71
|
+
throw new RangeError(`Invalid key length ${keyByteLength} for cipher ${cipherType} ` + `(key must be ${sodium.keyLength} bytes)`);
|
|
72
|
+
}
|
|
73
|
+
if (ivByteLength !== sodium.ivLength) {
|
|
74
|
+
throw new RangeError(`Invalid nonce length ${ivByteLength} for cipher ${cipherType} ` + `(nonce must be ${sodium.ivLength} bytes)`);
|
|
75
|
+
}
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// OpenSSL path. Look up the cipher's defaults once. Most callers pass
|
|
80
|
+
// exactly the cipher's default key/iv lengths (e.g. AES-128-CBC always
|
|
81
|
+
// wants 16/16) — short-circuit those to a single native round-trip.
|
|
82
|
+
// Variable-length ciphers (GCM, CCM, OCB, ChaCha20-Poly1305) fall through
|
|
83
|
+
// to per-parameter validation calls so the error message can name which
|
|
84
|
+
// of {key, iv} is wrong.
|
|
85
|
+
const info = CipherUtils.getCipherInfo(cipherType);
|
|
86
|
+
if (info === undefined) {
|
|
87
|
+
throw new TypeError(`Unsupported or unknown cipher type: ${cipherType}`);
|
|
88
|
+
}
|
|
89
|
+
const expectedIv = info.ivLength ?? 0;
|
|
90
|
+
if (expectedIv === 0 && ivByteLength > 0) {
|
|
91
|
+
throw new RangeError(`Cipher ${cipherType} does not use an iv (got ${ivByteLength} bytes)`);
|
|
92
|
+
}
|
|
93
|
+
if (expectedIv > 0 && ivByteLength === 0) {
|
|
94
|
+
throw new RangeError(`Cipher ${cipherType} requires an iv but none was provided`);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Fast path: lengths match the cipher's defaults exactly.
|
|
98
|
+
if (info.keyLength === keyByteLength && expectedIv === ivByteLength) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Variable-length: verify against native one parameter at a time.
|
|
103
|
+
if (CipherUtils.getCipherInfo(cipherType, keyByteLength, undefined) === undefined) {
|
|
104
|
+
throw new RangeError(`Invalid key length ${keyByteLength} for cipher ${cipherType}`);
|
|
105
|
+
}
|
|
106
|
+
if (expectedIv > 0 && CipherUtils.getCipherInfo(cipherType, undefined, ivByteLength) === undefined) {
|
|
107
|
+
throw new RangeError(`Invalid iv length ${ivByteLength} for cipher ${cipherType}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
class CipherCommon extends _readableStream.default.Transform {
|
|
111
|
+
_decoder = null;
|
|
112
|
+
_decoderEncoding = undefined;
|
|
113
|
+
constructor({
|
|
114
|
+
isCipher,
|
|
115
|
+
cipherType,
|
|
116
|
+
cipherKey,
|
|
117
|
+
iv,
|
|
118
|
+
options
|
|
119
|
+
}) {
|
|
120
|
+
// Explicitly create TransformOptions for super()
|
|
121
|
+
const streamOptions = {};
|
|
122
|
+
if (options) {
|
|
123
|
+
// List known TransformOptions keys (adjust if needed)
|
|
124
|
+
const transformKeys = ['readableHighWaterMark', 'writableHighWaterMark', 'decodeStrings', 'defaultEncoding', 'objectMode', 'destroy', 'read', 'write', 'writev', 'final', 'transform', 'flush'
|
|
125
|
+
// Add any other relevant keys from readable-stream's TransformOptions
|
|
126
|
+
];
|
|
127
|
+
for (const key of transformKeys) {
|
|
128
|
+
if (key in options) {
|
|
129
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
130
|
+
streamOptions[key] = options[key];
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
super(streamOptions); // Pass filtered options
|
|
135
|
+
|
|
136
|
+
// defaults to 16 bytes for AEAD modes; non-AEAD callers ignore it.
|
|
137
|
+
const authTagLen = (0, _cipher.getUIntOption)(options, 'authTagLength') ?? 16;
|
|
138
|
+
const cipherKeyAB = (0, _utils.binaryLikeToArrayBuffer)(cipherKey);
|
|
139
|
+
const ivAB = (0, _utils.binaryLikeToArrayBuffer)(iv);
|
|
140
|
+
validateCipherParams(cipherType, cipherKeyAB.byteLength, ivAB.byteLength);
|
|
141
|
+
const factory = _reactNativeNitroModules.NitroModules.createHybridObject('CipherFactory');
|
|
142
|
+
this.native = factory.createCipher({
|
|
143
|
+
isCipher,
|
|
144
|
+
cipherType,
|
|
145
|
+
cipherKey: cipherKeyAB,
|
|
146
|
+
iv: ivAB,
|
|
147
|
+
authTagLen
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
getDecoder(encoding) {
|
|
151
|
+
const normalized = (0, _cipher.normalizeEncoding)(encoding);
|
|
152
|
+
if (!this._decoder) {
|
|
153
|
+
this._decoder = new _string_decoder.StringDecoder(encoding);
|
|
154
|
+
this._decoderEncoding = normalized;
|
|
155
|
+
} else if (this._decoderEncoding !== normalized) {
|
|
156
|
+
throw new Error('Cannot change encoding');
|
|
157
|
+
}
|
|
158
|
+
return this._decoder;
|
|
159
|
+
}
|
|
160
|
+
update(data, inputEncoding, outputEncoding) {
|
|
161
|
+
const defaultEncoding = (0, _cipher.getDefaultEncoding)();
|
|
162
|
+
inputEncoding = inputEncoding ?? defaultEncoding;
|
|
163
|
+
outputEncoding = outputEncoding ?? defaultEncoding;
|
|
164
|
+
if (typeof data === 'string') {
|
|
165
|
+
(0, _cipher.validateEncoding)(data, inputEncoding);
|
|
166
|
+
} else if (!ArrayBuffer.isView(data)) {
|
|
167
|
+
throw new Error('Invalid data argument');
|
|
168
|
+
}
|
|
169
|
+
const ret = this.native.update((0, _utils.binaryLikeToArrayBuffer)(data, inputEncoding));
|
|
170
|
+
if (outputEncoding && outputEncoding !== 'buffer') {
|
|
171
|
+
return this.getDecoder(outputEncoding).write(_reactNativeBuffer.Buffer.from(ret));
|
|
172
|
+
}
|
|
173
|
+
return _reactNativeBuffer.Buffer.from(ret);
|
|
174
|
+
}
|
|
175
|
+
final(outputEncoding) {
|
|
176
|
+
const ret = this.native.final();
|
|
177
|
+
if (outputEncoding && outputEncoding !== 'buffer') {
|
|
178
|
+
return this.getDecoder(outputEncoding).end(_reactNativeBuffer.Buffer.from(ret));
|
|
179
|
+
}
|
|
180
|
+
return _reactNativeBuffer.Buffer.from(ret);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Stream interface — surface synchronous errors (bad encoding,
|
|
184
|
+
// OpenSSL EVP failures, AEAD tag mismatch in `final()`, etc.) via
|
|
185
|
+
// the callback so they emit as stream 'error' events instead of
|
|
186
|
+
// throwing out of the Transform plumbing and crashing the host
|
|
187
|
+
// pipeline.
|
|
188
|
+
_transform(chunk, encoding, callback) {
|
|
189
|
+
try {
|
|
190
|
+
this.push(this.update(chunk, (0, _cipher.normalizeEncoding)(encoding)));
|
|
191
|
+
callback();
|
|
192
|
+
} catch (err) {
|
|
193
|
+
callback(err);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
_flush(callback) {
|
|
197
|
+
try {
|
|
198
|
+
this.push(this.final());
|
|
199
|
+
callback();
|
|
200
|
+
} catch (err) {
|
|
201
|
+
callback(err);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
setAutoPadding(autoPadding) {
|
|
205
|
+
const res = this.native.setAutoPadding(!!autoPadding);
|
|
206
|
+
if (!res) {
|
|
207
|
+
throw new Error('setAutoPadding failed');
|
|
208
|
+
}
|
|
209
|
+
return this;
|
|
210
|
+
}
|
|
211
|
+
setAAD(buffer, options) {
|
|
212
|
+
// Check if native parts are initialized
|
|
213
|
+
if (!this.native || typeof this.native.setAAD !== 'function') {
|
|
214
|
+
throw new Error('Cipher native object or setAAD method not initialized.');
|
|
215
|
+
}
|
|
216
|
+
// Use binaryLikeToArrayBuffer (not `buffer.buffer`) so that sliced /
|
|
217
|
+
// offset views send only the AAD bytes the caller intended. Passing the
|
|
218
|
+
// raw backing ArrayBuffer authenticates the wrong data and silently
|
|
219
|
+
// breaks the AEAD integrity guarantee.
|
|
220
|
+
const res = this.native.setAAD((0, _utils.binaryLikeToArrayBuffer)(buffer), options?.plaintextLength);
|
|
221
|
+
if (!res) {
|
|
222
|
+
throw new Error('setAAD failed (native call returned false)');
|
|
223
|
+
}
|
|
224
|
+
return this;
|
|
225
|
+
}
|
|
226
|
+
getAuthTag() {
|
|
227
|
+
return _reactNativeBuffer.Buffer.from(this.native.getAuthTag());
|
|
228
|
+
}
|
|
229
|
+
setAuthTag(tag) {
|
|
230
|
+
const res = this.native.setAuthTag((0, _utils.binaryLikeToArrayBuffer)(tag));
|
|
231
|
+
if (!res) {
|
|
232
|
+
throw new Error('setAuthTag failed');
|
|
233
|
+
}
|
|
234
|
+
return this;
|
|
235
|
+
}
|
|
236
|
+
getSupportedCiphers() {
|
|
237
|
+
return this.native.getSupportedCiphers();
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
class Cipheriv extends CipherCommon {
|
|
241
|
+
constructor(cipherType, cipherKey, iv, options) {
|
|
242
|
+
super({
|
|
243
|
+
isCipher: true,
|
|
244
|
+
cipherType,
|
|
245
|
+
cipherKey: (0, _utils.binaryLikeToArrayBuffer)(cipherKey),
|
|
246
|
+
iv: (0, _utils.binaryLikeToArrayBuffer)(iv),
|
|
247
|
+
options
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
class Decipheriv extends CipherCommon {
|
|
252
|
+
constructor(cipherType, cipherKey, iv, options) {
|
|
253
|
+
super({
|
|
254
|
+
isCipher: false,
|
|
255
|
+
cipherType,
|
|
256
|
+
cipherKey: (0, _utils.binaryLikeToArrayBuffer)(cipherKey),
|
|
257
|
+
iv: (0, _utils.binaryLikeToArrayBuffer)(iv),
|
|
258
|
+
options
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
function createDecipheriv(algorithm, key, iv, options) {
|
|
263
|
+
return new Decipheriv(algorithm, key, iv, options);
|
|
264
|
+
}
|
|
265
|
+
function createCipheriv(algorithm, key, iv, options) {
|
|
266
|
+
return new Cipheriv(algorithm, key, iv, options);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* xsalsa20 stream encryption with @noble/ciphers compatible API
|
|
271
|
+
*
|
|
272
|
+
* @param key - 32 bytes
|
|
273
|
+
* @param nonce - 24 bytes
|
|
274
|
+
* @param data - data to encrypt
|
|
275
|
+
* @param output - unused
|
|
276
|
+
* @param counter - unused
|
|
277
|
+
* @returns encrypted data
|
|
278
|
+
*/
|
|
279
|
+
function xsalsa20(key, nonce, data,
|
|
280
|
+
// @ts-expect-error haven't implemented this part of @noble/ciphers API
|
|
281
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
282
|
+
output,
|
|
283
|
+
// @ts-expect-error haven't implemented this part of @noble/ciphers API
|
|
284
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
285
|
+
counter) {
|
|
286
|
+
const cipherKeyAB = (0, _utils.binaryLikeToArrayBuffer)(key);
|
|
287
|
+
const ivAB = (0, _utils.binaryLikeToArrayBuffer)(nonce);
|
|
288
|
+
validateCipherParams('xsalsa20', cipherKeyAB.byteLength, ivAB.byteLength);
|
|
289
|
+
const factory = _reactNativeNitroModules.NitroModules.createHybridObject('CipherFactory');
|
|
290
|
+
const native = factory.createCipher({
|
|
291
|
+
isCipher: true,
|
|
292
|
+
cipherType: 'xsalsa20',
|
|
293
|
+
cipherKey: cipherKeyAB,
|
|
294
|
+
iv: ivAB
|
|
295
|
+
});
|
|
296
|
+
const result = native.update((0, _utils.binaryLikeToArrayBuffer)(data));
|
|
297
|
+
return new Uint8Array(result);
|
|
298
|
+
}
|
|
299
|
+
//# sourceMappingURL=cipher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNativeNitroModules","require","_readableStream","_interopRequireDefault","_string_decoder","_reactNativeBuffer","_utils","_cipher","e","__esModule","default","CipherUtils","native","NitroModules","createHybridObject","getSupportedCiphers","getCipherInfo","name","keyLength","ivLength","getCiphers","options","length","undefined","LIBSODIUM_CIPHER_PARAMS","xsalsa20","validateCipherParams","cipherType","keyByteLength","ivByteLength","TypeError","RangeError","lower","toLowerCase","sodium","info","expectedIv","CipherCommon","Stream","Transform","_decoder","_decoderEncoding","constructor","isCipher","cipherKey","iv","streamOptions","transformKeys","key","authTagLen","getUIntOption","cipherKeyAB","binaryLikeToArrayBuffer","ivAB","byteLength","factory","createCipher","getDecoder","encoding","normalized","normalizeEncoding","StringDecoder","Error","update","data","inputEncoding","outputEncoding","defaultEncoding","getDefaultEncoding","validateEncoding","ArrayBuffer","isView","ret","write","Buffer","from","final","end","_transform","chunk","callback","push","err","_flush","setAutoPadding","autoPadding","res","setAAD","buffer","plaintextLength","getAuthTag","setAuthTag","tag","Cipheriv","Decipheriv","createDecipheriv","algorithm","createCipheriv","nonce","output","counter","result","Uint8Array"],"sourceRoot":"../../src","sources":["cipher.ts"],"mappings":";;;;;;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AAcA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAKwB,SAAAE,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAXP;;AA4BjB,MAAMG,WAAW,CAAC;EAChB,OAAeC,MAAM,GACnBC,qCAAY,CAACC,kBAAkB,CAAe,QAAQ,CAAC;EACzD,OAAcC,mBAAmBA,CAAA,EAAa;IAC5C,OAAO,IAAI,CAACH,MAAM,CAACG,mBAAmB,CAAC,CAAC;EAC1C;EACA,OAAcC,aAAaA,CACzBC,IAAY,EACZC,SAAkB,EAClBC,QAAiB,EACa;IAC9B,OAAO,IAAI,CAACP,MAAM,CAACI,aAAa,CAACC,IAAI,EAAEC,SAAS,EAAEC,QAAQ,CAAC;EAC7D;AACF;AAEO,SAASC,UAAUA,CAAA,EAAa;EACrC,OAAOT,WAAW,CAACI,mBAAmB,CAAC,CAAC;AAC1C;A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
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultCoreCipherList = exports.defaultCipherList = exports.constants = void 0;
|
|
7
|
+
const constants = exports.constants = {
|
|
8
|
+
// RSA Padding
|
|
9
|
+
RSA_PKCS1_PADDING: 1,
|
|
10
|
+
RSA_NO_PADDING: 3,
|
|
11
|
+
RSA_PKCS1_OAEP_PADDING: 4,
|
|
12
|
+
RSA_X931_PADDING: 5,
|
|
13
|
+
RSA_PKCS1_PSS_PADDING: 6,
|
|
14
|
+
// RSA PSS Salt Length
|
|
15
|
+
RSA_PSS_SALTLEN_DIGEST: -1,
|
|
16
|
+
RSA_PSS_SALTLEN_MAX_SIGN: -2,
|
|
17
|
+
RSA_PSS_SALTLEN_AUTO: -2,
|
|
18
|
+
// Point Conversion
|
|
19
|
+
POINT_CONVERSION_COMPRESSED: 2,
|
|
20
|
+
POINT_CONVERSION_UNCOMPRESSED: 4,
|
|
21
|
+
POINT_CONVERSION_HYBRID: 6,
|
|
22
|
+
// DH Check
|
|
23
|
+
DH_CHECK_P_NOT_PRIME: 1,
|
|
24
|
+
DH_CHECK_P_NOT_SAFE_PRIME: 2,
|
|
25
|
+
DH_UNABLE_TO_CHECK_GENERATOR: 4,
|
|
26
|
+
DH_NOT_SUITABLE_GENERATOR: 8,
|
|
27
|
+
// OpenSSL Version (3.0.0 = 0x30000000)
|
|
28
|
+
OPENSSL_VERSION_NUMBER: 0x30000000
|
|
29
|
+
};
|
|
30
|
+
const defaultCoreCipherList = exports.defaultCoreCipherList = 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256';
|
|
31
|
+
const defaultCipherList = exports.defaultCipherList = 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256';
|
|
32
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["constants","exports","RSA_PKCS1_PADDING","RSA_NO_PADDING","RSA_PKCS1_OAEP_PADDING","RSA_X931_PADDING","RSA_PKCS1_PSS_PADDING","RSA_PSS_SALTLEN_DIGEST","RSA_PSS_SALTLEN_MAX_SIGN","RSA_PSS_SALTLEN_AUTO","POINT_CONVERSION_COMPRESSED","POINT_CONVERSION_UNCOMPRESSED","POINT_CONVERSION_HYBRID","DH_CHECK_P_NOT_PRIME","DH_CHECK_P_NOT_SAFE_PRIME","DH_UNABLE_TO_CHECK_GENERATOR","DH_NOT_SUITABLE_GENERATOR","OPENSSL_VERSION_NUMBER","defaultCoreCipherList","defaultCipherList"],"sourceRoot":"../../src","sources":["constants.ts"],"mappings":";;;;;;AAAO,MAAMA,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG;EACvB;EACAE,iBAAiB,EAAE,CAAC;EACpBC,cAAc,EAAE,CAAC;EACjBC,sBAAsB,EAAE,CAAC;EACzBC,gBAAgB,EAAE,CAAC;EACnBC,qBAAqB,EAAE,CAAC;EAExB;EACAC,sBAAsB,EAAE,CAAC,CAAC;EAC1BC,wBAAwB,EAAE,CAAC,CAAC;EAC5BC,oBAAoB,EAAE,CAAC,CAAC;EAExB;EACAC,2BAA2B,EAAE,CAAC;EAC9BC,6BAA6B,EAAE,CAAC;EAChCC,uBAAuB,EAAE,CAAC;EAE1B;EACAC,oBAAoB,EAAE,CAAC;EACvBC,yBAAyB,EAAE,CAAC;EAC5BC,4BAA4B,EAAE,CAAC;EAC/BC,yBAAyB,EAAE,CAAC;EAE5B;EACAC,sBAAsB,EAAE;AAC1B,CAAU;AAEH,MAAMC,qBAAqB,GAAAjB,OAAA,CAAAiB,qBAAA,GAChC,4EAA4E;AACvE,MAAMC,iBAAiB,GAAAlB,OAAA,CAAAkB,iBAAA,GAC5B,4EAA4E","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DH_GROUPS = void 0;
|
|
7
|
+
const DH_GROUPS = exports.DH_GROUPS = {
|
|
8
|
+
modp14: {
|
|
9
|
+
prime: 'ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff',
|
|
10
|
+
generator: '02'
|
|
11
|
+
},
|
|
12
|
+
modp15: {
|
|
13
|
+
prime: 'ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff',
|
|
14
|
+
generator: '02'
|
|
15
|
+
},
|
|
16
|
+
modp16: {
|
|
17
|
+
prime: 'ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff',
|
|
18
|
+
generator: '02'
|
|
19
|
+
},
|
|
20
|
+
modp17: {
|
|
21
|
+
prime: 'ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff',
|
|
22
|
+
generator: '02'
|
|
23
|
+
},
|
|
24
|
+
modp18: {
|
|
25
|
+
prime: 'ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff',
|
|
26
|
+
generator: '02'
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=dh-groups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DH_GROUPS","exports","modp14","prime","generator","modp15","modp16","modp17","modp18"],"sourceRoot":"../../src","sources":["dh-groups.ts"],"mappings":";;;;;;AAAO,MAAMA,SAA+D,GAAAC,OAAA,CAAAD,SAAA,GAAG;EAC7EE,MAAM,EAAE;IACNC,KAAK,EACH,kgBAAkgB;IACpgBC,SAAS,EAAE;EACb,CAAC;EACDC,MAAM,EAAE;IACNF,KAAK,EACH,kwBAAkwB;IACpwBC,SAAS,EAAE;EACb,CAAC;EACDE,MAAM,EAAE;IACNH,KAAK,EACH,kgCAAkgC;IACpgCC,SAAS,EAAE;EACb,CAAC;EACDG,MAAM,EAAE;IACNJ,KAAK,EACH,kgDAAkgD;IACpgDC,SAAS,EAAE;EACb,CAAC;EACDI,MAAM,EAAE;IACNL,KAAK,EACH,kgEAAkgE;IACpgEC,SAAS,EAAE;EACb;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DhKeyPairGen = void 0;
|
|
7
|
+
exports.dh_generateKeyPairNode = dh_generateKeyPairNode;
|
|
8
|
+
exports.dh_generateKeyPairNodeSync = dh_generateKeyPairNodeSync;
|
|
9
|
+
var _reactNativeNitroModules = require("./nitro-node-shim");
|
|
10
|
+
var _reactNativeBuffer = require("@craftzdog/react-native-buffer");
|
|
11
|
+
var _classes = require("./keys/classes");
|
|
12
|
+
var _utils = require("./utils");
|
|
13
|
+
var _dhGroups = require("./dh-groups");
|
|
14
|
+
class DhKeyPairGen {
|
|
15
|
+
constructor(options) {
|
|
16
|
+
this.native = _reactNativeNitroModules.NitroModules.createHybridObject('DhKeyPair');
|
|
17
|
+
const {
|
|
18
|
+
groupName,
|
|
19
|
+
prime,
|
|
20
|
+
primeLength,
|
|
21
|
+
generator
|
|
22
|
+
} = options;
|
|
23
|
+
if (groupName) {
|
|
24
|
+
// Resolve named group to prime + generator
|
|
25
|
+
const group = _dhGroups.DH_GROUPS[groupName];
|
|
26
|
+
if (!group) {
|
|
27
|
+
throw new Error(`Unknown DH group: ${groupName}`);
|
|
28
|
+
}
|
|
29
|
+
const primeBuf = _reactNativeBuffer.Buffer.from(group.prime, 'hex');
|
|
30
|
+
this.native.setPrime(primeBuf.buffer.slice(primeBuf.byteOffset, primeBuf.byteOffset + primeBuf.byteLength));
|
|
31
|
+
const gen = parseInt(group.generator, 16);
|
|
32
|
+
this.native.setGenerator(gen);
|
|
33
|
+
} else if (prime) {
|
|
34
|
+
// Custom prime as Buffer
|
|
35
|
+
const primeBuf = _reactNativeBuffer.Buffer.from(prime);
|
|
36
|
+
this.native.setPrime(primeBuf.buffer.slice(primeBuf.byteOffset, primeBuf.byteOffset + primeBuf.byteLength));
|
|
37
|
+
this.native.setGenerator(generator ?? 2);
|
|
38
|
+
} else if (primeLength) {
|
|
39
|
+
this.native.setPrimeLength(primeLength);
|
|
40
|
+
this.native.setGenerator(generator ?? 2);
|
|
41
|
+
} else {
|
|
42
|
+
throw new Error('DH key generation requires one of: groupName, prime, or primeLength');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async generateKeyPair() {
|
|
46
|
+
await this.native.generateKeyPair();
|
|
47
|
+
}
|
|
48
|
+
generateKeyPairSync() {
|
|
49
|
+
this.native.generateKeyPairSync();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.DhKeyPairGen = DhKeyPairGen;
|
|
53
|
+
function dh_prepareKeyGenParams(options) {
|
|
54
|
+
if (!options) {
|
|
55
|
+
throw new Error('Options are required for DH key generation');
|
|
56
|
+
}
|
|
57
|
+
return new DhKeyPairGen(options);
|
|
58
|
+
}
|
|
59
|
+
function dh_formatKeyPairOutput(dh, encoding) {
|
|
60
|
+
const {
|
|
61
|
+
publicFormat,
|
|
62
|
+
privateFormat,
|
|
63
|
+
cipher,
|
|
64
|
+
passphrase
|
|
65
|
+
} = encoding;
|
|
66
|
+
const publicKeyData = dh.native.getPublicKey();
|
|
67
|
+
const privateKeyData = dh.native.getPrivateKey();
|
|
68
|
+
const pub = _classes.KeyObject.createKeyObject('public', publicKeyData, _utils.KFormatType.DER, _utils.KeyEncoding.SPKI);
|
|
69
|
+
const priv = _classes.KeyObject.createKeyObject('private', privateKeyData, _utils.KFormatType.DER, _utils.KeyEncoding.PKCS8);
|
|
70
|
+
let publicKey;
|
|
71
|
+
let privateKey;
|
|
72
|
+
if (publicFormat === 'raw-public' || privateFormat === 'raw-private' || privateFormat === 'raw-seed') {
|
|
73
|
+
throw new Error('Raw key formats are not supported for DH keys');
|
|
74
|
+
}
|
|
75
|
+
if (publicFormat === -1) {
|
|
76
|
+
publicKey = pub;
|
|
77
|
+
} else {
|
|
78
|
+
const format = publicFormat === _utils.KFormatType.PEM ? _utils.KFormatType.PEM : _utils.KFormatType.DER;
|
|
79
|
+
const exported = pub.handle.exportKey(format, _utils.KeyEncoding.SPKI);
|
|
80
|
+
if (format === _utils.KFormatType.PEM) {
|
|
81
|
+
publicKey = _reactNativeBuffer.Buffer.from(new Uint8Array(exported)).toString('utf-8');
|
|
82
|
+
} else {
|
|
83
|
+
publicKey = exported;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (privateFormat === -1) {
|
|
87
|
+
privateKey = priv;
|
|
88
|
+
} else {
|
|
89
|
+
const format = privateFormat === _utils.KFormatType.PEM ? _utils.KFormatType.PEM : _utils.KFormatType.DER;
|
|
90
|
+
const exported = priv.handle.exportKey(format, _utils.KeyEncoding.PKCS8, cipher, passphrase);
|
|
91
|
+
if (format === _utils.KFormatType.PEM) {
|
|
92
|
+
privateKey = _reactNativeBuffer.Buffer.from(new Uint8Array(exported)).toString('utf-8');
|
|
93
|
+
} else {
|
|
94
|
+
privateKey = exported;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
publicKey,
|
|
99
|
+
privateKey
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
async function dh_generateKeyPairNode(options, encoding) {
|
|
103
|
+
const dh = dh_prepareKeyGenParams(options);
|
|
104
|
+
await dh.generateKeyPair();
|
|
105
|
+
return dh_formatKeyPairOutput(dh, encoding);
|
|
106
|
+
}
|
|
107
|
+
function dh_generateKeyPairNodeSync(options, encoding) {
|
|
108
|
+
const dh = dh_prepareKeyGenParams(options);
|
|
109
|
+
dh.generateKeyPairSync();
|
|
110
|
+
return dh_formatKeyPairOutput(dh, encoding);
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=dhKeyPair.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNativeNitroModules","require","_reactNativeBuffer","_classes","_utils","_dhGroups","DhKeyPairGen","constructor","options","native","NitroModules","createHybridObject","groupName","prime","primeLength","generator","group","DH_GROUPS","Error","primeBuf","Buffer","from","setPrime","buffer","slice","byteOffset","byteLength","gen","parseInt","setGenerator","setPrimeLength","generateKeyPair","generateKeyPairSync","exports","dh_prepareKeyGenParams","dh_formatKeyPairOutput","dh","encoding","publicFormat","privateFormat","cipher","passphrase","publicKeyData","getPublicKey","privateKeyData","getPrivateKey","pub","KeyObject","createKeyObject","KFormatType","DER","KeyEncoding","SPKI","priv","PKCS8","publicKey","privateKey","format","PEM","exported","handle","exportKey","Uint8Array","toString","dh_generateKeyPairNode","dh_generateKeyPairNodeSync"],"sourceRoot":"../../src","sources":["dhKeyPair.ts"],"mappings":";;;;;;;;AAAA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAGA,IAAAG,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