react-native-quick-crypto 1.0.0-beta.20 → 1.0.0-beta.22
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 +81 -8
- package/android/CMakeLists.txt +33 -1
- package/cpp/blake3/HybridBlake3.cpp +118 -0
- package/cpp/blake3/HybridBlake3.hpp +35 -0
- package/cpp/cipher/GCMCipher.cpp +68 -0
- package/cpp/cipher/GCMCipher.hpp +14 -0
- package/cpp/cipher/HybridCipherFactory.hpp +13 -0
- package/cpp/cipher/HybridRsaCipher.cpp +229 -0
- package/cpp/cipher/HybridRsaCipher.hpp +23 -0
- package/cpp/ec/HybridEcKeyPair.cpp +428 -0
- package/cpp/ec/HybridEcKeyPair.hpp +48 -0
- package/cpp/ed25519/HybridEdKeyPair.cpp +78 -4
- package/cpp/ed25519/HybridEdKeyPair.hpp +9 -2
- package/cpp/hash/HybridHash.cpp +37 -3
- package/cpp/hash/HybridHash.hpp +5 -3
- package/cpp/keys/HybridKeyObjectHandle.cpp +742 -0
- package/cpp/keys/HybridKeyObjectHandle.hpp +51 -0
- package/cpp/keys/KeyObjectData.cpp +226 -0
- package/cpp/keys/KeyObjectData.hpp +71 -0
- package/cpp/keys/node.h +5 -0
- package/cpp/rsa/HybridRsaKeyPair.cpp +154 -0
- package/cpp/rsa/HybridRsaKeyPair.hpp +43 -0
- package/cpp/utils/Macros.hpp +68 -0
- package/cpp/utils/Utils.hpp +27 -0
- package/cpp/utils/base64.h +309 -0
- package/deps/blake3/.cargo/config.toml +2 -0
- package/deps/blake3/.git-blame-ignore-revs +2 -0
- package/deps/blake3/.github/workflows/build_b3sum.py +38 -0
- package/deps/blake3/.github/workflows/ci.yml +491 -0
- package/deps/blake3/.github/workflows/tag.yml +43 -0
- package/deps/blake3/.github/workflows/upload_github_release_asset.py +73 -0
- package/deps/blake3/CONTRIBUTING.md +31 -0
- package/deps/blake3/Cargo.toml +135 -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 +229 -0
- package/deps/blake3/b3sum/Cargo.lock +513 -0
- package/deps/blake3/b3sum/Cargo.toml +26 -0
- package/deps/blake3/b3sum/README.md +72 -0
- package/deps/blake3/b3sum/src/main.rs +564 -0
- package/deps/blake3/b3sum/src/unit_tests.rs +235 -0
- package/deps/blake3/b3sum/tests/cli_tests.rs +680 -0
- package/deps/blake3/b3sum/what_does_check_do.md +176 -0
- package/deps/blake3/benches/bench.rs +623 -0
- package/deps/blake3/build.rs +389 -0
- package/deps/blake3/c/CMakeLists.txt +383 -0
- package/deps/blake3/c/CMakePresets.json +73 -0
- package/deps/blake3/c/Makefile.testing +82 -0
- package/deps/blake3/c/README.md +403 -0
- package/deps/blake3/c/blake3-config.cmake.in +14 -0
- package/deps/blake3/c/blake3.c +650 -0
- package/deps/blake3/c/blake3.h +86 -0
- package/deps/blake3/c/blake3_avx2.c +326 -0
- package/deps/blake3/c/blake3_avx2_x86-64_unix.S +1815 -0
- package/deps/blake3/c/blake3_avx2_x86-64_windows_gnu.S +1817 -0
- package/deps/blake3/c/blake3_avx2_x86-64_windows_msvc.asm +1828 -0
- package/deps/blake3/c/blake3_avx512.c +1388 -0
- package/deps/blake3/c/blake3_avx512_x86-64_unix.S +4824 -0
- package/deps/blake3/c/blake3_avx512_x86-64_windows_gnu.S +2615 -0
- package/deps/blake3/c/blake3_avx512_x86-64_windows_msvc.asm +2634 -0
- package/deps/blake3/c/blake3_c_rust_bindings/Cargo.toml +32 -0
- package/deps/blake3/c/blake3_c_rust_bindings/README.md +4 -0
- package/deps/blake3/c/blake3_c_rust_bindings/benches/bench.rs +477 -0
- package/deps/blake3/c/blake3_c_rust_bindings/build.rs +253 -0
- package/deps/blake3/c/blake3_c_rust_bindings/cross_test.sh +31 -0
- package/deps/blake3/c/blake3_c_rust_bindings/src/lib.rs +333 -0
- package/deps/blake3/c/blake3_c_rust_bindings/src/test.rs +696 -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 +366 -0
- package/deps/blake3/c/blake3_portable.c +160 -0
- package/deps/blake3/c/blake3_sse2.c +566 -0
- package/deps/blake3/c/blake3_sse2_x86-64_unix.S +2291 -0
- package/deps/blake3/c/blake3_sse2_x86-64_windows_gnu.S +2332 -0
- package/deps/blake3/c/blake3_sse2_x86-64_windows_msvc.asm +2350 -0
- package/deps/blake3/c/blake3_sse41.c +560 -0
- package/deps/blake3/c/blake3_sse41_x86-64_unix.S +2028 -0
- package/deps/blake3/c/blake3_sse41_x86-64_windows_gnu.S +2069 -0
- package/deps/blake3/c/blake3_sse41_x86-64_windows_msvc.asm +2089 -0
- package/deps/blake3/c/blake3_tbb.cpp +37 -0
- package/deps/blake3/c/dependencies/CMakeLists.txt +3 -0
- package/deps/blake3/c/dependencies/tbb/CMakeLists.txt +28 -0
- package/deps/blake3/c/example.c +36 -0
- package/deps/blake3/c/example_tbb.c +57 -0
- package/deps/blake3/c/libblake3.pc.in +12 -0
- package/deps/blake3/c/main.c +166 -0
- package/deps/blake3/c/test.py +97 -0
- package/deps/blake3/media/B3.svg +70 -0
- package/deps/blake3/media/BLAKE3.svg +85 -0
- package/deps/blake3/media/speed.svg +1474 -0
- package/deps/blake3/reference_impl/Cargo.toml +8 -0
- package/deps/blake3/reference_impl/README.md +14 -0
- package/deps/blake3/reference_impl/reference_impl.rs +374 -0
- package/deps/blake3/src/ffi_avx2.rs +65 -0
- package/deps/blake3/src/ffi_avx512.rs +169 -0
- package/deps/blake3/src/ffi_neon.rs +82 -0
- package/deps/blake3/src/ffi_sse2.rs +126 -0
- package/deps/blake3/src/ffi_sse41.rs +126 -0
- package/deps/blake3/src/guts.rs +60 -0
- package/deps/blake3/src/hazmat.rs +704 -0
- package/deps/blake3/src/io.rs +64 -0
- package/deps/blake3/src/join.rs +92 -0
- package/deps/blake3/src/lib.rs +1835 -0
- package/deps/blake3/src/platform.rs +587 -0
- package/deps/blake3/src/portable.rs +198 -0
- package/deps/blake3/src/rust_avx2.rs +474 -0
- package/deps/blake3/src/rust_sse2.rs +775 -0
- package/deps/blake3/src/rust_sse41.rs +766 -0
- package/deps/blake3/src/test.rs +1049 -0
- package/deps/blake3/src/traits.rs +227 -0
- package/deps/blake3/src/wasm32_simd.rs +794 -0
- package/deps/blake3/test_vectors/Cargo.toml +19 -0
- package/deps/blake3/test_vectors/cross_test.sh +25 -0
- package/deps/blake3/test_vectors/src/bin/generate.rs +4 -0
- package/deps/blake3/test_vectors/src/lib.rs +350 -0
- package/deps/blake3/test_vectors/test_vectors.json +217 -0
- package/deps/blake3/tools/compiler_version/Cargo.toml +7 -0
- package/deps/blake3/tools/compiler_version/build.rs +6 -0
- package/deps/blake3/tools/compiler_version/src/main.rs +27 -0
- package/deps/blake3/tools/instruction_set_support/Cargo.toml +6 -0
- package/deps/blake3/tools/instruction_set_support/src/main.rs +10 -0
- package/deps/blake3/tools/release.md +16 -0
- package/deps/ncrypto/ncrypto.cc +4679 -0
- package/deps/ncrypto/ncrypto.h +1625 -0
- package/lib/commonjs/blake3.js +98 -0
- package/lib/commonjs/blake3.js.map +1 -0
- package/lib/commonjs/ec.js +412 -0
- package/lib/commonjs/ec.js.map +1 -0
- package/lib/commonjs/ed.js +143 -0
- package/lib/commonjs/ed.js.map +1 -1
- package/lib/commonjs/expo-plugin/withXCode.js +3 -3
- package/lib/commonjs/hash.js +48 -1
- package/lib/commonjs/hash.js.map +1 -1
- package/lib/commonjs/index.js +54 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/keys/classes.js +111 -52
- package/lib/commonjs/keys/classes.js.map +1 -1
- package/lib/commonjs/keys/generateKeyPair.js +98 -144
- package/lib/commonjs/keys/generateKeyPair.js.map +1 -1
- package/lib/commonjs/keys/index.js +27 -0
- package/lib/commonjs/keys/index.js.map +1 -1
- package/lib/commonjs/keys/utils.js +18 -13
- package/lib/commonjs/keys/utils.js.map +1 -1
- package/lib/commonjs/rsa.js +129 -0
- package/lib/commonjs/rsa.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/ecKeyPair.nitro.js +6 -0
- package/lib/commonjs/specs/ecKeyPair.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/subtle.js +768 -0
- package/lib/commonjs/subtle.js.map +1 -0
- package/lib/commonjs/utils/conversion.js +26 -3
- package/lib/commonjs/utils/conversion.js.map +1 -1
- package/lib/commonjs/utils/hashnames.js +2 -1
- package/lib/commonjs/utils/hashnames.js.map +1 -1
- package/lib/commonjs/utils/index.js +11 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/noble.js +82 -0
- package/lib/commonjs/utils/noble.js.map +1 -0
- package/lib/commonjs/utils/types.js +28 -16
- package/lib/commonjs/utils/types.js.map +1 -1
- package/lib/commonjs/utils/validation.js +74 -1
- package/lib/commonjs/utils/validation.js.map +1 -1
- package/lib/module/blake3.js +90 -0
- package/lib/module/blake3.js.map +1 -0
- package/lib/module/ec.js +404 -0
- package/lib/module/ec.js.map +1 -0
- package/lib/module/ed.js +141 -0
- package/lib/module/ed.js.map +1 -1
- package/lib/module/expo-plugin/withXCode.js +3 -3
- package/lib/module/hash.js +47 -2
- package/lib/module/hash.js.map +1 -1
- package/lib/module/index.js +9 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/keys/classes.js +108 -49
- package/lib/module/keys/classes.js.map +1 -1
- package/lib/module/keys/generateKeyPair.js +91 -143
- package/lib/module/keys/generateKeyPair.js.map +1 -1
- package/lib/module/keys/index.js +9 -6
- package/lib/module/keys/index.js.map +1 -1
- package/lib/module/keys/utils.js +16 -12
- package/lib/module/keys/utils.js.map +1 -1
- package/lib/module/rsa.js +123 -0
- package/lib/module/rsa.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/ecKeyPair.nitro.js +4 -0
- package/lib/module/specs/ecKeyPair.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/subtle.js +763 -0
- package/lib/module/subtle.js.map +1 -0
- package/lib/module/utils/conversion.js +8 -3
- package/lib/module/utils/conversion.js.map +1 -1
- package/lib/module/utils/hashnames.js +2 -1
- package/lib/module/utils/hashnames.js.map +1 -1
- package/lib/module/utils/index.js +1 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/noble.js +76 -0
- package/lib/module/utils/noble.js.map +1 -0
- package/lib/module/utils/types.js +26 -17
- package/lib/module/utils/types.js.map +1 -1
- package/lib/module/utils/validation.js +69 -1
- package/lib/module/utils/validation.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/typescript/blake3.d.ts +33 -0
- package/lib/typescript/blake3.d.ts.map +1 -0
- package/lib/typescript/ec.d.ts +13 -0
- package/lib/typescript/ec.d.ts.map +1 -0
- package/lib/typescript/ed.d.ts +27 -1
- package/lib/typescript/ed.d.ts.map +1 -1
- package/lib/typescript/hash.d.ts +14 -1
- package/lib/typescript/hash.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +45 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/keys/classes.d.ts +49 -8
- package/lib/typescript/keys/classes.d.ts.map +1 -1
- package/lib/typescript/keys/generateKeyPair.d.ts +5 -0
- package/lib/typescript/keys/generateKeyPair.d.ts.map +1 -1
- package/lib/typescript/keys/index.d.ts +5 -2
- package/lib/typescript/keys/index.d.ts.map +1 -1
- package/lib/typescript/keys/utils.d.ts +3 -1
- package/lib/typescript/keys/utils.d.ts.map +1 -1
- package/lib/typescript/rsa.d.ts +10 -0
- package/lib/typescript/rsa.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/ecKeyPair.nitro.d.ts +20 -0
- package/lib/typescript/specs/ecKeyPair.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/edKeyPair.nitro.d.ts +1 -0
- package/lib/typescript/specs/edKeyPair.nitro.d.ts.map +1 -1
- package/lib/typescript/specs/hash.nitro.d.ts +1 -0
- package/lib/typescript/specs/hash.nitro.d.ts.map +1 -1
- package/lib/typescript/specs/keyObjectHandle.nitro.d.ts +1 -1
- package/lib/typescript/specs/keyObjectHandle.nitro.d.ts.map +1 -1
- package/lib/typescript/specs/rsaCipher.nitro.d.ts +26 -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/subtle.d.ts +17 -0
- package/lib/typescript/subtle.d.ts.map +1 -0
- package/lib/typescript/utils/cipher.d.ts +1 -1
- package/lib/typescript/utils/conversion.d.ts +1 -0
- package/lib/typescript/utils/conversion.d.ts.map +1 -1
- package/lib/typescript/utils/hashnames.d.ts +3 -1
- package/lib/typescript/utils/hashnames.d.ts.map +1 -1
- package/lib/typescript/utils/index.d.ts +1 -0
- package/lib/typescript/utils/index.d.ts.map +1 -1
- package/lib/typescript/utils/noble.d.ts +19 -0
- package/lib/typescript/utils/noble.d.ts.map +1 -0
- package/lib/typescript/utils/types.d.ts +102 -18
- package/lib/typescript/utils/types.d.ts.map +1 -1
- package/lib/typescript/utils/validation.d.ts +5 -0
- package/lib/typescript/utils/validation.d.ts.map +1 -1
- package/nitrogen/generated/.gitattributes +1 -1
- package/nitrogen/generated/android/QuickCrypto+autolinking.cmake +4 -0
- package/nitrogen/generated/android/QuickCryptoOnLoad.cpp +50 -0
- package/nitrogen/generated/ios/QuickCrypto-Swift-Cxx-Umbrella.hpp +2 -1
- package/nitrogen/generated/ios/QuickCryptoAutolinking.mm +50 -0
- package/nitrogen/generated/shared/c++/AsymmetricKeyType.hpp +104 -0
- package/nitrogen/generated/shared/c++/CipherArgs.hpp +4 -6
- package/nitrogen/generated/shared/c++/HybridBlake3Spec.cpp +28 -0
- package/nitrogen/generated/shared/c++/HybridBlake3Spec.hpp +76 -0
- package/nitrogen/generated/shared/c++/HybridCipherFactorySpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridCipherSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridEcKeyPairSpec.cpp +29 -0
- package/nitrogen/generated/shared/c++/HybridEcKeyPairSpec.hpp +77 -0
- package/nitrogen/generated/shared/c++/HybridEdKeyPairSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridEdKeyPairSpec.hpp +3 -2
- package/nitrogen/generated/shared/c++/HybridHashSpec.cpp +1 -0
- package/nitrogen/generated/shared/c++/HybridHashSpec.hpp +2 -1
- package/nitrogen/generated/shared/c++/HybridKeyObjectHandleSpec.hpp +6 -6
- package/nitrogen/generated/shared/c++/HybridPbkdf2Spec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridRandomSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridRsaCipherSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridRsaCipherSpec.hpp +70 -0
- package/nitrogen/generated/shared/c++/HybridRsaKeyPairSpec.cpp +29 -0
- package/nitrogen/generated/shared/c++/HybridRsaKeyPairSpec.hpp +77 -0
- package/nitrogen/generated/shared/c++/JWK.hpp +15 -17
- package/nitrogen/generated/shared/c++/JWKkty.hpp +11 -13
- package/nitrogen/generated/shared/c++/JWKuse.hpp +7 -9
- package/nitrogen/generated/shared/c++/KFormatType.hpp +12 -14
- package/nitrogen/generated/shared/c++/KeyDetail.hpp +4 -6
- package/nitrogen/generated/shared/c++/KeyEncoding.hpp +13 -15
- package/nitrogen/generated/shared/c++/KeyObject.hpp +67 -0
- package/nitrogen/generated/shared/c++/KeyType.hpp +9 -11
- package/nitrogen/generated/shared/c++/KeyUsage.hpp +37 -23
- package/nitrogen/generated/shared/c++/NamedCurve.hpp +9 -11
- package/package.json +14 -11
- package/src/blake3.ts +123 -0
- package/src/ec.ts +534 -0
- package/src/ed.ts +179 -2
- package/src/expo-plugin/withXCode.ts +3 -3
- package/src/hash.ts +68 -2
- package/src/index.ts +8 -0
- package/src/keys/classes.ts +161 -55
- package/src/keys/generateKeyPair.ts +133 -134
- package/src/keys/index.ts +13 -3
- package/src/keys/utils.ts +24 -18
- package/src/rsa.ts +176 -0
- package/src/specs/blake3.nitro.ts +12 -0
- package/src/specs/ecKeyPair.nitro.ts +38 -0
- package/src/specs/edKeyPair.nitro.ts +2 -0
- package/src/specs/hash.nitro.ts +1 -0
- package/src/specs/keyObjectHandle.nitro.ts +1 -1
- package/src/specs/rsaCipher.nitro.ts +35 -0
- package/src/specs/rsaKeyPair.nitro.ts +33 -0
- package/src/subtle.ts +1119 -0
- package/src/utils/conversion.ts +10 -2
- package/src/utils/hashnames.ts +4 -2
- package/src/utils/index.ts +1 -0
- package/src/utils/noble.ts +85 -0
- package/src/utils/types.ts +148 -26
- package/src/utils/validation.ts +96 -1
- package/ios/libsodium-stable/.github/workflows/autocloser.yml +0 -12
- package/ios/libsodium-stable/.github/workflows/ci.yml +0 -180
- package/ios/libsodium-stable/.github/workflows/cifuzz.yml +0 -32
- package/ios/libsodium-stable/.github/workflows/codeql-analysis.yml +0 -48
- package/ios/libsodium-stable/.github/workflows/dotnet-core.yml +0 -388
- package/ios/libsodium-stable/AUTHORS +0 -144
- package/ios/libsodium-stable/CITATION.cff +0 -18
- package/ios/libsodium-stable/ChangeLog +0 -677
- package/ios/libsodium-stable/LICENSE +0 -18
- package/ios/libsodium-stable/Makefile.am +0 -23
- package/ios/libsodium-stable/README.markdown +0 -76
- package/ios/libsodium-stable/THANKS +0 -92
- package/ios/libsodium-stable/appveyor.yml +0 -24
- package/ios/libsodium-stable/autogen.sh +0 -117
- package/ios/libsodium-stable/azure-pipelines.yml +0 -122
- package/ios/libsodium-stable/build.zig +0 -281
- package/ios/libsodium-stable/builds/Makefile.am +0 -81
- package/ios/libsodium-stable/builds/msvc/build/buildall.bat +0 -18
- package/ios/libsodium-stable/builds/msvc/build/buildbase.bat +0 -132
- package/ios/libsodium-stable/builds/msvc/properties/ARM64.props +0 -23
- package/ios/libsodium-stable/builds/msvc/properties/Common.props +0 -21
- package/ios/libsodium-stable/builds/msvc/properties/DLL.props +0 -16
- package/ios/libsodium-stable/builds/msvc/properties/Debug.props +0 -29
- package/ios/libsodium-stable/builds/msvc/properties/DebugDEXE.props +0 -21
- package/ios/libsodium-stable/builds/msvc/properties/DebugDLL.props +0 -20
- package/ios/libsodium-stable/builds/msvc/properties/DebugLEXE.props +0 -20
- package/ios/libsodium-stable/builds/msvc/properties/DebugLIB.props +0 -21
- package/ios/libsodium-stable/builds/msvc/properties/DebugLTCG.props +0 -20
- package/ios/libsodium-stable/builds/msvc/properties/DebugSEXE.props +0 -21
- package/ios/libsodium-stable/builds/msvc/properties/EXE.props +0 -17
- package/ios/libsodium-stable/builds/msvc/properties/LIB.props +0 -16
- package/ios/libsodium-stable/builds/msvc/properties/LTCG.props +0 -13
- package/ios/libsodium-stable/builds/msvc/properties/Link.props +0 -21
- package/ios/libsodium-stable/builds/msvc/properties/Messages.props +0 -15
- package/ios/libsodium-stable/builds/msvc/properties/Output.props +0 -30
- package/ios/libsodium-stable/builds/msvc/properties/Release.props +0 -41
- package/ios/libsodium-stable/builds/msvc/properties/ReleaseDEXE.props +0 -20
- package/ios/libsodium-stable/builds/msvc/properties/ReleaseDLL.props +0 -19
- package/ios/libsodium-stable/builds/msvc/properties/ReleaseLEXE.props +0 -20
- package/ios/libsodium-stable/builds/msvc/properties/ReleaseLIB.props +0 -19
- package/ios/libsodium-stable/builds/msvc/properties/ReleaseLTCG.props +0 -19
- package/ios/libsodium-stable/builds/msvc/properties/ReleaseSEXE.props +0 -20
- package/ios/libsodium-stable/builds/msvc/properties/Win32.props +0 -23
- package/ios/libsodium-stable/builds/msvc/properties/x64.props +0 -26
- package/ios/libsodium-stable/builds/msvc/resource.h +0 -14
- package/ios/libsodium-stable/builds/msvc/resource.rc +0 -65
- package/ios/libsodium-stable/builds/msvc/version.h +0 -33
- package/ios/libsodium-stable/builds/msvc/vs2010/libsodium/libsodium.props +0 -48
- package/ios/libsodium-stable/builds/msvc/vs2010/libsodium/libsodium.vcxproj +0 -346
- package/ios/libsodium-stable/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters +0 -1088
- package/ios/libsodium-stable/builds/msvc/vs2010/libsodium/libsodium.xml +0 -15
- package/ios/libsodium-stable/builds/msvc/vs2010/libsodium.import.props +0 -52
- package/ios/libsodium-stable/builds/msvc/vs2010/libsodium.import.xml +0 -17
- package/ios/libsodium-stable/builds/msvc/vs2010/libsodium.sln +0 -50
- package/ios/libsodium-stable/builds/msvc/vs2012/libsodium/libsodium.props +0 -48
- package/ios/libsodium-stable/builds/msvc/vs2012/libsodium/libsodium.vcxproj +0 -346
- package/ios/libsodium-stable/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters +0 -1088
- package/ios/libsodium-stable/builds/msvc/vs2012/libsodium/libsodium.xml +0 -15
- package/ios/libsodium-stable/builds/msvc/vs2012/libsodium.import.props +0 -52
- package/ios/libsodium-stable/builds/msvc/vs2012/libsodium.import.xml +0 -17
- package/ios/libsodium-stable/builds/msvc/vs2012/libsodium.sln +0 -50
- package/ios/libsodium-stable/builds/msvc/vs2013/libsodium/libsodium.props +0 -48
- package/ios/libsodium-stable/builds/msvc/vs2013/libsodium/libsodium.vcxproj +0 -346
- package/ios/libsodium-stable/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters +0 -1088
- package/ios/libsodium-stable/builds/msvc/vs2013/libsodium/libsodium.xml +0 -15
- package/ios/libsodium-stable/builds/msvc/vs2013/libsodium.import.props +0 -52
- package/ios/libsodium-stable/builds/msvc/vs2013/libsodium.import.xml +0 -17
- package/ios/libsodium-stable/builds/msvc/vs2013/libsodium.sln +0 -52
- package/ios/libsodium-stable/builds/msvc/vs2015/libsodium/libsodium.props +0 -48
- package/ios/libsodium-stable/builds/msvc/vs2015/libsodium/libsodium.vcxproj +0 -346
- package/ios/libsodium-stable/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters +0 -1088
- package/ios/libsodium-stable/builds/msvc/vs2015/libsodium/libsodium.xml +0 -15
- package/ios/libsodium-stable/builds/msvc/vs2015/libsodium.import.props +0 -52
- package/ios/libsodium-stable/builds/msvc/vs2015/libsodium.import.xml +0 -17
- package/ios/libsodium-stable/builds/msvc/vs2015/libsodium.sln +0 -52
- package/ios/libsodium-stable/builds/msvc/vs2017/libsodium/libsodium.props +0 -48
- package/ios/libsodium-stable/builds/msvc/vs2017/libsodium/libsodium.vcxproj +0 -346
- package/ios/libsodium-stable/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters +0 -1088
- package/ios/libsodium-stable/builds/msvc/vs2017/libsodium/libsodium.xml +0 -15
- package/ios/libsodium-stable/builds/msvc/vs2017/libsodium.import.props +0 -52
- package/ios/libsodium-stable/builds/msvc/vs2017/libsodium.import.xml +0 -17
- package/ios/libsodium-stable/builds/msvc/vs2017/libsodium.sln +0 -52
- package/ios/libsodium-stable/builds/msvc/vs2019/libsodium/libsodium.props +0 -48
- package/ios/libsodium-stable/builds/msvc/vs2019/libsodium/libsodium.vcxproj +0 -370
- package/ios/libsodium-stable/builds/msvc/vs2019/libsodium/libsodium.vcxproj.filters +0 -1088
- package/ios/libsodium-stable/builds/msvc/vs2019/libsodium/libsodium.xml +0 -15
- package/ios/libsodium-stable/builds/msvc/vs2019/libsodium.import.props +0 -52
- package/ios/libsodium-stable/builds/msvc/vs2019/libsodium.import.xml +0 -17
- package/ios/libsodium-stable/builds/msvc/vs2019/libsodium.sln +0 -52
- package/ios/libsodium-stable/builds/msvc/vs2022/libsodium/libsodium.props +0 -48
- package/ios/libsodium-stable/builds/msvc/vs2022/libsodium/libsodium.vcxproj +0 -370
- package/ios/libsodium-stable/builds/msvc/vs2022/libsodium/libsodium.vcxproj.filters +0 -1088
- package/ios/libsodium-stable/builds/msvc/vs2022/libsodium/libsodium.xml +0 -15
- package/ios/libsodium-stable/builds/msvc/vs2022/libsodium.import.props +0 -52
- package/ios/libsodium-stable/builds/msvc/vs2022/libsodium.import.xml +0 -17
- package/ios/libsodium-stable/builds/msvc/vs2022/libsodium.sln +0 -70
- package/ios/libsodium-stable/ci/appveyor/libsodium.sln +0 -40
- package/ios/libsodium-stable/ci/appveyor/libsodium.vcxproj +0 -594
- package/ios/libsodium-stable/ci/appveyor/libsodium.vcxproj.filters +0 -813
- package/ios/libsodium-stable/ci/appveyor/msvc-scripts/process.bat +0 -5
- package/ios/libsodium-stable/ci/appveyor/msvc-scripts/rep.vbs +0 -12
- package/ios/libsodium-stable/ci/appveyor/msvc-scripts/sodium.props +0 -29
- package/ios/libsodium-stable/configure.ac +0 -1004
- package/ios/libsodium-stable/contrib/Findsodium.cmake +0 -297
- package/ios/libsodium-stable/contrib/Makefile.am +0 -3
- package/ios/libsodium-stable/dist-build/Makefile.am +0 -14
- package/ios/libsodium-stable/dist-build/android-aar.sh +0 -194
- package/ios/libsodium-stable/dist-build/android-armv7-a.sh +0 -5
- package/ios/libsodium-stable/dist-build/android-armv8-a.sh +0 -5
- package/ios/libsodium-stable/dist-build/android-build.sh +0 -95
- package/ios/libsodium-stable/dist-build/android-x86.sh +0 -5
- package/ios/libsodium-stable/dist-build/android-x86_64.sh +0 -5
- package/ios/libsodium-stable/dist-build/apple-xcframework.sh +0 -628
- package/ios/libsodium-stable/dist-build/emscripten-symbols.def +0 -651
- package/ios/libsodium-stable/dist-build/emscripten.sh +0 -206
- package/ios/libsodium-stable/dist-build/generate-emscripten-symbols.sh +0 -59
- package/ios/libsodium-stable/dist-build/macos.sh +0 -26
- package/ios/libsodium-stable/dist-build/msys2-win32.sh +0 -18
- package/ios/libsodium-stable/dist-build/msys2-win64.sh +0 -18
- package/ios/libsodium-stable/dist-build/wasm32-wasi.sh +0 -45
- package/ios/libsodium-stable/lgtm.yml +0 -6
- package/ios/libsodium-stable/libsodium-uninstalled.pc.in +0 -7
- package/ios/libsodium-stable/libsodium.pc.in +0 -12
- package/ios/libsodium-stable/logo.png +0 -0
- package/ios/libsodium-stable/m4/ax_add_fortify_source.m4 +0 -119
- package/ios/libsodium-stable/m4/ax_check_catchable_abrt.m4 +0 -57
- package/ios/libsodium-stable/m4/ax_check_catchable_segv.m4 +0 -47
- package/ios/libsodium-stable/m4/ax_check_compile_flag.m4 +0 -55
- package/ios/libsodium-stable/m4/ax_check_define.m4 +0 -73
- package/ios/libsodium-stable/m4/ax_check_gnu_make.m4 +0 -95
- package/ios/libsodium-stable/m4/ax_check_link_flag.m4 +0 -75
- package/ios/libsodium-stable/m4/ax_pthread.m4 +0 -522
- package/ios/libsodium-stable/m4/ax_tls.m4 +0 -71
- package/ios/libsodium-stable/m4/ax_valgrind_check.m4 +0 -239
- package/ios/libsodium-stable/m4/ld-output-def.m4 +0 -29
- package/ios/libsodium-stable/packaging/dotnet-core/libsodium.pkgproj +0 -49
- package/ios/libsodium-stable/packaging/dotnet-core/test.cs +0 -43
- package/ios/libsodium-stable/packaging/nuget/package.bat +0 -13
- package/ios/libsodium-stable/packaging/nuget/package.config +0 -4
- package/ios/libsodium-stable/packaging/nuget/package.gsl +0 -260
- package/ios/libsodium-stable/regen-msvc/libsodium.vcxproj +0 -326
- package/ios/libsodium-stable/regen-msvc/libsodium.vcxproj.filters +0 -23
- package/ios/libsodium-stable/regen-msvc/libsodium.vcxproj.filters.tpl +0 -35
- package/ios/libsodium-stable/regen-msvc/libsodium.vcxproj.tpl +0 -37
- package/ios/libsodium-stable/regen-msvc/regen-msvc.py +0 -240
- package/ios/libsodium-stable/regen-msvc/tl_libsodium.vcxproj.filters.tpl +0 -23
- package/ios/libsodium-stable/regen-msvc/tl_libsodium.vcxproj.tpl +0 -332
- package/ios/libsodium-stable/src/Makefile.am +0 -3
- package/ios/libsodium-stable/src/libsodium/Makefile.am +0 -314
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aegis128l/aead_aegis128l.c +0 -159
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aegis128l/aegis128l_aesni.c +0 -70
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aegis128l/aegis128l_aesni.h +0 -8
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.c +0 -72
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aegis128l/aegis128l_armcrypto.h +0 -8
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aegis128l/aegis128l_common.h +0 -248
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aegis128l/aegis128l_soft.c +0 -59
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aegis128l/aegis128l_soft.h +0 -8
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aegis128l/implementations.h +0 -17
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aegis256/aead_aegis256.c +0 -158
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aegis256/aegis256_aesni.c +0 -65
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aegis256/aegis256_aesni.h +0 -8
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.c +0 -70
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aegis256/aegis256_armcrypto.h +0 -8
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aegis256/aegis256_common.h +0 -231
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aegis256/aegis256_soft.c +0 -54
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aegis256/aegis256_soft.h +0 -8
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aegis256/implementations.h +0 -17
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aes256gcm/aead_aes256gcm.c +0 -157
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +0 -1015
- package/ios/libsodium-stable/src/libsodium/crypto_aead/aes256gcm/armcrypto/aead_aes256gcm_armcrypto.c +0 -1033
- package/ios/libsodium-stable/src/libsodium/crypto_aead/chacha20poly1305/aead_chacha20poly1305.c +0 -400
- package/ios/libsodium-stable/src/libsodium/crypto_aead/xchacha20poly1305/aead_xchacha20poly1305.c +0 -262
- package/ios/libsodium-stable/src/libsodium/crypto_auth/crypto_auth.c +0 -41
- package/ios/libsodium-stable/src/libsodium/crypto_auth/hmacsha256/auth_hmacsha256.c +0 -118
- package/ios/libsodium-stable/src/libsodium/crypto_auth/hmacsha512/auth_hmacsha512.c +0 -118
- package/ios/libsodium-stable/src/libsodium/crypto_auth/hmacsha512256/auth_hmacsha512256.c +0 -93
- package/ios/libsodium-stable/src/libsodium/crypto_box/crypto_box.c +0 -114
- package/ios/libsodium-stable/src/libsodium/crypto_box/crypto_box_easy.c +0 -115
- package/ios/libsodium-stable/src/libsodium/crypto_box/crypto_box_seal.c +0 -68
- package/ios/libsodium-stable/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c +0 -204
- package/ios/libsodium-stable/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_seal_curve25519xchacha20poly1305.c +0 -79
- package/ios/libsodium-stable/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c +0 -156
- package/ios/libsodium-stable/src/libsodium/crypto_core/ed25519/core_ed25519.c +0 -225
- package/ios/libsodium-stable/src/libsodium/crypto_core/ed25519/core_ristretto255.c +0 -156
- package/ios/libsodium-stable/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c +0 -2873
- package/ios/libsodium-stable/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/base.h +0 -1344
- package/ios/libsodium-stable/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/base2.h +0 -40
- package/ios/libsodium-stable/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/constants.h +0 -40
- package/ios/libsodium-stable/src/libsodium/crypto_core/ed25519/ref10/fe_25_5/fe.h +0 -220
- package/ios/libsodium-stable/src/libsodium/crypto_core/ed25519/ref10/fe_51/base.h +0 -1344
- package/ios/libsodium-stable/src/libsodium/crypto_core/ed25519/ref10/fe_51/base2.h +0 -40
- package/ios/libsodium-stable/src/libsodium/crypto_core/ed25519/ref10/fe_51/constants.h +0 -41
- package/ios/libsodium-stable/src/libsodium/crypto_core/ed25519/ref10/fe_51/fe.h +0 -116
- package/ios/libsodium-stable/src/libsodium/crypto_core/hchacha20/core_hchacha20.c +0 -93
- package/ios/libsodium-stable/src/libsodium/crypto_core/hsalsa20/core_hsalsa20.c +0 -21
- package/ios/libsodium-stable/src/libsodium/crypto_core/hsalsa20/ref2/core_hsalsa20_ref2.c +0 -95
- package/ios/libsodium-stable/src/libsodium/crypto_core/salsa/ref/core_salsa_ref.c +0 -195
- package/ios/libsodium-stable/src/libsodium/crypto_core/softaes/softaes.c +0 -340
- package/ios/libsodium-stable/src/libsodium/crypto_generichash/blake2b/generichash_blake2.c +0 -55
- package/ios/libsodium-stable/src/libsodium/crypto_generichash/blake2b/ref/blake2.h +0 -106
- package/ios/libsodium-stable/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c +0 -52
- package/ios/libsodium-stable/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.h +0 -142
- package/ios/libsodium-stable/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ref.c +0 -93
- package/ios/libsodium-stable/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c +0 -91
- package/ios/libsodium-stable/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.h +0 -106
- package/ios/libsodium-stable/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c +0 -95
- package/ios/libsodium-stable/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.h +0 -106
- package/ios/libsodium-stable/src/libsodium/crypto_generichash/blake2b/ref/blake2b-load-avx2.h +0 -340
- package/ios/libsodium-stable/src/libsodium/crypto_generichash/blake2b/ref/blake2b-load-sse2.h +0 -164
- package/ios/libsodium-stable/src/libsodium/crypto_generichash/blake2b/ref/blake2b-load-sse41.h +0 -307
- package/ios/libsodium-stable/src/libsodium/crypto_generichash/blake2b/ref/blake2b-ref.c +0 -438
- package/ios/libsodium-stable/src/libsodium/crypto_generichash/blake2b/ref/generichash_blake2b.c +0 -116
- package/ios/libsodium-stable/src/libsodium/crypto_generichash/crypto_generichash.c +0 -91
- package/ios/libsodium-stable/src/libsodium/crypto_hash/crypto_hash.c +0 -20
- package/ios/libsodium-stable/src/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c +0 -256
- package/ios/libsodium-stable/src/libsodium/crypto_hash/sha256/hash_sha256.c +0 -13
- package/ios/libsodium-stable/src/libsodium/crypto_hash/sha512/cp/hash_sha512_cp.c +0 -284
- package/ios/libsodium-stable/src/libsodium/crypto_hash/sha512/hash_sha512.c +0 -13
- package/ios/libsodium-stable/src/libsodium/crypto_kdf/blake2b/kdf_blake2b.c +0 -52
- package/ios/libsodium-stable/src/libsodium/crypto_kdf/crypto_kdf.c +0 -49
- package/ios/libsodium-stable/src/libsodium/crypto_kdf/hkdf/kdf_hkdf_sha256.c +0 -123
- package/ios/libsodium-stable/src/libsodium/crypto_kdf/hkdf/kdf_hkdf_sha512.c +0 -123
- package/ios/libsodium-stable/src/libsodium/crypto_kx/crypto_kx.c +0 -143
- package/ios/libsodium-stable/src/libsodium/crypto_onetimeauth/crypto_onetimeauth.c +0 -71
- package/ios/libsodium-stable/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.c +0 -124
- package/ios/libsodium-stable/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.h +0 -12
- package/ios/libsodium-stable/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna32.h +0 -235
- package/ios/libsodium-stable/src/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna64.h +0 -221
- package/ios/libsodium-stable/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c +0 -90
- package/ios/libsodium-stable/src/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.h +0 -21
- package/ios/libsodium-stable/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c +0 -957
- package/ios/libsodium-stable/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.h +0 -12
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/argon2/argon2-core.c +0 -556
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/argon2/argon2-core.h +0 -271
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/argon2/argon2-encoding.c +0 -306
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/argon2/argon2-encoding.h +0 -34
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c +0 -243
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c +0 -251
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c +0 -234
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c +0 -244
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/argon2/argon2.c +0 -283
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/argon2/argon2.h +0 -305
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/argon2/blake2b-long.c +0 -79
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/argon2/blake2b-long.h +0 -8
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/argon2/blamka-round-avx2.h +0 -150
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/argon2/blamka-round-avx512f.h +0 -145
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/argon2/blamka-round-ref.h +0 -40
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/argon2/blamka-round-ssse3.h +0 -124
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c +0 -294
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c +0 -238
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/crypto_pwhash.c +0 -212
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c +0 -268
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h +0 -92
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c +0 -318
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c +0 -96
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.h +0 -45
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c +0 -301
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c +0 -112
- package/ios/libsodium-stable/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c +0 -406
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/crypto_scalarmult.c +0 -33
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c +0 -182
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.h +0 -10
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts.S +0 -25
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/sandy2x/consts_namespace.h +0 -20
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c +0 -71
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.h +0 -9
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe.h +0 -26
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51.h +0 -35
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_invert.c +0 -58
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_mul.S +0 -200
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_namespace.h +0 -16
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S +0 -174
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe51_pack.S +0 -228
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c +0 -78
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.S +0 -1442
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.h +0 -18
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_namespace.h +0 -8
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/sandy2x/sandy2x.S +0 -16
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c +0 -60
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.h +0 -11
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/ed25519/ref10/scalarmult_ed25519_ref10.c +0 -121
- package/ios/libsodium-stable/src/libsodium/crypto_scalarmult/ristretto255/ref10/scalarmult_ristretto255_ref10.c +0 -63
- package/ios/libsodium-stable/src/libsodium/crypto_secretbox/crypto_secretbox.c +0 -67
- package/ios/libsodium-stable/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c +0 -145
- package/ios/libsodium-stable/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c +0 -177
- package/ios/libsodium-stable/src/libsodium/crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305.c +0 -89
- package/ios/libsodium-stable/src/libsodium/crypto_secretstream/xchacha20poly1305/secretstream_xchacha20poly1305.c +0 -313
- package/ios/libsodium-stable/src/libsodium/crypto_shorthash/crypto_shorthash.c +0 -34
- package/ios/libsodium-stable/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.c +0 -71
- package/ios/libsodium-stable/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphash_ref.h +0 -24
- package/ios/libsodium-stable/src/libsodium/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.c +0 -77
- package/ios/libsodium-stable/src/libsodium/crypto_shorthash/siphash24/shorthash_siphash24.c +0 -11
- package/ios/libsodium-stable/src/libsodium/crypto_shorthash/siphash24/shorthash_siphashx24.c +0 -11
- package/ios/libsodium-stable/src/libsodium/crypto_sign/crypto_sign.c +0 -115
- package/ios/libsodium-stable/src/libsodium/crypto_sign/ed25519/ref10/keypair.c +0 -84
- package/ios/libsodium-stable/src/libsodium/crypto_sign/ed25519/ref10/obsolete.c +0 -118
- package/ios/libsodium-stable/src/libsodium/crypto_sign/ed25519/ref10/open.c +0 -98
- package/ios/libsodium-stable/src/libsodium/crypto_sign/ed25519/ref10/sign.c +0 -128
- package/ios/libsodium-stable/src/libsodium/crypto_sign/ed25519/ref10/sign_ed25519_ref10.h +0 -18
- package/ios/libsodium-stable/src/libsodium/crypto_sign/ed25519/sign_ed25519.c +0 -97
- package/ios/libsodium-stable/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c +0 -180
- package/ios/libsodium-stable/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.h +0 -8
- package/ios/libsodium-stable/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c +0 -176
- package/ios/libsodium-stable/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.h +0 -8
- package/ios/libsodium-stable/src/libsodium/crypto_stream/chacha20/dolbeau/u0.h +0 -86
- package/ios/libsodium-stable/src/libsodium/crypto_stream/chacha20/dolbeau/u1.h +0 -98
- package/ios/libsodium-stable/src/libsodium/crypto_stream/chacha20/dolbeau/u4.h +0 -177
- package/ios/libsodium-stable/src/libsodium/crypto_stream/chacha20/dolbeau/u8.h +0 -326
- package/ios/libsodium-stable/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c +0 -312
- package/ios/libsodium-stable/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.h +0 -8
- package/ios/libsodium-stable/src/libsodium/crypto_stream/chacha20/stream_chacha20.c +0 -184
- package/ios/libsodium-stable/src/libsodium/crypto_stream/chacha20/stream_chacha20.h +0 -22
- package/ios/libsodium-stable/src/libsodium/crypto_stream/crypto_stream.c +0 -49
- package/ios/libsodium-stable/src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.c +0 -120
- package/ios/libsodium-stable/src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.h +0 -8
- package/ios/libsodium-stable/src/libsodium/crypto_stream/salsa20/stream_salsa20.c +0 -100
- package/ios/libsodium-stable/src/libsodium/crypto_stream/salsa20/stream_salsa20.h +0 -16
- package/ios/libsodium-stable/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6-asm.S +0 -965
- package/ios/libsodium-stable/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6.c +0 -31
- package/ios/libsodium-stable/src/libsodium/crypto_stream/salsa20/xmm6/salsa20_xmm6.h +0 -8
- package/ios/libsodium-stable/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c +0 -134
- package/ios/libsodium-stable/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.h +0 -8
- package/ios/libsodium-stable/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c +0 -128
- package/ios/libsodium-stable/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.h +0 -8
- package/ios/libsodium-stable/src/libsodium/crypto_stream/salsa20/xmm6int/u0.h +0 -195
- package/ios/libsodium-stable/src/libsodium/crypto_stream/salsa20/xmm6int/u1.h +0 -207
- package/ios/libsodium-stable/src/libsodium/crypto_stream/salsa20/xmm6int/u4.h +0 -547
- package/ios/libsodium-stable/src/libsodium/crypto_stream/salsa20/xmm6int/u8.h +0 -477
- package/ios/libsodium-stable/src/libsodium/crypto_stream/salsa2012/ref/stream_salsa2012_ref.c +0 -106
- package/ios/libsodium-stable/src/libsodium/crypto_stream/salsa2012/stream_salsa2012.c +0 -26
- package/ios/libsodium-stable/src/libsodium/crypto_stream/salsa208/ref/stream_salsa208_ref.c +0 -106
- package/ios/libsodium-stable/src/libsodium/crypto_stream/salsa208/stream_salsa208.c +0 -26
- package/ios/libsodium-stable/src/libsodium/crypto_stream/xchacha20/stream_xchacha20.c +0 -69
- package/ios/libsodium-stable/src/libsodium/crypto_stream/xsalsa20/stream_xsalsa20.c +0 -66
- package/ios/libsodium-stable/src/libsodium/crypto_verify/verify.c +0 -103
- package/ios/libsodium-stable/src/libsodium/include/Makefile.am +0 -76
- package/ios/libsodium-stable/src/libsodium/include/sodium/core.h +0 -28
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_aead_aegis128l.h +0 -92
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_aead_aegis256.h +0 -92
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_aead_aes256gcm.h +0 -179
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_aead_chacha20poly1305.h +0 -180
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_aead_xchacha20poly1305.h +0 -100
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_auth.h +0 -46
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_auth_hmacsha256.h +0 -70
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_auth_hmacsha512.h +0 -68
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_auth_hmacsha512256.h +0 -65
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_box.h +0 -177
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_box_curve25519xchacha20poly1305.h +0 -164
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_box_curve25519xsalsa20poly1305.h +0 -112
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_core_ed25519.h +0 -100
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_core_hchacha20.h +0 -36
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_core_hsalsa20.h +0 -36
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_core_ristretto255.h +0 -100
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_core_salsa20.h +0 -36
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_core_salsa2012.h +0 -36
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_core_salsa208.h +0 -40
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_generichash.h +0 -84
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_generichash_blake2b.h +0 -122
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_hash.h +0 -40
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_hash_sha256.h +0 -60
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_hash_sha512.h +0 -60
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_kdf.h +0 -53
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_kdf_blake2b.h +0 -44
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_kdf_hkdf_sha256.h +0 -74
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_kdf_hkdf_sha512.h +0 -75
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_kx.h +0 -66
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_onetimeauth.h +0 -65
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h +0 -72
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_pwhash.h +0 -147
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_pwhash_argon2i.h +0 -122
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_pwhash_argon2id.h +0 -122
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_pwhash_scryptsalsa208sha256.h +0 -120
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_scalarmult.h +0 -46
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_scalarmult_curve25519.h +0 -42
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_scalarmult_ed25519.h +0 -51
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_scalarmult_ristretto255.h +0 -43
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_secretbox.h +0 -93
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_secretbox_xchacha20poly1305.h +0 -70
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_secretbox_xsalsa20poly1305.h +0 -69
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_secretstream_xchacha20poly1305.h +0 -108
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_shorthash.h +0 -41
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_shorthash_siphash24.h +0 -50
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_sign.h +0 -107
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_sign_ed25519.h +0 -124
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_sign_edwards25519sha512batch.h +0 -55
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_stream.h +0 -59
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_stream_chacha20.h +0 -106
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_stream_salsa20.h +0 -61
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_stream_salsa2012.h +0 -53
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_stream_salsa208.h +0 -56
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_stream_xchacha20.h +0 -61
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_stream_xsalsa20.h +0 -61
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_verify_16.h +0 -23
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_verify_32.h +0 -23
- package/ios/libsodium-stable/src/libsodium/include/sodium/crypto_verify_64.h +0 -23
- package/ios/libsodium-stable/src/libsodium/include/sodium/export.h +0 -57
- package/ios/libsodium-stable/src/libsodium/include/sodium/private/asm_cet.h +0 -11
- package/ios/libsodium-stable/src/libsodium/include/sodium/private/chacha20_ietf_ext.h +0 -16
- package/ios/libsodium-stable/src/libsodium/include/sodium/private/common.h +0 -296
- package/ios/libsodium-stable/src/libsodium/include/sodium/private/ed25519_ref10.h +0 -142
- package/ios/libsodium-stable/src/libsodium/include/sodium/private/ed25519_ref10_fe_25_5.h +0 -1030
- package/ios/libsodium-stable/src/libsodium/include/sodium/private/ed25519_ref10_fe_51.h +0 -508
- package/ios/libsodium-stable/src/libsodium/include/sodium/private/implementations.h +0 -13
- package/ios/libsodium-stable/src/libsodium/include/sodium/private/mutex.h +0 -7
- package/ios/libsodium-stable/src/libsodium/include/sodium/private/softaes.h +0 -56
- package/ios/libsodium-stable/src/libsodium/include/sodium/private/sse2_64_32.h +0 -50
- package/ios/libsodium-stable/src/libsodium/include/sodium/randombytes.h +0 -72
- package/ios/libsodium-stable/src/libsodium/include/sodium/randombytes_internal_random.h +0 -22
- package/ios/libsodium-stable/src/libsodium/include/sodium/randombytes_sysrandom.h +0 -19
- package/ios/libsodium-stable/src/libsodium/include/sodium/runtime.h +0 -55
- package/ios/libsodium-stable/src/libsodium/include/sodium/utils.h +0 -179
- package/ios/libsodium-stable/src/libsodium/include/sodium/version.h.in +0 -33
- package/ios/libsodium-stable/src/libsodium/include/sodium.h +0 -75
- package/ios/libsodium-stable/src/libsodium/randombytes/internal/randombytes_internal_random.c +0 -648
- package/ios/libsodium-stable/src/libsodium/randombytes/randombytes.c +0 -200
- package/ios/libsodium-stable/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c +0 -396
- package/ios/libsodium-stable/src/libsodium/sodium/codecs.c +0 -335
- package/ios/libsodium-stable/src/libsodium/sodium/core.c +0 -216
- package/ios/libsodium-stable/src/libsodium/sodium/runtime.c +0 -391
- package/ios/libsodium-stable/src/libsodium/sodium/utils.c +0 -809
- package/ios/libsodium-stable/src/libsodium/sodium/version.c +0 -30
- package/ios/libsodium-stable/test/Makefile.am +0 -5
- package/ios/libsodium-stable/test/constcheck.sh +0 -22
- package/ios/libsodium-stable/test/default/Makefile.am +0 -525
- package/ios/libsodium-stable/test/default/aead_aegis128l.c +0 -642
- package/ios/libsodium-stable/test/default/aead_aegis128l.exp +0 -1
- package/ios/libsodium-stable/test/default/aead_aegis256.c +0 -723
- package/ios/libsodium-stable/test/default/aead_aegis256.exp +0 -1
- package/ios/libsodium-stable/test/default/aead_aes256gcm.c +0 -3328
- package/ios/libsodium-stable/test/default/aead_aes256gcm.exp +0 -1
- package/ios/libsodium-stable/test/default/aead_aes256gcm2.c +0 -276
- package/ios/libsodium-stable/test/default/aead_aes256gcm2.exp +0 -1
- package/ios/libsodium-stable/test/default/aead_chacha20poly1305.c +0 -372
- package/ios/libsodium-stable/test/default/aead_chacha20poly1305.exp +0 -63
- package/ios/libsodium-stable/test/default/aead_chacha20poly13052.c +0 -1046
- package/ios/libsodium-stable/test/default/aead_chacha20poly13052.exp +0 -1
- package/ios/libsodium-stable/test/default/aead_xchacha20poly1305.c +0 -203
- package/ios/libsodium-stable/test/default/aead_xchacha20poly1305.exp +0 -51
- package/ios/libsodium-stable/test/default/auth.c +0 -141
- package/ios/libsodium-stable/test/default/auth.exp +0 -30
- package/ios/libsodium-stable/test/default/auth2.c +0 -34
- package/ios/libsodium-stable/test/default/auth2.exp +0 -4
- package/ios/libsodium-stable/test/default/auth3.c +0 -36
- package/ios/libsodium-stable/test/default/auth3.exp +0 -1
- package/ios/libsodium-stable/test/default/auth5.c +0 -41
- package/ios/libsodium-stable/test/default/auth5.exp +0 -0
- package/ios/libsodium-stable/test/default/auth6.c +0 -23
- package/ios/libsodium-stable/test/default/auth6.exp +0 -8
- package/ios/libsodium-stable/test/default/auth7.c +0 -41
- package/ios/libsodium-stable/test/default/auth7.exp +0 -0
- package/ios/libsodium-stable/test/default/box.c +0 -112
- package/ios/libsodium-stable/test/default/box.exp +0 -38
- package/ios/libsodium-stable/test/default/box2.c +0 -80
- package/ios/libsodium-stable/test/default/box2.exp +0 -34
- package/ios/libsodium-stable/test/default/box7.c +0 -50
- package/ios/libsodium-stable/test/default/box7.exp +0 -0
- package/ios/libsodium-stable/test/default/box8.c +0 -58
- package/ios/libsodium-stable/test/default/box8.exp +0 -0
- package/ios/libsodium-stable/test/default/box_easy.c +0 -72
- package/ios/libsodium-stable/test/default/box_easy.exp +0 -3
- package/ios/libsodium-stable/test/default/box_easy2.c +0 -149
- package/ios/libsodium-stable/test/default/box_easy2.exp +0 -7
- package/ios/libsodium-stable/test/default/box_seal.c +0 -165
- package/ios/libsodium-stable/test/default/box_seal.exp +0 -8
- package/ios/libsodium-stable/test/default/box_seed.c +0 -30
- package/ios/libsodium-stable/test/default/box_seed.exp +0 -8
- package/ios/libsodium-stable/test/default/chacha20.c +0 -186
- package/ios/libsodium-stable/test/default/chacha20.exp +0 -64
- package/ios/libsodium-stable/test/default/cmptest.h +0 -238
- package/ios/libsodium-stable/test/default/codecs.c +0 -251
- package/ios/libsodium-stable/test/default/codecs.exp +0 -30
- package/ios/libsodium-stable/test/default/core1.c +0 -41
- package/ios/libsodium-stable/test/default/core1.exp +0 -4
- package/ios/libsodium-stable/test/default/core2.c +0 -38
- package/ios/libsodium-stable/test/default/core2.exp +0 -4
- package/ios/libsodium-stable/test/default/core3.c +0 -115
- package/ios/libsodium-stable/test/default/core3.exp +0 -3
- package/ios/libsodium-stable/test/default/core4.c +0 -36
- package/ios/libsodium-stable/test/default/core4.exp +0 -8
- package/ios/libsodium-stable/test/default/core5.c +0 -33
- package/ios/libsodium-stable/test/default/core5.exp +0 -4
- package/ios/libsodium-stable/test/default/core6.c +0 -52
- package/ios/libsodium-stable/test/default/core6.exp +0 -4
- package/ios/libsodium-stable/test/default/core_ed25519.c +0 -545
- package/ios/libsodium-stable/test/default/core_ed25519.exp +0 -55
- package/ios/libsodium-stable/test/default/core_ristretto255.c +0 -271
- package/ios/libsodium-stable/test/default/core_ristretto255.exp +0 -8
- package/ios/libsodium-stable/test/default/ed25519_convert.c +0 -70
- package/ios/libsodium-stable/test/default/ed25519_convert.exp +0 -3
- package/ios/libsodium-stable/test/default/generichash.c +0 -1406
- package/ios/libsodium-stable/test/default/generichash.exp +0 -65
- package/ios/libsodium-stable/test/default/generichash2.c +0 -62
- package/ios/libsodium-stable/test/default/generichash2.exp +0 -64
- package/ios/libsodium-stable/test/default/generichash3.c +0 -176
- package/ios/libsodium-stable/test/default/generichash3.exp +0 -75
- package/ios/libsodium-stable/test/default/hash.c +0 -47
- package/ios/libsodium-stable/test/default/hash.exp +0 -4
- package/ios/libsodium-stable/test/default/hash3.c +0 -20
- package/ios/libsodium-stable/test/default/hash3.exp +0 -1
- package/ios/libsodium-stable/test/default/index.html.tpl +0 -98
- package/ios/libsodium-stable/test/default/kdf.c +0 -71
- package/ios/libsodium-stable/test/default/kdf.exp +0 -77
- package/ios/libsodium-stable/test/default/kdf_hkdf.c +0 -102
- package/ios/libsodium-stable/test/default/kdf_hkdf.exp +0 -205
- package/ios/libsodium-stable/test/default/keygen.c +0 -67
- package/ios/libsodium-stable/test/default/keygen.exp +0 -1
- package/ios/libsodium-stable/test/default/kx.c +0 -149
- package/ios/libsodium-stable/test/default/kx.exp +0 -7
- package/ios/libsodium-stable/test/default/metamorphic.c +0 -187
- package/ios/libsodium-stable/test/default/metamorphic.exp +0 -1
- package/ios/libsodium-stable/test/default/misuse.c +0 -187
- package/ios/libsodium-stable/test/default/misuse.exp +0 -0
- package/ios/libsodium-stable/test/default/onetimeauth.c +0 -63
- package/ios/libsodium-stable/test/default/onetimeauth.exp +0 -4
- package/ios/libsodium-stable/test/default/onetimeauth2.c +0 -33
- package/ios/libsodium-stable/test/default/onetimeauth2.exp +0 -1
- package/ios/libsodium-stable/test/default/onetimeauth7.c +0 -36
- package/ios/libsodium-stable/test/default/onetimeauth7.exp +0 -0
- package/ios/libsodium-stable/test/default/pre.js.inc +0 -22
- package/ios/libsodium-stable/test/default/pwhash_argon2i.c +0 -467
- package/ios/libsodium-stable/test/default/pwhash_argon2i.exp +0 -11
- package/ios/libsodium-stable/test/default/pwhash_argon2id.c +0 -517
- package/ios/libsodium-stable/test/default/pwhash_argon2id.exp +0 -14
- package/ios/libsodium-stable/test/default/pwhash_scrypt.c +0 -393
- package/ios/libsodium-stable/test/default/pwhash_scrypt.exp +0 -37
- package/ios/libsodium-stable/test/default/pwhash_scrypt_ll.c +0 -59
- package/ios/libsodium-stable/test/default/pwhash_scrypt_ll.exp +0 -15
- package/ios/libsodium-stable/test/default/randombytes.c +0 -164
- package/ios/libsodium-stable/test/default/randombytes.exp +0 -2
- package/ios/libsodium-stable/test/default/run.sh +0 -9
- package/ios/libsodium-stable/test/default/scalarmult.c +0 -77
- package/ios/libsodium-stable/test/default/scalarmult.exp +0 -5
- package/ios/libsodium-stable/test/default/scalarmult2.c +0 -22
- package/ios/libsodium-stable/test/default/scalarmult2.exp +0 -1
- package/ios/libsodium-stable/test/default/scalarmult5.c +0 -30
- package/ios/libsodium-stable/test/default/scalarmult5.exp +0 -1
- package/ios/libsodium-stable/test/default/scalarmult6.c +0 -54
- package/ios/libsodium-stable/test/default/scalarmult6.exp +0 -4
- package/ios/libsodium-stable/test/default/scalarmult7.c +0 -34
- package/ios/libsodium-stable/test/default/scalarmult7.exp +0 -1
- package/ios/libsodium-stable/test/default/scalarmult8.c +0 -580
- package/ios/libsodium-stable/test/default/scalarmult8.exp +0 -65
- package/ios/libsodium-stable/test/default/scalarmult_ed25519.c +0 -134
- package/ios/libsodium-stable/test/default/scalarmult_ed25519.exp +0 -1
- package/ios/libsodium-stable/test/default/scalarmult_ristretto255.c +0 -51
- package/ios/libsodium-stable/test/default/scalarmult_ristretto255.exp +0 -18
- package/ios/libsodium-stable/test/default/secretbox.c +0 -84
- package/ios/libsodium-stable/test/default/secretbox.exp +0 -38
- package/ios/libsodium-stable/test/default/secretbox2.c +0 -55
- package/ios/libsodium-stable/test/default/secretbox2.exp +0 -17
- package/ios/libsodium-stable/test/default/secretbox7.c +0 -36
- package/ios/libsodium-stable/test/default/secretbox7.exp +0 -0
- package/ios/libsodium-stable/test/default/secretbox8.c +0 -41
- package/ios/libsodium-stable/test/default/secretbox8.exp +0 -0
- package/ios/libsodium-stable/test/default/secretbox_easy.c +0 -124
- package/ios/libsodium-stable/test/default/secretbox_easy.exp +0 -9
- package/ios/libsodium-stable/test/default/secretbox_easy2.c +0 -72
- package/ios/libsodium-stable/test/default/secretbox_easy2.exp +0 -5
- package/ios/libsodium-stable/test/default/secretstream_xchacha20poly1305.c +0 -329
- package/ios/libsodium-stable/test/default/secretstream_xchacha20poly1305.exp +0 -1
- package/ios/libsodium-stable/test/default/shorthash.c +0 -35
- package/ios/libsodium-stable/test/default/shorthash.exp +0 -64
- package/ios/libsodium-stable/test/default/sign.c +0 -1324
- package/ios/libsodium-stable/test/default/sign.exp +0 -5
- package/ios/libsodium-stable/test/default/siphashx24.c +0 -33
- package/ios/libsodium-stable/test/default/siphashx24.exp +0 -64
- package/ios/libsodium-stable/test/default/sodium_core.c +0 -43
- package/ios/libsodium-stable/test/default/sodium_core.exp +0 -1
- package/ios/libsodium-stable/test/default/sodium_utils.c +0 -224
- package/ios/libsodium-stable/test/default/sodium_utils.exp +0 -25
- package/ios/libsodium-stable/test/default/sodium_utils2.c +0 -120
- package/ios/libsodium-stable/test/default/sodium_utils2.exp +0 -3
- package/ios/libsodium-stable/test/default/sodium_utils3.c +0 -90
- package/ios/libsodium-stable/test/default/sodium_utils3.exp +0 -2
- package/ios/libsodium-stable/test/default/sodium_version.c +0 -18
- package/ios/libsodium-stable/test/default/sodium_version.exp +0 -3
- package/ios/libsodium-stable/test/default/stream.c +0 -84
- package/ios/libsodium-stable/test/default/stream.exp +0 -83
- package/ios/libsodium-stable/test/default/stream2.c +0 -59
- package/ios/libsodium-stable/test/default/stream2.exp +0 -2
- package/ios/libsodium-stable/test/default/stream3.c +0 -32
- package/ios/libsodium-stable/test/default/stream3.exp +0 -4
- package/ios/libsodium-stable/test/default/stream4.c +0 -51
- package/ios/libsodium-stable/test/default/stream4.exp +0 -17
- package/ios/libsodium-stable/test/default/verify1.c +0 -76
- package/ios/libsodium-stable/test/default/verify1.exp +0 -2
- package/ios/libsodium-stable/test/default/wasi-test-wrapper.sh +0 -98
- package/ios/libsodium-stable/test/default/wintest.bat +0 -61
- package/ios/libsodium-stable/test/default/xchacha20.c +0 -428
- package/ios/libsodium-stable/test/default/xchacha20.exp +0 -5
- package/ios/libsodium-stable/test/quirks/quirks.h +0 -34
- package/nitrogen/generated/shared/c++/CFRGKeyPairType.hpp +0 -86
|
@@ -0,0 +1,768 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Subtle = void 0;
|
|
7
|
+
exports.isCryptoKeyPair = isCryptoKeyPair;
|
|
8
|
+
exports.subtle = void 0;
|
|
9
|
+
var _safeBuffer = require("safe-buffer");
|
|
10
|
+
var _keys = require("./keys");
|
|
11
|
+
var _conversion = require("./utils/conversion");
|
|
12
|
+
var _errors = require("./utils/errors");
|
|
13
|
+
var _hashnames = require("./utils/hashnames");
|
|
14
|
+
var _validation = require("./utils/validation");
|
|
15
|
+
var _hash = require("./hash");
|
|
16
|
+
var _reactNativeNitroModules = require("react-native-nitro-modules");
|
|
17
|
+
var _pbkdf = require("./pbkdf2");
|
|
18
|
+
var _ec = require("./ec");
|
|
19
|
+
var _rsa = require("./rsa");
|
|
20
|
+
var _random = require("./random");
|
|
21
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
22
|
+
// import { pbkdf2DeriveBits } from './pbkdf2';
|
|
23
|
+
// import { aesCipher, aesGenerateKey, aesImportKey, getAlgorithmName } from './aes';
|
|
24
|
+
// import { rsaCipher, rsaExportKey, rsaImportKey, rsaKeyGenerate } from './rsa';
|
|
25
|
+
// import { normalizeAlgorithm, type Operation } from './algorithms';
|
|
26
|
+
// import { hmacImportKey } from './mac';
|
|
27
|
+
// Temporary enums that need to be defined
|
|
28
|
+
var KWebCryptoKeyFormat = /*#__PURE__*/function (KWebCryptoKeyFormat) {
|
|
29
|
+
KWebCryptoKeyFormat[KWebCryptoKeyFormat["kWebCryptoKeyFormatRaw"] = 0] = "kWebCryptoKeyFormatRaw";
|
|
30
|
+
KWebCryptoKeyFormat[KWebCryptoKeyFormat["kWebCryptoKeyFormatSPKI"] = 1] = "kWebCryptoKeyFormatSPKI";
|
|
31
|
+
KWebCryptoKeyFormat[KWebCryptoKeyFormat["kWebCryptoKeyFormatPKCS8"] = 2] = "kWebCryptoKeyFormatPKCS8";
|
|
32
|
+
return KWebCryptoKeyFormat;
|
|
33
|
+
}(KWebCryptoKeyFormat || {});
|
|
34
|
+
var CipherOrWrapMode = /*#__PURE__*/function (CipherOrWrapMode) {
|
|
35
|
+
CipherOrWrapMode[CipherOrWrapMode["kWebCryptoCipherEncrypt"] = 0] = "kWebCryptoCipherEncrypt";
|
|
36
|
+
CipherOrWrapMode[CipherOrWrapMode["kWebCryptoCipherDecrypt"] = 1] = "kWebCryptoCipherDecrypt";
|
|
37
|
+
return CipherOrWrapMode;
|
|
38
|
+
}(CipherOrWrapMode || {}); // Placeholder functions that need to be implemented
|
|
39
|
+
function hasAnyNotIn(usages, allowed) {
|
|
40
|
+
return usages.some(usage => !allowed.includes(usage));
|
|
41
|
+
}
|
|
42
|
+
function normalizeAlgorithm(algorithm, _operation) {
|
|
43
|
+
if (typeof algorithm === 'string') {
|
|
44
|
+
return {
|
|
45
|
+
name: algorithm
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return algorithm;
|
|
49
|
+
}
|
|
50
|
+
function getAlgorithmName(name, length) {
|
|
51
|
+
return `${name}${length}`;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Placeholder implementations for missing functions
|
|
55
|
+
function ecExportKey(key, format) {
|
|
56
|
+
const keyObject = key.keyObject;
|
|
57
|
+
if (format === KWebCryptoKeyFormat.kWebCryptoKeyFormatSPKI) {
|
|
58
|
+
// Export public key in SPKI format
|
|
59
|
+
const exported = keyObject.export({
|
|
60
|
+
format: 'der',
|
|
61
|
+
type: 'spki'
|
|
62
|
+
});
|
|
63
|
+
return (0, _conversion.bufferLikeToArrayBuffer)(exported);
|
|
64
|
+
} else if (format === KWebCryptoKeyFormat.kWebCryptoKeyFormatPKCS8) {
|
|
65
|
+
// Export private key in PKCS8 format
|
|
66
|
+
const exported = keyObject.export({
|
|
67
|
+
format: 'der',
|
|
68
|
+
type: 'pkcs8'
|
|
69
|
+
});
|
|
70
|
+
return (0, _conversion.bufferLikeToArrayBuffer)(exported);
|
|
71
|
+
} else {
|
|
72
|
+
throw new Error(`Unsupported EC export format: ${format}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function rsaExportKey(key, format) {
|
|
76
|
+
const keyObject = key.keyObject;
|
|
77
|
+
if (format === KWebCryptoKeyFormat.kWebCryptoKeyFormatSPKI) {
|
|
78
|
+
// Export public key in SPKI format
|
|
79
|
+
const exported = keyObject.export({
|
|
80
|
+
format: 'der',
|
|
81
|
+
type: 'spki'
|
|
82
|
+
});
|
|
83
|
+
return (0, _conversion.bufferLikeToArrayBuffer)(exported);
|
|
84
|
+
} else if (format === KWebCryptoKeyFormat.kWebCryptoKeyFormatPKCS8) {
|
|
85
|
+
// Export private key in PKCS8 format
|
|
86
|
+
const exported = keyObject.export({
|
|
87
|
+
format: 'der',
|
|
88
|
+
type: 'pkcs8'
|
|
89
|
+
});
|
|
90
|
+
return (0, _conversion.bufferLikeToArrayBuffer)(exported);
|
|
91
|
+
} else {
|
|
92
|
+
throw new Error(`Unsupported RSA export format: ${format}`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
async function rsaCipher(mode, key, data, algorithm) {
|
|
96
|
+
const rsaParams = algorithm;
|
|
97
|
+
|
|
98
|
+
// Validate key type matches operation
|
|
99
|
+
const expectedType = mode === CipherOrWrapMode.kWebCryptoCipherEncrypt ? 'public' : 'private';
|
|
100
|
+
if (key.type !== expectedType) {
|
|
101
|
+
throw (0, _errors.lazyDOMException)('The requested operation is not valid for the provided key', 'InvalidAccessError');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Get hash algorithm from key
|
|
105
|
+
const hashAlgorithm = (0, _hashnames.normalizeHashName)(key.algorithm.hash);
|
|
106
|
+
|
|
107
|
+
// Prepare label (optional)
|
|
108
|
+
const label = rsaParams.label ? (0, _conversion.bufferLikeToArrayBuffer)(rsaParams.label) : undefined;
|
|
109
|
+
|
|
110
|
+
// Create RSA cipher instance
|
|
111
|
+
const rsaCipherModule = _reactNativeNitroModules.NitroModules.createHybridObject('RsaCipher');
|
|
112
|
+
if (mode === CipherOrWrapMode.kWebCryptoCipherEncrypt) {
|
|
113
|
+
// Encrypt with public key
|
|
114
|
+
return rsaCipherModule.encrypt(key.keyObject.handle, data, hashAlgorithm, label);
|
|
115
|
+
} else {
|
|
116
|
+
// Decrypt with private key
|
|
117
|
+
return rsaCipherModule.decrypt(key.keyObject.handle, data, hashAlgorithm, label);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async function aesCipher(mode, key, data, algorithm) {
|
|
121
|
+
const {
|
|
122
|
+
name
|
|
123
|
+
} = algorithm;
|
|
124
|
+
switch (name) {
|
|
125
|
+
case 'AES-CTR':
|
|
126
|
+
return aesCtrCipher(mode, key, data, algorithm);
|
|
127
|
+
case 'AES-CBC':
|
|
128
|
+
return aesCbcCipher(mode, key, data, algorithm);
|
|
129
|
+
case 'AES-GCM':
|
|
130
|
+
return aesGcmCipher(mode, key, data, algorithm);
|
|
131
|
+
default:
|
|
132
|
+
throw (0, _errors.lazyDOMException)(`Unsupported AES algorithm: ${name}`, 'NotSupportedError');
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
async function aesCtrCipher(mode, key, data, algorithm) {
|
|
136
|
+
// Validate counter and length
|
|
137
|
+
if (!algorithm.counter || algorithm.counter.byteLength !== 16) {
|
|
138
|
+
throw (0, _errors.lazyDOMException)('AES-CTR algorithm.counter must be 16 bytes', 'OperationError');
|
|
139
|
+
}
|
|
140
|
+
if (algorithm.length < 1 || algorithm.length > 128) {
|
|
141
|
+
throw (0, _errors.lazyDOMException)('AES-CTR algorithm.length must be between 1 and 128', 'OperationError');
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Get cipher type based on key length
|
|
145
|
+
const keyLength = key.algorithm.length;
|
|
146
|
+
const cipherType = `aes-${keyLength}-ctr`;
|
|
147
|
+
|
|
148
|
+
// Create cipher
|
|
149
|
+
const factory = _reactNativeNitroModules.NitroModules.createHybridObject('CipherFactory');
|
|
150
|
+
const cipher = factory.createCipher({
|
|
151
|
+
isCipher: mode === CipherOrWrapMode.kWebCryptoCipherEncrypt,
|
|
152
|
+
cipherType,
|
|
153
|
+
cipherKey: (0, _conversion.bufferLikeToArrayBuffer)(key.keyObject.export()),
|
|
154
|
+
iv: (0, _conversion.bufferLikeToArrayBuffer)(algorithm.counter)
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
// Process data
|
|
158
|
+
const updated = cipher.update(data);
|
|
159
|
+
const final = cipher.final();
|
|
160
|
+
|
|
161
|
+
// Concatenate results
|
|
162
|
+
const result = new Uint8Array(updated.byteLength + final.byteLength);
|
|
163
|
+
result.set(new Uint8Array(updated), 0);
|
|
164
|
+
result.set(new Uint8Array(final), updated.byteLength);
|
|
165
|
+
return result.buffer;
|
|
166
|
+
}
|
|
167
|
+
async function aesCbcCipher(mode, key, data, algorithm) {
|
|
168
|
+
// Validate IV
|
|
169
|
+
const iv = (0, _conversion.bufferLikeToArrayBuffer)(algorithm.iv);
|
|
170
|
+
if (iv.byteLength !== 16) {
|
|
171
|
+
throw (0, _errors.lazyDOMException)('algorithm.iv must contain exactly 16 bytes', 'OperationError');
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Get cipher type based on key length
|
|
175
|
+
const keyLength = key.algorithm.length;
|
|
176
|
+
const cipherType = `aes-${keyLength}-cbc`;
|
|
177
|
+
|
|
178
|
+
// Create cipher
|
|
179
|
+
const factory = _reactNativeNitroModules.NitroModules.createHybridObject('CipherFactory');
|
|
180
|
+
const cipher = factory.createCipher({
|
|
181
|
+
isCipher: mode === CipherOrWrapMode.kWebCryptoCipherEncrypt,
|
|
182
|
+
cipherType,
|
|
183
|
+
cipherKey: (0, _conversion.bufferLikeToArrayBuffer)(key.keyObject.export()),
|
|
184
|
+
iv
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
// Process data
|
|
188
|
+
const updated = cipher.update(data);
|
|
189
|
+
const final = cipher.final();
|
|
190
|
+
|
|
191
|
+
// Concatenate results
|
|
192
|
+
const result = new Uint8Array(updated.byteLength + final.byteLength);
|
|
193
|
+
result.set(new Uint8Array(updated), 0);
|
|
194
|
+
result.set(new Uint8Array(final), updated.byteLength);
|
|
195
|
+
return result.buffer;
|
|
196
|
+
}
|
|
197
|
+
async function aesGcmCipher(mode, key, data, algorithm) {
|
|
198
|
+
const {
|
|
199
|
+
tagLength = 128
|
|
200
|
+
} = algorithm;
|
|
201
|
+
|
|
202
|
+
// Validate tag length
|
|
203
|
+
const validTagLengths = [32, 64, 96, 104, 112, 120, 128];
|
|
204
|
+
if (!validTagLengths.includes(tagLength)) {
|
|
205
|
+
throw (0, _errors.lazyDOMException)(`${tagLength} is not a valid AES-GCM tag length`, 'OperationError');
|
|
206
|
+
}
|
|
207
|
+
const tagByteLength = tagLength / 8;
|
|
208
|
+
|
|
209
|
+
// Get cipher type based on key length
|
|
210
|
+
const keyLength = key.algorithm.length;
|
|
211
|
+
const cipherType = `aes-${keyLength}-gcm`;
|
|
212
|
+
|
|
213
|
+
// Create cipher
|
|
214
|
+
const factory = _reactNativeNitroModules.NitroModules.createHybridObject('CipherFactory');
|
|
215
|
+
const cipher = factory.createCipher({
|
|
216
|
+
isCipher: mode === CipherOrWrapMode.kWebCryptoCipherEncrypt,
|
|
217
|
+
cipherType,
|
|
218
|
+
cipherKey: (0, _conversion.bufferLikeToArrayBuffer)(key.keyObject.export()),
|
|
219
|
+
iv: (0, _conversion.bufferLikeToArrayBuffer)(algorithm.iv),
|
|
220
|
+
authTagLen: tagByteLength
|
|
221
|
+
});
|
|
222
|
+
let processData;
|
|
223
|
+
let authTag;
|
|
224
|
+
if (mode === CipherOrWrapMode.kWebCryptoCipherDecrypt) {
|
|
225
|
+
// For decryption, extract auth tag from end of data
|
|
226
|
+
const dataView = new Uint8Array(data);
|
|
227
|
+
if (dataView.byteLength < tagByteLength) {
|
|
228
|
+
throw (0, _errors.lazyDOMException)('The provided data is too small.', 'OperationError');
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// Split data and tag
|
|
232
|
+
const ciphertextLength = dataView.byteLength - tagByteLength;
|
|
233
|
+
processData = dataView.slice(0, ciphertextLength).buffer;
|
|
234
|
+
authTag = dataView.slice(ciphertextLength).buffer;
|
|
235
|
+
|
|
236
|
+
// Set auth tag for verification
|
|
237
|
+
cipher.setAuthTag(authTag);
|
|
238
|
+
} else {
|
|
239
|
+
processData = data;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// Set additional authenticated data if provided
|
|
243
|
+
if (algorithm.additionalData) {
|
|
244
|
+
cipher.setAAD((0, _conversion.bufferLikeToArrayBuffer)(algorithm.additionalData));
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Process data
|
|
248
|
+
const updated = cipher.update(processData);
|
|
249
|
+
const final = cipher.final();
|
|
250
|
+
if (mode === CipherOrWrapMode.kWebCryptoCipherEncrypt) {
|
|
251
|
+
// For encryption, append auth tag to result
|
|
252
|
+
const tag = cipher.getAuthTag();
|
|
253
|
+
const result = new Uint8Array(updated.byteLength + final.byteLength + tag.byteLength);
|
|
254
|
+
result.set(new Uint8Array(updated), 0);
|
|
255
|
+
result.set(new Uint8Array(final), updated.byteLength);
|
|
256
|
+
result.set(new Uint8Array(tag), updated.byteLength + final.byteLength);
|
|
257
|
+
return result.buffer;
|
|
258
|
+
} else {
|
|
259
|
+
// For decryption, just concatenate plaintext
|
|
260
|
+
const result = new Uint8Array(updated.byteLength + final.byteLength);
|
|
261
|
+
result.set(new Uint8Array(updated), 0);
|
|
262
|
+
result.set(new Uint8Array(final), updated.byteLength);
|
|
263
|
+
return result.buffer;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
async function aesGenerateKey(algorithm, extractable, keyUsages) {
|
|
267
|
+
const {
|
|
268
|
+
length
|
|
269
|
+
} = algorithm;
|
|
270
|
+
const name = algorithm.name;
|
|
271
|
+
if (!name) {
|
|
272
|
+
throw (0, _errors.lazyDOMException)('Algorithm name is required', 'OperationError');
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Validate key length
|
|
276
|
+
if (![128, 192, 256].includes(length)) {
|
|
277
|
+
throw (0, _errors.lazyDOMException)(`Invalid AES key length: ${length}. Must be 128, 192, or 256.`, 'OperationError');
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// Validate usages
|
|
281
|
+
const validUsages = ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey'];
|
|
282
|
+
if (hasAnyNotIn(keyUsages, validUsages)) {
|
|
283
|
+
throw (0, _errors.lazyDOMException)(`Unsupported key usage for ${name}`, 'SyntaxError');
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// Generate random key bytes
|
|
287
|
+
const keyBytes = new Uint8Array(length / 8);
|
|
288
|
+
(0, _random.getRandomValues)(keyBytes);
|
|
289
|
+
|
|
290
|
+
// Create secret key
|
|
291
|
+
const keyObject = (0, _keys.createSecretKey)(keyBytes);
|
|
292
|
+
|
|
293
|
+
// Construct algorithm object with guaranteed name
|
|
294
|
+
const keyAlgorithm = {
|
|
295
|
+
name,
|
|
296
|
+
length
|
|
297
|
+
};
|
|
298
|
+
return new _keys.CryptoKey(keyObject, keyAlgorithm, keyUsages, extractable);
|
|
299
|
+
}
|
|
300
|
+
function rsaImportKey(format, data, algorithm, extractable, keyUsages) {
|
|
301
|
+
const {
|
|
302
|
+
name
|
|
303
|
+
} = algorithm;
|
|
304
|
+
|
|
305
|
+
// Validate usages
|
|
306
|
+
let checkSet;
|
|
307
|
+
switch (name) {
|
|
308
|
+
case 'RSASSA-PKCS1-v1_5':
|
|
309
|
+
case 'RSA-PSS':
|
|
310
|
+
checkSet = ['sign', 'verify'];
|
|
311
|
+
break;
|
|
312
|
+
case 'RSA-OAEP':
|
|
313
|
+
checkSet = ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey'];
|
|
314
|
+
break;
|
|
315
|
+
default:
|
|
316
|
+
throw new Error(`Unsupported RSA algorithm: ${name}`);
|
|
317
|
+
}
|
|
318
|
+
if (hasAnyNotIn(keyUsages, checkSet)) {
|
|
319
|
+
throw new Error(`Unsupported key usage for ${name}`);
|
|
320
|
+
}
|
|
321
|
+
let keyObject;
|
|
322
|
+
if (format === 'jwk') {
|
|
323
|
+
const jwk = data;
|
|
324
|
+
|
|
325
|
+
// Validate JWK
|
|
326
|
+
if (jwk.kty !== 'RSA') {
|
|
327
|
+
throw new Error('Invalid JWK format for RSA key');
|
|
328
|
+
}
|
|
329
|
+
const handle = _reactNativeNitroModules.NitroModules.createHybridObject('KeyObjectHandle');
|
|
330
|
+
const keyType = handle.initJwk(jwk, undefined);
|
|
331
|
+
if (keyType === undefined) {
|
|
332
|
+
throw new Error('Failed to import RSA JWK');
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// Create the appropriate KeyObject based on type
|
|
336
|
+
if (keyType === 1) {
|
|
337
|
+
keyObject = new _keys.PublicKeyObject(handle);
|
|
338
|
+
} else if (keyType === 2) {
|
|
339
|
+
keyObject = new _keys.PrivateKeyObject(handle);
|
|
340
|
+
} else {
|
|
341
|
+
throw new Error('Unexpected key type from RSA JWK import');
|
|
342
|
+
}
|
|
343
|
+
} else if (format === 'spki') {
|
|
344
|
+
const keyData = (0, _conversion.bufferLikeToArrayBuffer)(data);
|
|
345
|
+
keyObject = _keys.KeyObject.createKeyObject('public', keyData, 'der', 'spki');
|
|
346
|
+
} else if (format === 'pkcs8') {
|
|
347
|
+
const keyData = (0, _conversion.bufferLikeToArrayBuffer)(data);
|
|
348
|
+
keyObject = _keys.KeyObject.createKeyObject('private', keyData, 'der', 'pkcs8');
|
|
349
|
+
} else {
|
|
350
|
+
throw new Error(`Unsupported format for RSA import: ${format}`);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// Get the modulus length from the key and add it to the algorithm
|
|
354
|
+
const keyDetails = keyObject.asymmetricKeyDetails;
|
|
355
|
+
|
|
356
|
+
// Convert publicExponent number to big-endian byte array
|
|
357
|
+
let publicExponentBytes;
|
|
358
|
+
if (keyDetails?.publicExponent) {
|
|
359
|
+
const exp = keyDetails.publicExponent;
|
|
360
|
+
// Convert number to big-endian bytes
|
|
361
|
+
const bytes = [];
|
|
362
|
+
let value = exp;
|
|
363
|
+
while (value > 0) {
|
|
364
|
+
bytes.unshift(value & 0xff);
|
|
365
|
+
value = Math.floor(value / 256);
|
|
366
|
+
}
|
|
367
|
+
publicExponentBytes = new Uint8Array(bytes.length > 0 ? bytes : [0]);
|
|
368
|
+
}
|
|
369
|
+
const algorithmWithDetails = {
|
|
370
|
+
...algorithm,
|
|
371
|
+
modulusLength: keyDetails?.modulusLength,
|
|
372
|
+
publicExponent: publicExponentBytes
|
|
373
|
+
};
|
|
374
|
+
return new _keys.CryptoKey(keyObject, algorithmWithDetails, keyUsages, extractable);
|
|
375
|
+
}
|
|
376
|
+
async function hmacImportKey(algorithm, format, data, extractable, keyUsages) {
|
|
377
|
+
// Validate usages
|
|
378
|
+
if (hasAnyNotIn(keyUsages, ['sign', 'verify'])) {
|
|
379
|
+
throw new Error('Unsupported key usage for an HMAC key');
|
|
380
|
+
}
|
|
381
|
+
let keyObject;
|
|
382
|
+
if (format === 'jwk') {
|
|
383
|
+
const jwk = data;
|
|
384
|
+
|
|
385
|
+
// Validate JWK
|
|
386
|
+
if (!jwk || typeof jwk !== 'object') {
|
|
387
|
+
throw new Error('Invalid keyData');
|
|
388
|
+
}
|
|
389
|
+
if (jwk.kty !== 'oct') {
|
|
390
|
+
throw new Error('Invalid JWK format for HMAC key');
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
// Validate key length if specified
|
|
394
|
+
if (algorithm.length !== undefined) {
|
|
395
|
+
if (!jwk.k) {
|
|
396
|
+
throw new Error('JWK missing key data');
|
|
397
|
+
}
|
|
398
|
+
// Decode to check length
|
|
399
|
+
const decoded = _safeBuffer.Buffer.from(jwk.k, 'base64');
|
|
400
|
+
const keyBitLength = decoded.length * 8;
|
|
401
|
+
if (algorithm.length === 0) {
|
|
402
|
+
throw new Error('Zero-length key is not supported');
|
|
403
|
+
}
|
|
404
|
+
if (algorithm.length !== keyBitLength) {
|
|
405
|
+
throw new Error('Invalid key length');
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
const handle = _reactNativeNitroModules.NitroModules.createHybridObject('KeyObjectHandle');
|
|
409
|
+
const keyType = handle.initJwk(jwk, undefined);
|
|
410
|
+
if (keyType === undefined || keyType !== 0) {
|
|
411
|
+
throw new Error('Failed to import HMAC JWK');
|
|
412
|
+
}
|
|
413
|
+
keyObject = new _keys.SecretKeyObject(handle);
|
|
414
|
+
} else if (format === 'raw') {
|
|
415
|
+
keyObject = (0, _keys.createSecretKey)(data);
|
|
416
|
+
} else {
|
|
417
|
+
throw new Error(`Unable to import HMAC key with format ${format}`);
|
|
418
|
+
}
|
|
419
|
+
return new _keys.CryptoKey(keyObject, {
|
|
420
|
+
...algorithm,
|
|
421
|
+
name: 'HMAC'
|
|
422
|
+
}, keyUsages, extractable);
|
|
423
|
+
}
|
|
424
|
+
async function aesImportKey(algorithm, format, data, extractable, keyUsages) {
|
|
425
|
+
const {
|
|
426
|
+
name,
|
|
427
|
+
length
|
|
428
|
+
} = algorithm;
|
|
429
|
+
|
|
430
|
+
// Validate usages
|
|
431
|
+
const validUsages = ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey'];
|
|
432
|
+
if (hasAnyNotIn(keyUsages, validUsages)) {
|
|
433
|
+
throw new Error(`Unsupported key usage for ${name}`);
|
|
434
|
+
}
|
|
435
|
+
let keyObject;
|
|
436
|
+
let actualLength;
|
|
437
|
+
if (format === 'jwk') {
|
|
438
|
+
const jwk = data;
|
|
439
|
+
|
|
440
|
+
// Validate JWK
|
|
441
|
+
if (jwk.kty !== 'oct') {
|
|
442
|
+
throw new Error('Invalid JWK format for AES key');
|
|
443
|
+
}
|
|
444
|
+
const handle = _reactNativeNitroModules.NitroModules.createHybridObject('KeyObjectHandle');
|
|
445
|
+
const keyType = handle.initJwk(jwk, undefined);
|
|
446
|
+
if (keyType === undefined || keyType !== 0) {
|
|
447
|
+
throw new Error('Failed to import AES JWK');
|
|
448
|
+
}
|
|
449
|
+
keyObject = new _keys.SecretKeyObject(handle);
|
|
450
|
+
|
|
451
|
+
// Get actual key length from imported key
|
|
452
|
+
const exported = keyObject.export();
|
|
453
|
+
actualLength = exported.byteLength * 8;
|
|
454
|
+
} else if (format === 'raw') {
|
|
455
|
+
const keyData = (0, _conversion.bufferLikeToArrayBuffer)(data);
|
|
456
|
+
actualLength = keyData.byteLength * 8;
|
|
457
|
+
|
|
458
|
+
// Validate key length
|
|
459
|
+
if (![128, 192, 256].includes(actualLength)) {
|
|
460
|
+
throw new Error('Invalid AES key length');
|
|
461
|
+
}
|
|
462
|
+
keyObject = (0, _keys.createSecretKey)(keyData);
|
|
463
|
+
} else {
|
|
464
|
+
throw new Error(`Unsupported format for AES import: ${format}`);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
// Validate length if specified
|
|
468
|
+
if (length !== undefined && length !== actualLength) {
|
|
469
|
+
throw new Error(`Key length mismatch: expected ${length}, got ${actualLength}`);
|
|
470
|
+
}
|
|
471
|
+
return new _keys.CryptoKey(keyObject, {
|
|
472
|
+
name,
|
|
473
|
+
length: actualLength
|
|
474
|
+
}, keyUsages, extractable);
|
|
475
|
+
}
|
|
476
|
+
const exportKeySpki = async key => {
|
|
477
|
+
switch (key.algorithm.name) {
|
|
478
|
+
case 'RSASSA-PKCS1-v1_5':
|
|
479
|
+
// Fall through
|
|
480
|
+
case 'RSA-PSS':
|
|
481
|
+
// Fall through
|
|
482
|
+
case 'RSA-OAEP':
|
|
483
|
+
if (key.type === 'public') {
|
|
484
|
+
return rsaExportKey(key, KWebCryptoKeyFormat.kWebCryptoKeyFormatSPKI);
|
|
485
|
+
}
|
|
486
|
+
break;
|
|
487
|
+
case 'ECDSA':
|
|
488
|
+
// Fall through
|
|
489
|
+
case 'ECDH':
|
|
490
|
+
if (key.type === 'public') {
|
|
491
|
+
return ecExportKey(key, KWebCryptoKeyFormat.kWebCryptoKeyFormatSPKI);
|
|
492
|
+
}
|
|
493
|
+
break;
|
|
494
|
+
}
|
|
495
|
+
throw new Error(`Unable to export a spki ${key.algorithm.name} ${key.type} key`);
|
|
496
|
+
};
|
|
497
|
+
const exportKeyPkcs8 = async key => {
|
|
498
|
+
switch (key.algorithm.name) {
|
|
499
|
+
case 'RSASSA-PKCS1-v1_5':
|
|
500
|
+
// Fall through
|
|
501
|
+
case 'RSA-PSS':
|
|
502
|
+
// Fall through
|
|
503
|
+
case 'RSA-OAEP':
|
|
504
|
+
if (key.type === 'private') {
|
|
505
|
+
return rsaExportKey(key, KWebCryptoKeyFormat.kWebCryptoKeyFormatPKCS8);
|
|
506
|
+
}
|
|
507
|
+
break;
|
|
508
|
+
case 'ECDSA':
|
|
509
|
+
// Fall through
|
|
510
|
+
case 'ECDH':
|
|
511
|
+
if (key.type === 'private') {
|
|
512
|
+
return ecExportKey(key, KWebCryptoKeyFormat.kWebCryptoKeyFormatPKCS8);
|
|
513
|
+
}
|
|
514
|
+
break;
|
|
515
|
+
}
|
|
516
|
+
throw new Error(`Unable to export a pkcs8 ${key.algorithm.name} ${key.type} key`);
|
|
517
|
+
};
|
|
518
|
+
const exportKeyRaw = key => {
|
|
519
|
+
switch (key.algorithm.name) {
|
|
520
|
+
case 'ECDSA':
|
|
521
|
+
// Fall through
|
|
522
|
+
case 'ECDH':
|
|
523
|
+
if (key.type === 'public') {
|
|
524
|
+
return ecExportKey(key, KWebCryptoKeyFormat.kWebCryptoKeyFormatRaw);
|
|
525
|
+
}
|
|
526
|
+
break;
|
|
527
|
+
case 'AES-CTR':
|
|
528
|
+
// Fall through
|
|
529
|
+
case 'AES-CBC':
|
|
530
|
+
// Fall through
|
|
531
|
+
case 'AES-GCM':
|
|
532
|
+
// Fall through
|
|
533
|
+
case 'AES-KW':
|
|
534
|
+
// Fall through
|
|
535
|
+
case 'HMAC':
|
|
536
|
+
{
|
|
537
|
+
const exported = key.keyObject.export();
|
|
538
|
+
// Convert Buffer to ArrayBuffer
|
|
539
|
+
return exported.buffer.slice(exported.byteOffset, exported.byteOffset + exported.byteLength);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
throw (0, _errors.lazyDOMException)(`Unable to export a raw ${key.algorithm.name} ${key.type} key`, 'InvalidAccessError');
|
|
543
|
+
};
|
|
544
|
+
const exportKeyJWK = key => {
|
|
545
|
+
const jwk = key.keyObject.handle.exportJwk({
|
|
546
|
+
key_ops: key.usages,
|
|
547
|
+
ext: key.extractable
|
|
548
|
+
}, true);
|
|
549
|
+
switch (key.algorithm.name) {
|
|
550
|
+
case 'RSASSA-PKCS1-v1_5':
|
|
551
|
+
jwk.alg = (0, _hashnames.normalizeHashName)(key.algorithm.hash, _hashnames.HashContext.JwkRsa);
|
|
552
|
+
return jwk;
|
|
553
|
+
case 'RSA-PSS':
|
|
554
|
+
jwk.alg = (0, _hashnames.normalizeHashName)(key.algorithm.hash, _hashnames.HashContext.JwkRsaPss);
|
|
555
|
+
return jwk;
|
|
556
|
+
case 'RSA-OAEP':
|
|
557
|
+
jwk.alg = (0, _hashnames.normalizeHashName)(key.algorithm.hash, _hashnames.HashContext.JwkRsaOaep);
|
|
558
|
+
return jwk;
|
|
559
|
+
case 'HMAC':
|
|
560
|
+
jwk.alg = (0, _hashnames.normalizeHashName)(key.algorithm.hash, _hashnames.HashContext.JwkHmac);
|
|
561
|
+
return jwk;
|
|
562
|
+
case 'ECDSA':
|
|
563
|
+
// Fall through
|
|
564
|
+
case 'ECDH':
|
|
565
|
+
jwk.crv ||= key.algorithm.namedCurve;
|
|
566
|
+
return jwk;
|
|
567
|
+
case 'AES-CTR':
|
|
568
|
+
// Fall through
|
|
569
|
+
case 'AES-CBC':
|
|
570
|
+
// Fall through
|
|
571
|
+
case 'AES-GCM':
|
|
572
|
+
// Fall through
|
|
573
|
+
case 'AES-KW':
|
|
574
|
+
if (key.algorithm.length === undefined) {
|
|
575
|
+
throw (0, _errors.lazyDOMException)(`Algorithm ${key.algorithm.name} missing required length property`, 'InvalidAccessError');
|
|
576
|
+
}
|
|
577
|
+
jwk.alg = getAlgorithmName(key.algorithm.name, key.algorithm.length);
|
|
578
|
+
return jwk;
|
|
579
|
+
default:
|
|
580
|
+
// Fall through
|
|
581
|
+
}
|
|
582
|
+
throw (0, _errors.lazyDOMException)(`JWK export not yet supported: ${key.algorithm.name}`, 'NotSupportedError');
|
|
583
|
+
};
|
|
584
|
+
const importGenericSecretKey = async ({
|
|
585
|
+
name,
|
|
586
|
+
length
|
|
587
|
+
}, format, keyData, extractable, keyUsages) => {
|
|
588
|
+
if (extractable) {
|
|
589
|
+
throw new Error(`${name} keys are not extractable`);
|
|
590
|
+
}
|
|
591
|
+
if (hasAnyNotIn(keyUsages, ['deriveKey', 'deriveBits'])) {
|
|
592
|
+
throw new Error(`Unsupported key usage for a ${name} key`);
|
|
593
|
+
}
|
|
594
|
+
switch (format) {
|
|
595
|
+
case 'raw':
|
|
596
|
+
{
|
|
597
|
+
if (hasAnyNotIn(keyUsages, ['deriveKey', 'deriveBits'])) {
|
|
598
|
+
throw new Error(`Unsupported key usage for a ${name} key`);
|
|
599
|
+
}
|
|
600
|
+
const checkLength = typeof keyData === 'string' || _safeBuffer.Buffer.isBuffer(keyData) ? keyData.length * 8 : keyData.byteLength * 8;
|
|
601
|
+
if (length !== undefined && length !== checkLength) {
|
|
602
|
+
throw new Error('Invalid key length');
|
|
603
|
+
}
|
|
604
|
+
const keyObject = (0, _keys.createSecretKey)(keyData);
|
|
605
|
+
return new _keys.CryptoKey(keyObject, {
|
|
606
|
+
name
|
|
607
|
+
}, keyUsages, false);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
throw new Error(`Unable to import ${name} key with format ${format}`);
|
|
611
|
+
};
|
|
612
|
+
const checkCryptoKeyPairUsages = pair => {
|
|
613
|
+
if (pair.privateKey && pair.privateKey instanceof _keys.CryptoKey && pair.privateKey.keyUsages && pair.privateKey.keyUsages.length > 0) {
|
|
614
|
+
return;
|
|
615
|
+
}
|
|
616
|
+
throw (0, _errors.lazyDOMException)('Usages cannot be empty when creating a key.', 'SyntaxError');
|
|
617
|
+
};
|
|
618
|
+
|
|
619
|
+
// Type guard to check if result is CryptoKeyPair
|
|
620
|
+
function isCryptoKeyPair(result) {
|
|
621
|
+
return 'publicKey' in result && 'privateKey' in result;
|
|
622
|
+
}
|
|
623
|
+
const signVerify = (algorithm, key, data, signature) => {
|
|
624
|
+
const usage = signature === undefined ? 'sign' : 'verify';
|
|
625
|
+
algorithm = normalizeAlgorithm(algorithm, usage);
|
|
626
|
+
if (!key.usages.includes(usage) || algorithm.name !== key.algorithm.name) {
|
|
627
|
+
throw (0, _errors.lazyDOMException)(`Unable to use this key to ${usage}`, 'InvalidAccessError');
|
|
628
|
+
}
|
|
629
|
+
switch (algorithm.name) {
|
|
630
|
+
case 'ECDSA':
|
|
631
|
+
return (0, _ec.ecdsaSignVerify)(key, data, algorithm, signature);
|
|
632
|
+
}
|
|
633
|
+
throw (0, _errors.lazyDOMException)(`Unrecognized algorithm name '${algorithm}' for '${usage}'`, 'NotSupportedError');
|
|
634
|
+
};
|
|
635
|
+
const cipherOrWrap = async (mode, algorithm, key, data, op) => {
|
|
636
|
+
if (key.algorithm.name !== algorithm.name || !key.usages.includes(op)) {
|
|
637
|
+
throw (0, _errors.lazyDOMException)('The requested operation is not valid for the provided key', 'InvalidAccessError');
|
|
638
|
+
}
|
|
639
|
+
(0, _validation.validateMaxBufferLength)(data, 'data');
|
|
640
|
+
switch (algorithm.name) {
|
|
641
|
+
case 'RSA-OAEP':
|
|
642
|
+
return rsaCipher(mode, key, data, algorithm);
|
|
643
|
+
case 'AES-CTR':
|
|
644
|
+
// Fall through
|
|
645
|
+
case 'AES-CBC':
|
|
646
|
+
// Fall through
|
|
647
|
+
case 'AES-GCM':
|
|
648
|
+
return aesCipher(mode, key, data, algorithm);
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
class Subtle {
|
|
652
|
+
async decrypt(algorithm, key, data) {
|
|
653
|
+
const normalizedAlgorithm = normalizeAlgorithm(algorithm, 'decrypt');
|
|
654
|
+
return cipherOrWrap(CipherOrWrapMode.kWebCryptoCipherDecrypt, normalizedAlgorithm, key, (0, _conversion.bufferLikeToArrayBuffer)(data), 'decrypt');
|
|
655
|
+
}
|
|
656
|
+
async digest(algorithm, data) {
|
|
657
|
+
const normalizedAlgorithm = normalizeAlgorithm(algorithm, 'digest');
|
|
658
|
+
return (0, _hash.asyncDigest)(normalizedAlgorithm, data);
|
|
659
|
+
}
|
|
660
|
+
async deriveBits(algorithm, baseKey, length) {
|
|
661
|
+
if (!baseKey.keyUsages.includes('deriveBits')) {
|
|
662
|
+
throw new Error('baseKey does not have deriveBits usage');
|
|
663
|
+
}
|
|
664
|
+
if (baseKey.algorithm.name !== algorithm.name) throw new Error('Key algorithm mismatch');
|
|
665
|
+
switch (algorithm.name) {
|
|
666
|
+
case 'PBKDF2':
|
|
667
|
+
return (0, _pbkdf.pbkdf2DeriveBits)(algorithm, baseKey, length);
|
|
668
|
+
}
|
|
669
|
+
throw new Error(`'subtle.deriveBits()' for ${algorithm.name} is not implemented.`);
|
|
670
|
+
}
|
|
671
|
+
async encrypt(algorithm, key, data) {
|
|
672
|
+
const normalizedAlgorithm = normalizeAlgorithm(algorithm, 'encrypt');
|
|
673
|
+
return cipherOrWrap(CipherOrWrapMode.kWebCryptoCipherEncrypt, normalizedAlgorithm, key, (0, _conversion.bufferLikeToArrayBuffer)(data), 'encrypt');
|
|
674
|
+
}
|
|
675
|
+
async exportKey(format, key) {
|
|
676
|
+
if (!key.extractable) throw new Error('key is not extractable');
|
|
677
|
+
switch (format) {
|
|
678
|
+
case 'spki':
|
|
679
|
+
return await exportKeySpki(key);
|
|
680
|
+
case 'pkcs8':
|
|
681
|
+
return await exportKeyPkcs8(key);
|
|
682
|
+
case 'jwk':
|
|
683
|
+
return exportKeyJWK(key);
|
|
684
|
+
case 'raw':
|
|
685
|
+
return exportKeyRaw(key);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
async generateKey(algorithm, extractable, keyUsages) {
|
|
689
|
+
algorithm = normalizeAlgorithm(algorithm, 'generateKey');
|
|
690
|
+
let result;
|
|
691
|
+
switch (algorithm.name) {
|
|
692
|
+
case 'RSASSA-PKCS1-v1_5':
|
|
693
|
+
// Fall through
|
|
694
|
+
case 'RSA-PSS':
|
|
695
|
+
// Fall through
|
|
696
|
+
case 'RSA-OAEP':
|
|
697
|
+
result = await (0, _rsa.rsa_generateKeyPair)(algorithm, extractable, keyUsages);
|
|
698
|
+
break;
|
|
699
|
+
case 'ECDSA':
|
|
700
|
+
// Fall through
|
|
701
|
+
case 'ECDH':
|
|
702
|
+
result = await (0, _ec.ec_generateKeyPair)(algorithm.name, algorithm.namedCurve, extractable, keyUsages);
|
|
703
|
+
checkCryptoKeyPairUsages(result);
|
|
704
|
+
break;
|
|
705
|
+
case 'AES-CTR':
|
|
706
|
+
// Fall through
|
|
707
|
+
case 'AES-CBC':
|
|
708
|
+
// Fall through
|
|
709
|
+
case 'AES-GCM':
|
|
710
|
+
// Fall through
|
|
711
|
+
case 'AES-KW':
|
|
712
|
+
result = await aesGenerateKey(algorithm, extractable, keyUsages);
|
|
713
|
+
break;
|
|
714
|
+
default:
|
|
715
|
+
throw new Error(`'subtle.generateKey()' is not implemented for ${algorithm.name}.
|
|
716
|
+
Unrecognized algorithm name`);
|
|
717
|
+
}
|
|
718
|
+
return result;
|
|
719
|
+
}
|
|
720
|
+
async importKey(format, data, algorithm, extractable, keyUsages) {
|
|
721
|
+
const normalizedAlgorithm = normalizeAlgorithm(algorithm, 'importKey');
|
|
722
|
+
let result;
|
|
723
|
+
switch (normalizedAlgorithm.name) {
|
|
724
|
+
case 'RSASSA-PKCS1-v1_5':
|
|
725
|
+
// Fall through
|
|
726
|
+
case 'RSA-PSS':
|
|
727
|
+
// Fall through
|
|
728
|
+
case 'RSA-OAEP':
|
|
729
|
+
result = rsaImportKey(format, data, normalizedAlgorithm, extractable, keyUsages);
|
|
730
|
+
break;
|
|
731
|
+
case 'ECDSA':
|
|
732
|
+
// Fall through
|
|
733
|
+
case 'ECDH':
|
|
734
|
+
result = (0, _ec.ecImportKey)(format, data, normalizedAlgorithm, extractable, keyUsages);
|
|
735
|
+
break;
|
|
736
|
+
case 'HMAC':
|
|
737
|
+
result = await hmacImportKey(normalizedAlgorithm, format, data, extractable, keyUsages);
|
|
738
|
+
break;
|
|
739
|
+
case 'AES-CTR':
|
|
740
|
+
// Fall through
|
|
741
|
+
case 'AES-CBC':
|
|
742
|
+
// Fall through
|
|
743
|
+
case 'AES-GCM':
|
|
744
|
+
// Fall through
|
|
745
|
+
case 'AES-KW':
|
|
746
|
+
result = await aesImportKey(normalizedAlgorithm, format, data, extractable, keyUsages);
|
|
747
|
+
break;
|
|
748
|
+
case 'PBKDF2':
|
|
749
|
+
result = await importGenericSecretKey(normalizedAlgorithm, format, data, extractable, keyUsages);
|
|
750
|
+
break;
|
|
751
|
+
default:
|
|
752
|
+
throw new Error(`"subtle.importKey()" is not implemented for ${normalizedAlgorithm.name}`);
|
|
753
|
+
}
|
|
754
|
+
if ((result.type === 'secret' || result.type === 'private') && result.usages.length === 0) {
|
|
755
|
+
throw new Error(`Usages cannot be empty when importing a ${result.type} key.`);
|
|
756
|
+
}
|
|
757
|
+
return result;
|
|
758
|
+
}
|
|
759
|
+
async sign(algorithm, key, data) {
|
|
760
|
+
return signVerify(algorithm, key, data);
|
|
761
|
+
}
|
|
762
|
+
async verify(algorithm, key, signature, data) {
|
|
763
|
+
return signVerify(algorithm, key, data, signature);
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
exports.Subtle = Subtle;
|
|
767
|
+
const subtle = exports.subtle = new Subtle();
|
|
768
|
+
//# sourceMappingURL=subtle.js.map
|