react-native-quick-crypto 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/QuickCrypto.podspec +1 -0
- package/android/CMakeLists.txt +4 -0
- package/android/build.gradle +5 -1
- package/cpp/argon2/HybridArgon2.cpp +10 -3
- package/cpp/blake3/HybridBlake3.cpp +5 -3
- package/cpp/cipher/CCMCipher.cpp +35 -26
- package/cpp/cipher/CCMCipher.hpp +2 -4
- package/cpp/cipher/ChaCha20Cipher.cpp +19 -27
- package/cpp/cipher/ChaCha20Cipher.hpp +2 -4
- package/cpp/cipher/ChaCha20Poly1305Cipher.cpp +41 -36
- package/cpp/cipher/ChaCha20Poly1305Cipher.hpp +2 -4
- package/cpp/cipher/GCMCipher.cpp +17 -20
- package/cpp/cipher/HybridCipher.cpp +44 -47
- package/cpp/cipher/HybridCipher.hpp +17 -1
- package/cpp/cipher/HybridRsaCipher.cpp +93 -56
- package/cpp/cipher/OCBCipher.cpp +5 -5
- package/cpp/cipher/XChaCha20Poly1305Cipher.cpp +27 -32
- package/cpp/cipher/XSalsa20Cipher.cpp +78 -16
- package/cpp/cipher/XSalsa20Cipher.hpp +25 -3
- package/cpp/cipher/XSalsa20Poly1305Cipher.cpp +32 -41
- package/cpp/dh/HybridDiffieHellman.cpp +29 -0
- package/cpp/ec/HybridEcKeyPair.cpp +35 -33
- package/cpp/ec/HybridEcKeyPair.hpp +3 -7
- package/cpp/ecdh/HybridECDH.cpp +23 -0
- package/cpp/ed25519/HybridEdKeyPair.cpp +73 -117
- package/cpp/ed25519/HybridEdKeyPair.hpp +5 -9
- package/cpp/hash/HybridHash.cpp +5 -7
- package/cpp/hkdf/HybridHkdf.cpp +6 -4
- package/cpp/hmac/HybridHmac.cpp +4 -6
- package/cpp/keys/HybridKeyObjectHandle.cpp +630 -2
- package/cpp/keys/HybridKeyObjectHandle.hpp +21 -1
- package/cpp/kmac/HybridKmac.cpp +4 -4
- package/cpp/mldsa/HybridMlDsaKeyPair.cpp +37 -49
- package/cpp/mlkem/HybridMlKemKeyPair.cpp +39 -43
- package/cpp/pbkdf2/HybridPbkdf2.cpp +7 -8
- package/cpp/rsa/HybridRsaKeyPair.cpp +5 -8
- package/cpp/rsa/HybridRsaKeyPair.hpp +4 -7
- package/cpp/scrypt/HybridScrypt.cpp +6 -4
- package/cpp/sign/HybridSignHandle.cpp +47 -72
- package/cpp/sign/HybridVerifyHandle.cpp +47 -67
- package/cpp/slhdsa/HybridSlhDsaKeyPair.cpp +245 -0
- package/cpp/slhdsa/HybridSlhDsaKeyPair.hpp +48 -0
- package/cpp/turboshake/HybridTurboShake.cpp +379 -0
- package/cpp/turboshake/HybridTurboShake.hpp +28 -0
- package/cpp/utils/HybridUtils.cpp +195 -43
- package/cpp/utils/HybridUtils.hpp +9 -2
- package/cpp/utils/QuickCryptoUtils.hpp +72 -0
- package/deps/blake3/README.md +6 -7
- package/deps/blake3/c/blake3.c +3 -2
- package/deps/blake3/c/blake3.h +2 -2
- package/deps/blake3/c/blake3_dispatch.c +2 -2
- package/deps/blake3/c/blake3_impl.h +1 -1
- package/deps/blake3/c/blake3_neon.c +5 -4
- package/deps/ncrypto/include/ncrypto/version.h +2 -2
- package/deps/ncrypto/include/ncrypto.h +9 -2
- package/deps/ncrypto/src/ncrypto.cpp +130 -35
- package/lib/commonjs/argon2.js +51 -2
- package/lib/commonjs/argon2.js.map +1 -1
- package/lib/commonjs/cipher.js +109 -11
- package/lib/commonjs/cipher.js.map +1 -1
- package/lib/commonjs/dhKeyPair.js +3 -0
- package/lib/commonjs/dhKeyPair.js.map +1 -1
- package/lib/commonjs/dsa.js +11 -2
- package/lib/commonjs/dsa.js.map +1 -1
- package/lib/commonjs/ec.js +37 -30
- package/lib/commonjs/ec.js.map +1 -1
- package/lib/commonjs/ed.js +60 -6
- package/lib/commonjs/ed.js.map +1 -1
- package/lib/commonjs/hash.js +67 -10
- package/lib/commonjs/hash.js.map +1 -1
- package/lib/commonjs/hkdf.js +33 -6
- package/lib/commonjs/hkdf.js.map +1 -1
- package/lib/commonjs/hmac.js +15 -5
- package/lib/commonjs/hmac.js.map +1 -1
- package/lib/commonjs/keys/classes.js +33 -7
- package/lib/commonjs/keys/classes.js.map +1 -1
- package/lib/commonjs/keys/generateKeyPair.js +85 -4
- package/lib/commonjs/keys/generateKeyPair.js.map +1 -1
- package/lib/commonjs/keys/index.js +50 -2
- package/lib/commonjs/keys/index.js.map +1 -1
- package/lib/commonjs/keys/publicCipher.js +10 -4
- package/lib/commonjs/keys/publicCipher.js.map +1 -1
- package/lib/commonjs/keys/signVerify.js +9 -2
- package/lib/commonjs/keys/signVerify.js.map +1 -1
- package/lib/commonjs/keys/utils.js +59 -1
- package/lib/commonjs/keys/utils.js.map +1 -1
- package/lib/commonjs/random.js +74 -11
- package/lib/commonjs/random.js.map +1 -1
- package/lib/commonjs/rsa.js +15 -5
- package/lib/commonjs/rsa.js.map +1 -1
- package/lib/commonjs/scrypt.js +47 -6
- package/lib/commonjs/scrypt.js.map +1 -1
- package/lib/commonjs/slhdsa.js +70 -0
- package/lib/commonjs/slhdsa.js.map +1 -0
- package/lib/commonjs/specs/slhDsaKeyPair.nitro.js +6 -0
- package/lib/commonjs/specs/slhDsaKeyPair.nitro.js.map +1 -0
- package/lib/commonjs/specs/turboshake.nitro.js +6 -0
- package/lib/commonjs/specs/turboshake.nitro.js.map +1 -0
- package/lib/commonjs/subtle.js +975 -253
- package/lib/commonjs/subtle.js.map +1 -1
- package/lib/commonjs/utils/cipher.js +18 -7
- package/lib/commonjs/utils/cipher.js.map +1 -1
- package/lib/commonjs/utils/conversion.js +86 -28
- package/lib/commonjs/utils/conversion.js.map +1 -1
- package/lib/commonjs/utils/errors.js +63 -4
- package/lib/commonjs/utils/errors.js.map +1 -1
- package/lib/commonjs/utils/timingSafeEqual.js +7 -2
- package/lib/commonjs/utils/timingSafeEqual.js.map +1 -1
- package/lib/commonjs/utils/types.js.map +1 -1
- package/lib/commonjs/utils/validation.js +46 -0
- package/lib/commonjs/utils/validation.js.map +1 -1
- package/lib/commonjs/x509certificate.js +6 -6
- package/lib/commonjs/x509certificate.js.map +1 -1
- package/lib/module/argon2.js +51 -2
- package/lib/module/argon2.js.map +1 -1
- package/lib/module/cipher.js +109 -11
- package/lib/module/cipher.js.map +1 -1
- package/lib/module/dhKeyPair.js +3 -0
- package/lib/module/dhKeyPair.js.map +1 -1
- package/lib/module/dsa.js +11 -2
- package/lib/module/dsa.js.map +1 -1
- package/lib/module/ec.js +38 -31
- package/lib/module/ec.js.map +1 -1
- package/lib/module/ed.js +61 -7
- package/lib/module/ed.js.map +1 -1
- package/lib/module/hash.js +67 -10
- package/lib/module/hash.js.map +1 -1
- package/lib/module/hkdf.js +33 -6
- package/lib/module/hkdf.js.map +1 -1
- package/lib/module/hmac.js +15 -5
- package/lib/module/hmac.js.map +1 -1
- package/lib/module/keys/classes.js +31 -5
- package/lib/module/keys/classes.js.map +1 -1
- package/lib/module/keys/generateKeyPair.js +86 -5
- package/lib/module/keys/generateKeyPair.js.map +1 -1
- package/lib/module/keys/index.js +50 -2
- package/lib/module/keys/index.js.map +1 -1
- package/lib/module/keys/publicCipher.js +10 -4
- package/lib/module/keys/publicCipher.js.map +1 -1
- package/lib/module/keys/signVerify.js +9 -2
- package/lib/module/keys/signVerify.js.map +1 -1
- package/lib/module/keys/utils.js +57 -1
- package/lib/module/keys/utils.js.map +1 -1
- package/lib/module/random.js +74 -12
- package/lib/module/random.js.map +1 -1
- package/lib/module/rsa.js +14 -4
- package/lib/module/rsa.js.map +1 -1
- package/lib/module/scrypt.js +47 -6
- package/lib/module/scrypt.js.map +1 -1
- package/lib/module/slhdsa.js +64 -0
- package/lib/module/slhdsa.js.map +1 -0
- package/lib/module/specs/slhDsaKeyPair.nitro.js +4 -0
- package/lib/module/specs/slhDsaKeyPair.nitro.js.map +1 -0
- package/lib/module/specs/turboshake.nitro.js +4 -0
- package/lib/module/specs/turboshake.nitro.js.map +1 -0
- package/lib/module/subtle.js +976 -254
- package/lib/module/subtle.js.map +1 -1
- package/lib/module/utils/cipher.js +18 -7
- package/lib/module/utils/cipher.js.map +1 -1
- package/lib/module/utils/conversion.js +84 -28
- package/lib/module/utils/conversion.js.map +1 -1
- package/lib/module/utils/errors.js +61 -4
- package/lib/module/utils/errors.js.map +1 -1
- package/lib/module/utils/timingSafeEqual.js +8 -3
- package/lib/module/utils/timingSafeEqual.js.map +1 -1
- package/lib/module/utils/types.js.map +1 -1
- package/lib/module/utils/validation.js +44 -0
- package/lib/module/utils/validation.js.map +1 -1
- package/lib/module/x509certificate.js +6 -6
- package/lib/module/x509certificate.js.map +1 -1
- package/lib/typescript/argon2.d.ts.map +1 -1
- package/lib/typescript/cipher.d.ts +2 -2
- package/lib/typescript/cipher.d.ts.map +1 -1
- package/lib/typescript/dhKeyPair.d.ts.map +1 -1
- package/lib/typescript/dsa.d.ts.map +1 -1
- package/lib/typescript/ec.d.ts.map +1 -1
- package/lib/typescript/ed.d.ts.map +1 -1
- package/lib/typescript/hash.d.ts +2 -2
- package/lib/typescript/hash.d.ts.map +1 -1
- package/lib/typescript/hkdf.d.ts.map +1 -1
- package/lib/typescript/hmac.d.ts +2 -2
- package/lib/typescript/hmac.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +13 -8
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/keys/classes.d.ts +10 -1
- package/lib/typescript/keys/classes.d.ts.map +1 -1
- package/lib/typescript/keys/generateKeyPair.d.ts +12 -1
- package/lib/typescript/keys/generateKeyPair.d.ts.map +1 -1
- package/lib/typescript/keys/index.d.ts +3 -1
- package/lib/typescript/keys/index.d.ts.map +1 -1
- package/lib/typescript/keys/publicCipher.d.ts.map +1 -1
- package/lib/typescript/keys/signVerify.d.ts.map +1 -1
- package/lib/typescript/keys/utils.d.ts +21 -4
- package/lib/typescript/keys/utils.d.ts.map +1 -1
- package/lib/typescript/random.d.ts +5 -1
- package/lib/typescript/random.d.ts.map +1 -1
- package/lib/typescript/rsa.d.ts.map +1 -1
- package/lib/typescript/scrypt.d.ts.map +1 -1
- package/lib/typescript/slhdsa.d.ts +19 -0
- package/lib/typescript/slhdsa.d.ts.map +1 -0
- package/lib/typescript/specs/keyObjectHandle.nitro.d.ts +9 -0
- package/lib/typescript/specs/keyObjectHandle.nitro.d.ts.map +1 -1
- package/lib/typescript/specs/slhDsaKeyPair.nitro.d.ts +16 -0
- package/lib/typescript/specs/slhDsaKeyPair.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/turboshake.nitro.d.ts +11 -0
- package/lib/typescript/specs/turboshake.nitro.d.ts.map +1 -0
- package/lib/typescript/specs/utils.nitro.d.ts +0 -2
- package/lib/typescript/specs/utils.nitro.d.ts.map +1 -1
- package/lib/typescript/subtle.d.ts +3 -2
- package/lib/typescript/subtle.d.ts.map +1 -1
- package/lib/typescript/utils/cipher.d.ts +13 -1
- package/lib/typescript/utils/cipher.d.ts.map +1 -1
- package/lib/typescript/utils/conversion.d.ts +13 -9
- package/lib/typescript/utils/conversion.d.ts.map +1 -1
- package/lib/typescript/utils/errors.d.ts +12 -0
- package/lib/typescript/utils/errors.d.ts.map +1 -1
- package/lib/typescript/utils/timingSafeEqual.d.ts.map +1 -1
- package/lib/typescript/utils/types.d.ts +32 -15
- package/lib/typescript/utils/types.d.ts.map +1 -1
- package/lib/typescript/utils/validation.d.ts +3 -1
- package/lib/typescript/utils/validation.d.ts.map +1 -1
- package/lib/typescript/x509certificate.d.ts.map +1 -1
- package/nitrogen/generated/android/QuickCrypto+autolinking.cmake +2 -0
- package/nitrogen/generated/android/QuickCryptoOnLoad.cpp +20 -0
- package/nitrogen/generated/ios/QuickCryptoAutolinking.mm +20 -0
- package/nitrogen/generated/shared/c++/AsymmetricKeyType.hpp +48 -0
- package/nitrogen/generated/shared/c++/HybridKeyObjectHandleSpec.cpp +9 -0
- package/nitrogen/generated/shared/c++/HybridKeyObjectHandleSpec.hpp +9 -0
- package/nitrogen/generated/shared/c++/HybridSlhDsaKeyPairSpec.cpp +29 -0
- package/nitrogen/generated/shared/c++/HybridSlhDsaKeyPairSpec.hpp +72 -0
- package/nitrogen/generated/shared/c++/HybridTurboShakeSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridTurboShakeSpec.hpp +70 -0
- package/nitrogen/generated/shared/c++/HybridUtilsSpec.cpp +0 -2
- package/nitrogen/generated/shared/c++/HybridUtilsSpec.hpp +0 -3
- package/nitrogen/generated/shared/c++/JWK.hpp +9 -1
- package/nitrogen/generated/shared/c++/JWKkty.hpp +4 -0
- package/nitrogen/generated/shared/c++/KangarooTwelveVariant.hpp +76 -0
- package/nitrogen/generated/shared/c++/TurboShakeVariant.hpp +76 -0
- package/package.json +38 -7
- package/src/argon2.ts +80 -2
- package/src/cipher.ts +139 -15
- package/src/dhKeyPair.ts +8 -0
- package/src/dsa.ts +19 -2
- package/src/ec.ts +52 -29
- package/src/ed.ts +95 -16
- package/src/hash.ts +125 -12
- package/src/hkdf.ts +44 -6
- package/src/hmac.ts +17 -7
- package/src/keys/classes.ts +46 -5
- package/src/keys/generateKeyPair.ts +151 -5
- package/src/keys/index.ts +73 -3
- package/src/keys/publicCipher.ts +10 -4
- package/src/keys/signVerify.ts +13 -2
- package/src/keys/utils.ts +78 -5
- package/src/random.ts +104 -11
- package/src/rsa.ts +26 -4
- package/src/scrypt.ts +73 -6
- package/src/slhdsa.ts +146 -0
- package/src/specs/keyObjectHandle.nitro.ts +17 -0
- package/src/specs/slhDsaKeyPair.nitro.ts +29 -0
- package/src/specs/turboshake.nitro.ts +21 -0
- package/src/specs/utils.nitro.ts +0 -2
- package/src/subtle.ts +1246 -333
- package/src/utils/cipher.ts +30 -8
- package/src/utils/conversion.ts +129 -40
- package/src/utils/errors.ts +72 -4
- package/src/utils/timingSafeEqual.ts +8 -3
- package/src/utils/types.ts +80 -15
- package/src/utils/validation.ts +70 -1
- package/src/x509certificate.ts +5 -6
- package/deps/blake3/.cargo/config.toml +0 -2
- package/deps/blake3/.git-blame-ignore-revs +0 -2
- package/deps/blake3/.github/workflows/build_b3sum.py +0 -38
- package/deps/blake3/.github/workflows/ci.yml +0 -491
- package/deps/blake3/.github/workflows/tag.yml +0 -43
- package/deps/blake3/.github/workflows/upload_github_release_asset.py +0 -73
- package/deps/blake3/CONTRIBUTING.md +0 -31
- package/deps/blake3/Cargo.toml +0 -135
- package/deps/blake3/b3sum/Cargo.lock +0 -513
- package/deps/blake3/b3sum/Cargo.toml +0 -26
- package/deps/blake3/b3sum/README.md +0 -72
- package/deps/blake3/b3sum/src/main.rs +0 -564
- package/deps/blake3/b3sum/src/unit_tests.rs +0 -235
- package/deps/blake3/b3sum/tests/cli_tests.rs +0 -680
- package/deps/blake3/b3sum/what_does_check_do.md +0 -176
- package/deps/blake3/benches/bench.rs +0 -623
- package/deps/blake3/build.rs +0 -389
- package/deps/blake3/c/CMakeLists.txt +0 -383
- package/deps/blake3/c/CMakePresets.json +0 -73
- package/deps/blake3/c/Makefile.testing +0 -82
- package/deps/blake3/c/blake3-config.cmake.in +0 -14
- package/deps/blake3/c/blake3_avx2.c +0 -326
- package/deps/blake3/c/blake3_avx2_x86-64_unix.S +0 -1815
- package/deps/blake3/c/blake3_avx2_x86-64_windows_gnu.S +0 -1817
- package/deps/blake3/c/blake3_avx2_x86-64_windows_msvc.asm +0 -1828
- package/deps/blake3/c/blake3_avx512.c +0 -1388
- package/deps/blake3/c/blake3_avx512_x86-64_unix.S +0 -4824
- package/deps/blake3/c/blake3_avx512_x86-64_windows_gnu.S +0 -2615
- package/deps/blake3/c/blake3_avx512_x86-64_windows_msvc.asm +0 -2634
- package/deps/blake3/c/blake3_c_rust_bindings/Cargo.toml +0 -32
- package/deps/blake3/c/blake3_c_rust_bindings/README.md +0 -4
- package/deps/blake3/c/blake3_c_rust_bindings/benches/bench.rs +0 -477
- package/deps/blake3/c/blake3_c_rust_bindings/build.rs +0 -253
- package/deps/blake3/c/blake3_c_rust_bindings/cross_test.sh +0 -31
- package/deps/blake3/c/blake3_c_rust_bindings/src/lib.rs +0 -333
- package/deps/blake3/c/blake3_c_rust_bindings/src/test.rs +0 -696
- package/deps/blake3/c/blake3_sse2.c +0 -566
- package/deps/blake3/c/blake3_sse2_x86-64_unix.S +0 -2291
- package/deps/blake3/c/blake3_sse2_x86-64_windows_gnu.S +0 -2332
- package/deps/blake3/c/blake3_sse2_x86-64_windows_msvc.asm +0 -2350
- package/deps/blake3/c/blake3_sse41.c +0 -560
- package/deps/blake3/c/blake3_sse41_x86-64_unix.S +0 -2028
- package/deps/blake3/c/blake3_sse41_x86-64_windows_gnu.S +0 -2069
- package/deps/blake3/c/blake3_sse41_x86-64_windows_msvc.asm +0 -2089
- package/deps/blake3/c/blake3_tbb.cpp +0 -37
- package/deps/blake3/c/dependencies/CMakeLists.txt +0 -3
- package/deps/blake3/c/dependencies/tbb/CMakeLists.txt +0 -28
- package/deps/blake3/c/example.c +0 -36
- package/deps/blake3/c/example_tbb.c +0 -57
- package/deps/blake3/c/libblake3.pc.in +0 -12
- package/deps/blake3/c/main.c +0 -166
- package/deps/blake3/c/test.py +0 -97
- package/deps/blake3/media/B3.svg +0 -70
- package/deps/blake3/media/BLAKE3.svg +0 -85
- package/deps/blake3/media/speed.svg +0 -1474
- package/deps/blake3/reference_impl/Cargo.toml +0 -8
- package/deps/blake3/reference_impl/README.md +0 -14
- package/deps/blake3/reference_impl/reference_impl.rs +0 -374
- package/deps/blake3/src/ffi_avx2.rs +0 -65
- package/deps/blake3/src/ffi_avx512.rs +0 -169
- package/deps/blake3/src/ffi_neon.rs +0 -82
- package/deps/blake3/src/ffi_sse2.rs +0 -126
- package/deps/blake3/src/ffi_sse41.rs +0 -126
- package/deps/blake3/src/guts.rs +0 -60
- package/deps/blake3/src/hazmat.rs +0 -704
- package/deps/blake3/src/io.rs +0 -64
- package/deps/blake3/src/join.rs +0 -92
- package/deps/blake3/src/lib.rs +0 -1835
- package/deps/blake3/src/platform.rs +0 -587
- package/deps/blake3/src/portable.rs +0 -198
- package/deps/blake3/src/rust_avx2.rs +0 -474
- package/deps/blake3/src/rust_sse2.rs +0 -775
- package/deps/blake3/src/rust_sse41.rs +0 -766
- package/deps/blake3/src/test.rs +0 -1049
- package/deps/blake3/src/traits.rs +0 -227
- package/deps/blake3/src/wasm32_simd.rs +0 -794
- package/deps/blake3/test_vectors/Cargo.toml +0 -19
- package/deps/blake3/test_vectors/cross_test.sh +0 -25
- package/deps/blake3/test_vectors/src/bin/generate.rs +0 -4
- package/deps/blake3/test_vectors/src/lib.rs +0 -350
- package/deps/blake3/test_vectors/test_vectors.json +0 -217
- package/deps/blake3/tools/compiler_version/Cargo.toml +0 -7
- package/deps/blake3/tools/compiler_version/build.rs +0 -6
- package/deps/blake3/tools/compiler_version/src/main.rs +0 -27
- package/deps/blake3/tools/instruction_set_support/Cargo.toml +0 -6
- package/deps/blake3/tools/instruction_set_support/src/main.rs +0 -10
- package/deps/blake3/tools/release.md +0 -16
- package/deps/ncrypto/.bazelignore +0 -4
- package/deps/ncrypto/.bazelrc +0 -1
- package/deps/ncrypto/.bazelversion +0 -1
- package/deps/ncrypto/.clang-format +0 -111
- package/deps/ncrypto/.github/workflows/bazel.yml +0 -58
- package/deps/ncrypto/.github/workflows/commitlint.yml +0 -16
- package/deps/ncrypto/.github/workflows/linter.yml +0 -38
- package/deps/ncrypto/.github/workflows/macos.yml +0 -43
- package/deps/ncrypto/.github/workflows/release-please.yml +0 -16
- package/deps/ncrypto/.github/workflows/ubuntu.yml +0 -128
- package/deps/ncrypto/.github/workflows/visual-studio.yml +0 -49
- package/deps/ncrypto/.python-version +0 -1
- package/deps/ncrypto/.release-please-manifest.json +0 -3
- package/deps/ncrypto/BUILD.bazel +0 -44
- package/deps/ncrypto/CHANGELOG.md +0 -37
- package/deps/ncrypto/CMakeLists.txt +0 -79
- package/deps/ncrypto/MODULE.bazel +0 -16
- package/deps/ncrypto/MODULE.bazel.lock +0 -461
- package/deps/ncrypto/cmake/CPM.cmake +0 -1225
- package/deps/ncrypto/cmake/ncrypto-flags.cmake +0 -17
- package/deps/ncrypto/ncrypto.pc.in +0 -10
- package/deps/ncrypto/patches/0001-Expose-libdecrepit-so-NodeJS-can-use-it-for-ncrypto.patch +0 -28
- package/deps/ncrypto/pyproject.toml +0 -38
- package/deps/ncrypto/release-please-config.json +0 -11
- package/deps/ncrypto/src/CMakeLists.txt +0 -40
- package/deps/ncrypto/tests/BUILD.bazel +0 -11
- package/deps/ncrypto/tests/CMakeLists.txt +0 -7
- package/deps/ncrypto/tests/basic.cpp +0 -856
- package/deps/ncrypto/tools/run-clang-format.sh +0 -42
- package/deps/simdutf/.clang-format +0 -4
- package/deps/simdutf/.github/ISSUE_TEMPLATE/bug_report.md +0 -62
- package/deps/simdutf/.github/ISSUE_TEMPLATE/config.yml +0 -1
- package/deps/simdutf/.github/ISSUE_TEMPLATE/feature_request.md +0 -35
- package/deps/simdutf/.github/ISSUE_TEMPLATE/standard-issue-template.md +0 -29
- package/deps/simdutf/.github/pull_request_template.md +0 -51
- package/deps/simdutf/.github/workflows/aarch64.yml +0 -39
- package/deps/simdutf/.github/workflows/alpine.yml +0 -27
- package/deps/simdutf/.github/workflows/amalgamation_demos.yml +0 -34
- package/deps/simdutf/.github/workflows/armv7.yml +0 -32
- package/deps/simdutf/.github/workflows/atomic_fuzz.yml +0 -25
- package/deps/simdutf/.github/workflows/cifuzz.yml +0 -37
- package/deps/simdutf/.github/workflows/clangformat.yml +0 -36
- package/deps/simdutf/.github/workflows/debian-latestcxxstandards.yml +0 -40
- package/deps/simdutf/.github/workflows/debian.yml +0 -33
- package/deps/simdutf/.github/workflows/documentation.yml +0 -36
- package/deps/simdutf/.github/workflows/emscripten.yml +0 -19
- package/deps/simdutf/.github/workflows/loongarch64-gcc-14.2.yml +0 -39
- package/deps/simdutf/.github/workflows/macos-latest.yml +0 -29
- package/deps/simdutf/.github/workflows/msys2-clang.yml +0 -48
- package/deps/simdutf/.github/workflows/msys2.yml +0 -50
- package/deps/simdutf/.github/workflows/ppc64le.yml +0 -29
- package/deps/simdutf/.github/workflows/rvv-1024-clang-18.yml +0 -35
- package/deps/simdutf/.github/workflows/rvv-128-clang-17.yml +0 -35
- package/deps/simdutf/.github/workflows/rvv-256-gcc-14.yml +0 -31
- package/deps/simdutf/.github/workflows/s390x.yml +0 -29
- package/deps/simdutf/.github/workflows/selective-amalgamation.yml +0 -29
- package/deps/simdutf/.github/workflows/typos.yml +0 -19
- package/deps/simdutf/.github/workflows/ubuntu22-cxx20.yml +0 -30
- package/deps/simdutf/.github/workflows/ubuntu22.yml +0 -32
- package/deps/simdutf/.github/workflows/ubuntu22_gcc12.yml +0 -27
- package/deps/simdutf/.github/workflows/ubuntu22sani.yml +0 -29
- package/deps/simdutf/.github/workflows/ubuntu24-cxxstandards.yml +0 -34
- package/deps/simdutf/.github/workflows/ubuntu24-unsignedchar.yml +0 -34
- package/deps/simdutf/.github/workflows/ubuntu24.yml +0 -32
- package/deps/simdutf/.github/workflows/ubuntu24sani.yml +0 -36
- package/deps/simdutf/.github/workflows/ubuntu24sani_clang.yml +0 -29
- package/deps/simdutf/.github/workflows/vs17-arm-ci.yml +0 -21
- package/deps/simdutf/.github/workflows/vs17-ci-cxx20.yml +0 -41
- package/deps/simdutf/.github/workflows/vs17-ci.yml +0 -41
- package/deps/simdutf/.github/workflows/vs17-clang-ci.yml +0 -41
- package/deps/simdutf/.github/workflows/vs17-cxxstandards.yml +0 -36
- package/deps/simdutf/AI_USAGE_POLICY.md +0 -56
- package/deps/simdutf/AUTHORS +0 -6
- package/deps/simdutf/CMakeLists.txt +0 -231
- package/deps/simdutf/CONTRIBUTING.md +0 -214
- package/deps/simdutf/CONTRIBUTORS +0 -1
- package/deps/simdutf/Doxyfile +0 -2584
- package/deps/simdutf/Makefile.crosscompile +0 -54
- package/deps/simdutf/README-RVV.md +0 -16
- package/deps/simdutf/SECURITY.md +0 -8
- package/deps/simdutf/benchmarks/CMakeLists.txt +0 -101
- package/deps/simdutf/benchmarks/alignment.cpp +0 -150
- package/deps/simdutf/benchmarks/base64/CMakeLists.txt +0 -30
- package/deps/simdutf/benchmarks/base64/benchmark_base64.cpp +0 -875
- package/deps/simdutf/benchmarks/base64/libbase64_spaces.h +0 -49
- package/deps/simdutf/benchmarks/base64/node_base64.h +0 -227
- package/deps/simdutf/benchmarks/base64/openssl3_base64.h +0 -334
- package/deps/simdutf/benchmarks/benchmark.cpp +0 -65
- package/deps/simdutf/benchmarks/benchmark_to_well_formed_utf16.cpp +0 -347
- package/deps/simdutf/benchmarks/competition/.clang-format-ignore +0 -5
- package/deps/simdutf/benchmarks/competition/CppCon2018/utf_utils.cpp +0 -1276
- package/deps/simdutf/benchmarks/competition/CppCon2018/utf_utils.h +0 -595
- package/deps/simdutf/benchmarks/competition/README.md +0 -7
- package/deps/simdutf/benchmarks/competition/hoehrmann/hoehrmann.h +0 -91
- package/deps/simdutf/benchmarks/competition/inoue2008/inoue_utf8_to_utf16.h +0 -444
- package/deps/simdutf/benchmarks/competition/inoue2008/inoue_utf8_to_utf16_tables.h +0 -13183
- package/deps/simdutf/benchmarks/competition/inoue2008/script.py +0 -73
- package/deps/simdutf/benchmarks/competition/llvm/ConvertUTF.cpp +0 -738
- package/deps/simdutf/benchmarks/competition/llvm/ConvertUTF.h +0 -293
- package/deps/simdutf/benchmarks/competition/u8u16/COPYRIGHT +0 -8
- package/deps/simdutf/benchmarks/competition/u8u16/Makefile +0 -44
- package/deps/simdutf/benchmarks/competition/u8u16/OSL3.0.txt +0 -169
- package/deps/simdutf/benchmarks/competition/u8u16/Profiling/BOM_Profiler.h +0 -148
- package/deps/simdutf/benchmarks/competition/u8u16/Profiling/i386_timer.h +0 -45
- package/deps/simdutf/benchmarks/competition/u8u16/Profiling/ppc_timer.c +0 -34
- package/deps/simdutf/benchmarks/competition/u8u16/README +0 -56
- package/deps/simdutf/benchmarks/competition/u8u16/config/config_defs.h +0 -43
- package/deps/simdutf/benchmarks/competition/u8u16/config/g4_config.h +0 -27
- package/deps/simdutf/benchmarks/competition/u8u16/config/mmx_config.h +0 -16
- package/deps/simdutf/benchmarks/competition/u8u16/config/p4_config.h +0 -18
- package/deps/simdutf/benchmarks/competition/u8u16/config/p4_ideal_config.h +0 -16
- package/deps/simdutf/benchmarks/competition/u8u16/config/spu_config.h +0 -28
- package/deps/simdutf/benchmarks/competition/u8u16/config/ssse3_config.h +0 -20
- package/deps/simdutf/benchmarks/competition/u8u16/iconv_u8u16.c +0 -2
- package/deps/simdutf/benchmarks/competition/u8u16/lib/altivec_simd.h +0 -440
- package/deps/simdutf/benchmarks/competition/u8u16/lib/libgen/make_basic_ops.py +0 -121
- package/deps/simdutf/benchmarks/competition/u8u16/lib/libgen/make_half_operand_versions.py +0 -158
- package/deps/simdutf/benchmarks/competition/u8u16/lib/libgen/make_test.py +0 -270
- package/deps/simdutf/benchmarks/competition/u8u16/lib/mmx_simd.h +0 -141
- package/deps/simdutf/benchmarks/competition/u8u16/lib/mmx_simd_basic.h +0 -216
- package/deps/simdutf/benchmarks/competition/u8u16/lib/mmx_simd_built_in.h +0 -119
- package/deps/simdutf/benchmarks/competition/u8u16/lib/mmx_simd_modified.h +0 -2430
- package/deps/simdutf/benchmarks/competition/u8u16/lib/outline.txt +0 -39
- package/deps/simdutf/benchmarks/competition/u8u16/lib/spu_simd.h +0 -421
- package/deps/simdutf/benchmarks/competition/u8u16/lib/sse_simd.h +0 -836
- package/deps/simdutf/benchmarks/competition/u8u16/lib/stdint.h +0 -222
- package/deps/simdutf/benchmarks/competition/u8u16/libu8u16_BE.c +0 -4
- package/deps/simdutf/benchmarks/competition/u8u16/libu8u16_LE.c +0 -5
- package/deps/simdutf/benchmarks/competition/u8u16/proto/u8u16.py +0 -390
- package/deps/simdutf/benchmarks/competition/u8u16/src/Makefile +0 -18
- package/deps/simdutf/benchmarks/competition/u8u16/src/bytelex.h +0 -448
- package/deps/simdutf/benchmarks/competition/u8u16/src/charsets/ASCII_EBCDIC.h +0 -284
- package/deps/simdutf/benchmarks/competition/u8u16/src/libu8u16.c +0 -1975
- package/deps/simdutf/benchmarks/competition/u8u16/src/libu8u16.pdf +0 -0
- package/deps/simdutf/benchmarks/competition/u8u16/src/libu8u16.w +0 -2263
- package/deps/simdutf/benchmarks/competition/u8u16/src/multiliteral.h +0 -239
- package/deps/simdutf/benchmarks/competition/u8u16/src/u8u16.c +0 -232
- package/deps/simdutf/benchmarks/competition/u8u16/src/x8x16.c +0 -194
- package/deps/simdutf/benchmarks/competition/u8u16/src/xml_error.c +0 -193
- package/deps/simdutf/benchmarks/competition/u8u16/src/xml_error.h +0 -167
- package/deps/simdutf/benchmarks/competition/u8u16/src/xmldecl.c +0 -288
- package/deps/simdutf/benchmarks/competition/u8u16/src/xmldecl.h +0 -117
- package/deps/simdutf/benchmarks/competition/u8u16/u8u16_g4.c +0 -2
- package/deps/simdutf/benchmarks/competition/u8u16/u8u16_mmx.c +0 -2
- package/deps/simdutf/benchmarks/competition/u8u16/u8u16_p4.c +0 -3
- package/deps/simdutf/benchmarks/competition/u8u16/u8u16_p4_ideal.c +0 -2
- package/deps/simdutf/benchmarks/competition/u8u16/u8u16_spu.c +0 -2
- package/deps/simdutf/benchmarks/competition/u8u16/u8u16_ssse3.c +0 -3
- package/deps/simdutf/benchmarks/competition/u8u16/x8x16_p4.c +0 -2
- package/deps/simdutf/benchmarks/competition/utf8lut/LICENSE +0 -23
- package/deps/simdutf/benchmarks/competition/utf8lut/data/test_minimal.txt +0 -44
- package/deps/simdutf/benchmarks/competition/utf8lut/readme.md +0 -106
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_clang_corr_tests.cmd +0 -11
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_clang_corr_tests.sh +0 -13
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_gcc_corr_tests.sh +0 -13
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_gcc_example.sh +0 -13
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_gcc_file_conv.sh +0 -14
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_gcc_iconv_lib.sh +0 -11
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_gcc_iconv_sample.sh +0 -8
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_mingw_corr_tests.cmd +0 -12
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_mingw_example.cmd +0 -13
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_mingw_file_conv.cmd +0 -14
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_mingw_iconv_lib.cmd +0 -11
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_mingw_iconv_sample.cmd +0 -8
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_msvc_corr_tests.cmd +0 -11
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_msvc_example.cmd +0 -12
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_msvc_file_conv.cmd +0 -13
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_msvc_iconv_lib.cmd +0 -10
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/build_msvc_iconv_sample.cmd +0 -9
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/html_table.py +0 -25
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/measure.py +0 -94
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/resize.py +0 -20
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/wipe_all.cmd +0 -2
- package/deps/simdutf/benchmarks/competition/utf8lut/scripts/wipe_interm.cmd +0 -1
- package/deps/simdutf/benchmarks/competition/utf8lut/src/base/CustomMemcpy.h +0 -75
- package/deps/simdutf/benchmarks/competition/utf8lut/src/base/PerfDefs.h +0 -47
- package/deps/simdutf/benchmarks/competition/utf8lut/src/base/Timing.cpp +0 -17
- package/deps/simdutf/benchmarks/competition/utf8lut/src/base/Timing.h +0 -76
- package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/AllProcessors.cpp +0 -35
- package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/BaseBufferProcessor.cpp +0 -117
- package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/BaseBufferProcessor.h +0 -210
- package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/BufferDecoder.h +0 -158
- package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/BufferEncoder.h +0 -104
- package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/ProcessorPlugins.h +0 -334
- package/deps/simdutf/benchmarks/competition/utf8lut/src/buffer/ProcessorSelector.h +0 -186
- package/deps/simdutf/benchmarks/competition/utf8lut/src/core/DecoderLut.cpp +0 -140
- package/deps/simdutf/benchmarks/competition/utf8lut/src/core/DecoderLut.h +0 -42
- package/deps/simdutf/benchmarks/competition/utf8lut/src/core/DecoderProcess.h +0 -100
- package/deps/simdutf/benchmarks/competition/utf8lut/src/core/Dfa.h +0 -57
- package/deps/simdutf/benchmarks/competition/utf8lut/src/core/EncoderLut.cpp +0 -85
- package/deps/simdutf/benchmarks/competition/utf8lut/src/core/EncoderLut.h +0 -27
- package/deps/simdutf/benchmarks/competition/utf8lut/src/core/EncoderProcess.h +0 -126
- package/deps/simdutf/benchmarks/competition/utf8lut/src/core/ProcessTrivial.h +0 -108
- package/deps/simdutf/benchmarks/competition/utf8lut/src/iconv/iconv.cpp +0 -139
- package/deps/simdutf/benchmarks/competition/utf8lut/src/iconv/iconv.h +0 -74
- package/deps/simdutf/benchmarks/competition/utf8lut/src/message/MessageConverter.cpp +0 -65
- package/deps/simdutf/benchmarks/competition/utf8lut/src/message/MessageConverter.h +0 -91
- package/deps/simdutf/benchmarks/competition/utf8lut/src/tests/CorrectnessTests.cpp +0 -772
- package/deps/simdutf/benchmarks/competition/utf8lut/src/tests/Example.cpp +0 -12
- package/deps/simdutf/benchmarks/competition/utf8lut/src/tests/FileConverter.cpp +0 -486
- package/deps/simdutf/benchmarks/competition/utf8lut/src/tests/iconv_sample.c +0 -162
- package/deps/simdutf/benchmarks/competition/utf8lut/src/utf8lut.h +0 -15
- package/deps/simdutf/benchmarks/competition/utf8sse4/fromutf8-sse.cpp +0 -292
- package/deps/simdutf/benchmarks/competition/utfcpp/LICENSE +0 -23
- package/deps/simdutf/benchmarks/competition/utfcpp/README.md +0 -1503
- package/deps/simdutf/benchmarks/competition/utfcpp/source/utf8/checked.h +0 -335
- package/deps/simdutf/benchmarks/competition/utfcpp/source/utf8/core.h +0 -338
- package/deps/simdutf/benchmarks/competition/utfcpp/source/utf8/cpp11.h +0 -103
- package/deps/simdutf/benchmarks/competition/utfcpp/source/utf8/cpp17.h +0 -103
- package/deps/simdutf/benchmarks/competition/utfcpp/source/utf8/unchecked.h +0 -274
- package/deps/simdutf/benchmarks/competition/utfcpp/source/utf8.h +0 -34
- package/deps/simdutf/benchmarks/dataset/README.md +0 -155
- package/deps/simdutf/benchmarks/dataset/emoji.txt +0 -204
- package/deps/simdutf/benchmarks/dataset/scripts/utf8type.py +0 -40
- package/deps/simdutf/benchmarks/dataset/wikipedia_mars/Makefile +0 -80
- package/deps/simdutf/benchmarks/dataset/wikipedia_mars/convert_to_utf6.py +0 -20
- package/deps/simdutf/benchmarks/find/CMakeLists.txt +0 -6
- package/deps/simdutf/benchmarks/find/findbenchmark.cpp +0 -63
- package/deps/simdutf/benchmarks/find/findbenchmarker.h +0 -46
- package/deps/simdutf/benchmarks/shortbench.cpp +0 -555
- package/deps/simdutf/benchmarks/src/CMakeLists.txt +0 -52
- package/deps/simdutf/benchmarks/src/apple_arm_events.h +0 -1104
- package/deps/simdutf/benchmarks/src/benchmark.cpp +0 -3899
- package/deps/simdutf/benchmarks/src/benchmark.h +0 -317
- package/deps/simdutf/benchmarks/src/benchmark_base.cpp +0 -144
- package/deps/simdutf/benchmarks/src/benchmark_base.h +0 -98
- package/deps/simdutf/benchmarks/src/cmdline.cpp +0 -176
- package/deps/simdutf/benchmarks/src/cmdline.h +0 -35
- package/deps/simdutf/benchmarks/src/event_counter.h +0 -162
- package/deps/simdutf/benchmarks/src/linux-perf-events.h +0 -104
- package/deps/simdutf/benchmarks/stream.cpp +0 -209
- package/deps/simdutf/benchmarks/threaded.cpp +0 -123
- package/deps/simdutf/cmake/CPM.cmake +0 -1363
- package/deps/simdutf/cmake/JoinPaths.cmake +0 -23
- package/deps/simdutf/cmake/add_cpp_test.cmake +0 -68
- package/deps/simdutf/cmake/simdutf-config.cmake.in +0 -2
- package/deps/simdutf/cmake/simdutf-flags.cmake +0 -26
- package/deps/simdutf/cmake/toolchains-ci/riscv64-linux-gnu.cmake +0 -4
- package/deps/simdutf/cmake/toolchains-dev/README.md +0 -32
- package/deps/simdutf/cmake/toolchains-dev/aarch64.cmake +0 -14
- package/deps/simdutf/cmake/toolchains-dev/loongarch64.cmake +0 -22
- package/deps/simdutf/cmake/toolchains-dev/powerpc64.cmake +0 -16
- package/deps/simdutf/cmake/toolchains-dev/powerpc64le.cmake +0 -16
- package/deps/simdutf/cmake/toolchains-dev/riscv64.cmake +0 -16
- package/deps/simdutf/cmake/toolchains-dev/rvv-spike.cmake +0 -38
- package/deps/simdutf/doc/avx512.png +0 -0
- package/deps/simdutf/doc/logo.png +0 -0
- package/deps/simdutf/doc/logo.svg +0 -165
- package/deps/simdutf/doc/node2023.png +0 -0
- package/deps/simdutf/doc/shortinput.md +0 -78
- package/deps/simdutf/doc/utf16utf8.png +0 -0
- package/deps/simdutf/doc/utf8utf16.png +0 -0
- package/deps/simdutf/doc/widelogo.png +0 -0
- package/deps/simdutf/doxygen.py +0 -50
- package/deps/simdutf/fuzz/.clang-format +0 -9
- package/deps/simdutf/fuzz/CMakeLists.txt +0 -45
- package/deps/simdutf/fuzz/README.md +0 -168
- package/deps/simdutf/fuzz/atomic_base64.cpp +0 -448
- package/deps/simdutf/fuzz/base64.cpp +0 -278
- package/deps/simdutf/fuzz/build.sh +0 -83
- package/deps/simdutf/fuzz/conversion.cpp +0 -669
- package/deps/simdutf/fuzz/helpers/.clang-format-ignore +0 -1
- package/deps/simdutf/fuzz/helpers/common.h +0 -135
- package/deps/simdutf/fuzz/helpers/nameof.hpp +0 -1258
- package/deps/simdutf/fuzz/main.cpp +0 -72
- package/deps/simdutf/fuzz/minimize_and_cleanse.sh +0 -87
- package/deps/simdutf/fuzz/misc.cpp +0 -216
- package/deps/simdutf/fuzz/random_fuzz.sh +0 -154
- package/deps/simdutf/fuzz/roundtrip.cpp +0 -588
- package/deps/simdutf/fuzz/safe_conversion.cpp +0 -104
- package/deps/simdutf/riscv/Dockerfile +0 -16
- package/deps/simdutf/riscv/README.md +0 -24
- package/deps/simdutf/riscv/remove-docker-station +0 -8
- package/deps/simdutf/riscv/run-docker-station +0 -31
- package/deps/simdutf/scripts/.flake8 +0 -2
- package/deps/simdutf/scripts/Makefile +0 -2
- package/deps/simdutf/scripts/README_ADD_FUNCTION.md +0 -49
- package/deps/simdutf/scripts/add_function.py +0 -330
- package/deps/simdutf/scripts/amalgamation_tests.py +0 -156
- package/deps/simdutf/scripts/base64/Makefile +0 -2
- package/deps/simdutf/scripts/base64/README.md +0 -2
- package/deps/simdutf/scripts/base64/avx512.py +0 -76
- package/deps/simdutf/scripts/base64/neon_decode.py +0 -143
- package/deps/simdutf/scripts/base64/neon_generate_lut.py +0 -101
- package/deps/simdutf/scripts/base64/sse.py +0 -252
- package/deps/simdutf/scripts/base64/sseregular.py +0 -160
- package/deps/simdutf/scripts/base64/sseurl.py +0 -283
- package/deps/simdutf/scripts/base64/table.py +0 -59
- package/deps/simdutf/scripts/base64bench_print.py +0 -145
- package/deps/simdutf/scripts/benchmark-all.py +0 -119
- package/deps/simdutf/scripts/benchmark_print.py +0 -324
- package/deps/simdutf/scripts/check_feature_macros.py +0 -156
- package/deps/simdutf/scripts/check_typos.sh +0 -13
- package/deps/simdutf/scripts/clang_format.sh +0 -35
- package/deps/simdutf/scripts/clang_format_docker.sh +0 -38
- package/deps/simdutf/scripts/common.py +0 -24
- package/deps/simdutf/scripts/compilation_benchmark.py +0 -55
- package/deps/simdutf/scripts/compile_many_variations.sh +0 -64
- package/deps/simdutf/scripts/create_latex_table.py +0 -62
- package/deps/simdutf/scripts/docker/Dockerfile +0 -14
- package/deps/simdutf/scripts/docker/Makefile +0 -9
- package/deps/simdutf/scripts/docker/README.md +0 -30
- package/deps/simdutf/scripts/docker/llvm.gpg +0 -0
- package/deps/simdutf/scripts/ppc64_convert_utf16_to_utf8.py +0 -155
- package/deps/simdutf/scripts/prepare_doxygen.sh +0 -21
- package/deps/simdutf/scripts/release.py +0 -197
- package/deps/simdutf/scripts/shortinputplots.py +0 -97
- package/deps/simdutf/scripts/sse_convert_utf16_to_utf8.py +0 -422
- package/deps/simdutf/scripts/sse_convert_utf32_to_utf16.py +0 -105
- package/deps/simdutf/scripts/sse_utf8_utf16_decode.py +0 -186
- package/deps/simdutf/scripts/sse_validate_utf16le_proof.py +0 -137
- package/deps/simdutf/scripts/sse_validate_utf16le_testcases.py +0 -129
- package/deps/simdutf/scripts/table.py +0 -207
- package/deps/simdutf/scripts/tests/new.txt +0 -33
- package/deps/simdutf/scripts/tests/old.txt +0 -33
- package/deps/simdutf/scripts/tests/results.txt +0 -272
- package/deps/simdutf/simdutf.pc.in +0 -11
- package/deps/simdutf/singleheader/.flake8 +0 -2
- package/deps/simdutf/singleheader/CMakeLists.txt +0 -64
- package/deps/simdutf/singleheader/README-dev.md +0 -81
- package/deps/simdutf/singleheader/README.md +0 -19
- package/deps/simdutf/singleheader/amalgamate.py +0 -513
- package/deps/simdutf/singleheader/amalgamation_demo.c +0 -59
- package/deps/simdutf/singleheader/amalgamation_demo.cpp +0 -54
- package/deps/simdutf/singleheader/test-features.py +0 -262
- package/deps/simdutf/src/CMakeLists.txt +0 -78
- package/deps/simdutf/tests/CMakeLists.txt +0 -483
- package/deps/simdutf/tests/atomic_base64_tests.cpp +0 -2845
- package/deps/simdutf/tests/base64_tests.cpp +0 -3617
- package/deps/simdutf/tests/basic_fuzzer.cpp +0 -805
- package/deps/simdutf/tests/bele_tests.cpp +0 -182
- package/deps/simdutf/tests/constexpr_base64_tests.cpp +0 -387
- package/deps/simdutf/tests/convert_latin1_to_utf16be_tests.cpp +0 -52
- package/deps/simdutf/tests/convert_latin1_to_utf16le_tests.cpp +0 -80
- package/deps/simdutf/tests/convert_latin1_to_utf32_tests.cpp +0 -66
- package/deps/simdutf/tests/convert_latin1_to_utf8_tests.cpp +0 -120
- package/deps/simdutf/tests/convert_utf16_to_utf8_safe_tests.cpp +0 -203
- package/deps/simdutf/tests/convert_utf16_to_utf8_with_replacement_tests.cpp +0 -276
- package/deps/simdutf/tests/convert_utf16be_to_latin1_tests.cpp +0 -109
- package/deps/simdutf/tests/convert_utf16be_to_latin1_tests_with_errors.cpp +0 -136
- package/deps/simdutf/tests/convert_utf16be_to_utf32_tests.cpp +0 -193
- package/deps/simdutf/tests/convert_utf16be_to_utf32_with_errors_tests.cpp +0 -381
- package/deps/simdutf/tests/convert_utf16be_to_utf8_tests.cpp +0 -259
- package/deps/simdutf/tests/convert_utf16be_to_utf8_with_errors_tests.cpp +0 -266
- package/deps/simdutf/tests/convert_utf16le_to_latin1_tests.cpp +0 -148
- package/deps/simdutf/tests/convert_utf16le_to_latin1_tests_with_errors.cpp +0 -176
- package/deps/simdutf/tests/convert_utf16le_to_utf32_tests.cpp +0 -213
- package/deps/simdutf/tests/convert_utf16le_to_utf32_with_errors_tests.cpp +0 -318
- package/deps/simdutf/tests/convert_utf16le_to_utf8_tests.cpp +0 -343
- package/deps/simdutf/tests/convert_utf16le_to_utf8_with_errors_tests.cpp +0 -271
- package/deps/simdutf/tests/convert_utf32_to_latin1_tests.cpp +0 -111
- package/deps/simdutf/tests/convert_utf32_to_latin1_with_errors_tests.cpp +0 -96
- package/deps/simdutf/tests/convert_utf32_to_utf16be_tests.cpp +0 -148
- package/deps/simdutf/tests/convert_utf32_to_utf16be_with_errors_tests.cpp +0 -192
- package/deps/simdutf/tests/convert_utf32_to_utf16le_tests.cpp +0 -166
- package/deps/simdutf/tests/convert_utf32_to_utf16le_with_errors_tests.cpp +0 -215
- package/deps/simdutf/tests/convert_utf32_to_utf8_tests.cpp +0 -181
- package/deps/simdutf/tests/convert_utf32_to_utf8_with_errors_tests.cpp +0 -261
- package/deps/simdutf/tests/convert_utf8_to_latin1_tests.cpp +0 -516
- package/deps/simdutf/tests/convert_utf8_to_latin1_with_errors_tests.cpp +0 -579
- package/deps/simdutf/tests/convert_utf8_to_utf16be_tests.cpp +0 -412
- package/deps/simdutf/tests/convert_utf8_to_utf16be_with_errors_tests.cpp +0 -480
- package/deps/simdutf/tests/convert_utf8_to_utf16le_tests.cpp +0 -671
- package/deps/simdutf/tests/convert_utf8_to_utf16le_with_errors_tests.cpp +0 -455
- package/deps/simdutf/tests/convert_utf8_to_utf32_tests.cpp +0 -1204
- package/deps/simdutf/tests/convert_utf8_to_utf32_with_errors_tests.cpp +0 -337
- package/deps/simdutf/tests/convert_valid_utf16be_to_latin1_tests.cpp +0 -37
- package/deps/simdutf/tests/convert_valid_utf16be_to_utf32_tests.cpp +0 -97
- package/deps/simdutf/tests/convert_valid_utf16be_to_utf8_tests.cpp +0 -126
- package/deps/simdutf/tests/convert_valid_utf16le_to_latin1_tests.cpp +0 -71
- package/deps/simdutf/tests/convert_valid_utf16le_to_utf32_tests.cpp +0 -122
- package/deps/simdutf/tests/convert_valid_utf16le_to_utf8_tests.cpp +0 -244
- package/deps/simdutf/tests/convert_valid_utf32_to_latin1_tests.cpp +0 -49
- package/deps/simdutf/tests/convert_valid_utf32_to_utf16be_tests.cpp +0 -92
- package/deps/simdutf/tests/convert_valid_utf32_to_utf16le_tests.cpp +0 -114
- package/deps/simdutf/tests/convert_valid_utf32_to_utf8_tests.cpp +0 -109
- package/deps/simdutf/tests/convert_valid_utf8_to_latin1_tests.cpp +0 -84
- package/deps/simdutf/tests/convert_valid_utf8_to_utf16be_tests.cpp +0 -124
- package/deps/simdutf/tests/convert_valid_utf8_to_utf16le_tests.cpp +0 -221
- package/deps/simdutf/tests/convert_valid_utf8_to_utf32_tests.cpp +0 -155
- package/deps/simdutf/tests/count_utf16be.cpp +0 -64
- package/deps/simdutf/tests/count_utf16le.cpp +0 -61
- package/deps/simdutf/tests/count_utf8.cpp +0 -87
- package/deps/simdutf/tests/detect_encodings_tests.cpp +0 -312
- package/deps/simdutf/tests/embed/valid_utf8.txt +0 -1
- package/deps/simdutf/tests/embed_tests.cpp +0 -22
- package/deps/simdutf/tests/find_tests.cpp +0 -77
- package/deps/simdutf/tests/fixed_string_tests.cpp +0 -153
- package/deps/simdutf/tests/helpers/CMakeLists.txt +0 -25
- package/deps/simdutf/tests/helpers/compiletime_conversions.h +0 -222
- package/deps/simdutf/tests/helpers/fixed_string.h +0 -267
- package/deps/simdutf/tests/helpers/random_int.cpp +0 -30
- package/deps/simdutf/tests/helpers/random_int.h +0 -39
- package/deps/simdutf/tests/helpers/random_utf16.cpp +0 -123
- package/deps/simdutf/tests/helpers/random_utf16.h +0 -52
- package/deps/simdutf/tests/helpers/random_utf32.cpp +0 -41
- package/deps/simdutf/tests/helpers/random_utf32.h +0 -40
- package/deps/simdutf/tests/helpers/random_utf8.cpp +0 -93
- package/deps/simdutf/tests/helpers/random_utf8.h +0 -36
- package/deps/simdutf/tests/helpers/test.cpp +0 -231
- package/deps/simdutf/tests/helpers/test.h +0 -193
- package/deps/simdutf/tests/helpers/transcode_test_base.cpp +0 -1257
- package/deps/simdutf/tests/helpers/transcode_test_base.h +0 -683
- package/deps/simdutf/tests/helpers/utf16.h +0 -27
- package/deps/simdutf/tests/installation_tests/find/CMakeLists.txt +0 -43
- package/deps/simdutf/tests/installation_tests/from_fetch/CMakeLists.txt +0 -47
- package/deps/simdutf/tests/internal_tests.cpp +0 -27
- package/deps/simdutf/tests/null_safety_tests.cpp +0 -94
- package/deps/simdutf/tests/random_fuzzer.cpp +0 -779
- package/deps/simdutf/tests/readme_tests.cpp +0 -274
- package/deps/simdutf/tests/reference/CMakeLists.txt +0 -23
- package/deps/simdutf/tests/reference/decode_utf16.h +0 -81
- package/deps/simdutf/tests/reference/decode_utf32.h +0 -47
- package/deps/simdutf/tests/reference/encode_latin1.cpp +0 -1
- package/deps/simdutf/tests/reference/encode_latin1.h +0 -32
- package/deps/simdutf/tests/reference/encode_utf16.cpp +0 -49
- package/deps/simdutf/tests/reference/encode_utf16.h +0 -20
- package/deps/simdutf/tests/reference/encode_utf32.cpp +0 -1
- package/deps/simdutf/tests/reference/encode_utf32.h +0 -36
- package/deps/simdutf/tests/reference/encode_utf8.cpp +0 -1
- package/deps/simdutf/tests/reference/encode_utf8.h +0 -40
- package/deps/simdutf/tests/reference/validate_utf16.cpp +0 -60
- package/deps/simdutf/tests/reference/validate_utf16.h +0 -14
- package/deps/simdutf/tests/reference/validate_utf16_to_latin1.cpp +0 -35
- package/deps/simdutf/tests/reference/validate_utf16_to_latin1.h +0 -13
- package/deps/simdutf/tests/reference/validate_utf32.cpp +0 -27
- package/deps/simdutf/tests/reference/validate_utf32.h +0 -12
- package/deps/simdutf/tests/reference/validate_utf32_to_latin1.cpp +0 -27
- package/deps/simdutf/tests/reference/validate_utf32_to_latin1.h +0 -12
- package/deps/simdutf/tests/reference/validate_utf8.cpp +0 -82
- package/deps/simdutf/tests/reference/validate_utf8.h +0 -11
- package/deps/simdutf/tests/reference/validate_utf8_to_latin1.cpp +0 -43
- package/deps/simdutf/tests/reference/validate_utf8_to_latin1.h +0 -12
- package/deps/simdutf/tests/select_implementation.cpp +0 -43
- package/deps/simdutf/tests/simdutf_c_tests.cpp +0 -244
- package/deps/simdutf/tests/span_tests.cpp +0 -401
- package/deps/simdutf/tests/special_tests.cpp +0 -559
- package/deps/simdutf/tests/straight_c_test.c +0 -187
- package/deps/simdutf/tests/text_encoding_tests.cpp +0 -77
- package/deps/simdutf/tests/to_well_formed_utf16_tests.cpp +0 -377
- package/deps/simdutf/tests/utf8_length_from_utf16_tests.cpp +0 -202
- package/deps/simdutf/tests/validate_ascii_basic_tests.cpp +0 -165
- package/deps/simdutf/tests/validate_ascii_with_errors_tests.cpp +0 -77
- package/deps/simdutf/tests/validate_utf16be_basic_tests.cpp +0 -175
- package/deps/simdutf/tests/validate_utf16be_with_errors_tests.cpp +0 -188
- package/deps/simdutf/tests/validate_utf16le_basic_tests.cpp +0 -268
- package/deps/simdutf/tests/validate_utf16le_with_errors_tests.cpp +0 -274
- package/deps/simdutf/tests/validate_utf32_basic_tests.cpp +0 -92
- package/deps/simdutf/tests/validate_utf32_with_errors_tests.cpp +0 -114
- package/deps/simdutf/tests/validate_utf8_basic_tests.cpp +0 -178
- package/deps/simdutf/tests/validate_utf8_brute_force_tests.cpp +0 -88
- package/deps/simdutf/tests/validate_utf8_puzzler_tests.cpp +0 -33
- package/deps/simdutf/tests/validate_utf8_with_errors_tests.cpp +0 -228
- package/deps/simdutf/tools/CMakeLists.txt +0 -85
- package/deps/simdutf/tools/fastbase64.cpp +0 -250
- package/deps/simdutf/tools/sutf.cpp +0 -556
- package/deps/simdutf/tools/sutf.h +0 -40
- package/lib/tsconfig.tsbuildinfo +0 -1
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
// https://github.com/aklomp/base64/blob/b20a31a997e0b48274fa09e58b65ee9202531e4f/bin/base64.c#L392
|
|
3
|
-
static inline size_t libbase64_find_space(const char *p, const size_t avail) {
|
|
4
|
-
for (size_t len = 0; len < avail; len++) {
|
|
5
|
-
if (p[len] == '\n' || p[len] == '\r' || p[len] == ' ' || p[len] == '\t') {
|
|
6
|
-
return len;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
return avail;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// Inspired by
|
|
14
|
-
// https://github.com/aklomp/base64/blob/b20a31a997e0b48274fa09e58b65ee9202531e4f/bin/base64.c#L405
|
|
15
|
-
static bool libbase64_space_decode(const char *start, size_t avail,
|
|
16
|
-
char *outbuf, size_t *outlen) {
|
|
17
|
-
struct base64_state state;
|
|
18
|
-
*outlen = 0;
|
|
19
|
-
|
|
20
|
-
// Initialize the decoder's state structure.
|
|
21
|
-
base64_stream_decode_init(&state, 0);
|
|
22
|
-
|
|
23
|
-
while (avail > 0) {
|
|
24
|
-
size_t len = libbase64_find_space(start, avail);
|
|
25
|
-
if (len == 0) {
|
|
26
|
-
start++;
|
|
27
|
-
avail--;
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Decode the chunk into the raw buffer.
|
|
32
|
-
size_t outlen = 0;
|
|
33
|
-
if (base64_stream_decode(&state, start, len, outbuf, &outlen) == 0) {
|
|
34
|
-
// decoding error
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Update the output buffer pointer and total size.
|
|
39
|
-
outbuf += outlen;
|
|
40
|
-
outlen += outlen;
|
|
41
|
-
if (avail == len) {
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
start += len + 1;
|
|
46
|
-
avail -= len + 1;
|
|
47
|
-
}
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
// Taken from Node.js, for benchmarking purposes.
|
|
2
|
-
// See
|
|
3
|
-
// https://github.com/nodejs/node/blob/dafe004703f4f0a878558090ab3dd8ef0624037d/src/base64.h#L15
|
|
4
|
-
// and
|
|
5
|
-
// https://github.com/nodejs/node/blob/dafe004703f4f0a878558090ab3dd8ef0624037d/src/base64-inl.h
|
|
6
|
-
#include <cmath>
|
|
7
|
-
#include <cstddef>
|
|
8
|
-
#include <cstdint>
|
|
9
|
-
namespace node {
|
|
10
|
-
//// Base 64 ////
|
|
11
|
-
|
|
12
|
-
enum class Base64Mode { NORMAL, URL };
|
|
13
|
-
|
|
14
|
-
// Doesn't check for padding at the end. Can be 1-2 bytes over.
|
|
15
|
-
inline constexpr size_t base64_decoded_size_fast(size_t size) {
|
|
16
|
-
// 1-byte input cannot be decoded
|
|
17
|
-
return size > 1 ? (size / 4) * 3 + (size % 4 + 1) / 2 : 0;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
inline uint32_t ReadUint32BE(const unsigned char *p);
|
|
21
|
-
|
|
22
|
-
template <typename TypeName>
|
|
23
|
-
size_t base64_decoded_size(const TypeName *src, size_t size);
|
|
24
|
-
|
|
25
|
-
template <typename TypeName>
|
|
26
|
-
size_t base64_decode(char *const dst, const size_t dstlen,
|
|
27
|
-
const TypeName *const src, const size_t srclen);
|
|
28
|
-
|
|
29
|
-
inline size_t base64_encode(const char *src, size_t slen, char *dst,
|
|
30
|
-
size_t dlen, Base64Mode mode = Base64Mode::NORMAL);
|
|
31
|
-
} // namespace node
|
|
32
|
-
|
|
33
|
-
namespace node {
|
|
34
|
-
|
|
35
|
-
/*extern const int8_t unbase64_table[256];*/
|
|
36
|
-
|
|
37
|
-
// supports regular and URL-safe base64
|
|
38
|
-
const int8_t unbase64_table[256] = {
|
|
39
|
-
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -2, -1, -1, -1, -1, -1,
|
|
40
|
-
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1,
|
|
41
|
-
-1, -1, -1, -1, -1, 62, -1, 62, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60,
|
|
42
|
-
61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
|
|
43
|
-
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1,
|
|
44
|
-
63, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
|
|
45
|
-
43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
|
46
|
-
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
|
47
|
-
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
|
48
|
-
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
|
49
|
-
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
|
50
|
-
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
|
51
|
-
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
|
52
|
-
-1, -1, -1, -1, -1, -1, -1, -1, -1};
|
|
53
|
-
|
|
54
|
-
inline int8_t unbase64(uint8_t x) { return unbase64_table[x]; }
|
|
55
|
-
|
|
56
|
-
inline uint32_t ReadUint32BE(const unsigned char *p) {
|
|
57
|
-
return static_cast<uint32_t>(p[0] << 24U) |
|
|
58
|
-
static_cast<uint32_t>(p[1] << 16U) |
|
|
59
|
-
static_cast<uint32_t>(p[2] << 8U) | static_cast<uint32_t>(p[3]);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
#ifdef _MSC_VER
|
|
63
|
-
#pragma warning(push)
|
|
64
|
-
// MSVC C4003: not enough actual parameters for macro 'identifier'
|
|
65
|
-
#pragma warning(disable : 4003)
|
|
66
|
-
#endif
|
|
67
|
-
template <typename TypeName>
|
|
68
|
-
bool base64_decode_group_slow(char *const dst, const size_t dstlen,
|
|
69
|
-
const TypeName *const src, const size_t srclen,
|
|
70
|
-
size_t *const i, size_t *const k) {
|
|
71
|
-
uint8_t hi;
|
|
72
|
-
uint8_t lo;
|
|
73
|
-
#define V(expr) \
|
|
74
|
-
for (;;) { \
|
|
75
|
-
const uint8_t c = static_cast<uint8_t>(src[*i]); \
|
|
76
|
-
lo = uint8_t(unbase64(c)); \
|
|
77
|
-
*i += 1; \
|
|
78
|
-
if (lo < 64) \
|
|
79
|
-
break; /* Legal character. */ \
|
|
80
|
-
if (c == '=' || *i >= srclen) \
|
|
81
|
-
return false; /* Stop decoding. */ \
|
|
82
|
-
} \
|
|
83
|
-
expr; \
|
|
84
|
-
if (*i >= srclen) \
|
|
85
|
-
return false; \
|
|
86
|
-
if (*k >= dstlen) \
|
|
87
|
-
return false; \
|
|
88
|
-
hi = lo;
|
|
89
|
-
V(/* Nothing. */);
|
|
90
|
-
V(dst[(*k)++] = char((hi & 0x3F) << 2) | ((lo & 0x30) >> 4));
|
|
91
|
-
V(dst[(*k)++] = char((hi & 0x0F) << 4) | ((lo & 0x3C) >> 2));
|
|
92
|
-
V(dst[(*k)++] = char((hi & 0x03) << 6) | ((lo & 0x3F) >> 0));
|
|
93
|
-
#undef V
|
|
94
|
-
return true; // Continue decoding.
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
#ifdef _MSC_VER
|
|
98
|
-
#pragma warning(pop)
|
|
99
|
-
#endif
|
|
100
|
-
|
|
101
|
-
template <typename TypeName>
|
|
102
|
-
size_t base64_decode_fast(char *const dst, const size_t dstlen,
|
|
103
|
-
const TypeName *const src, const size_t srclen,
|
|
104
|
-
const size_t decoded_size) {
|
|
105
|
-
const size_t available = dstlen < decoded_size ? dstlen : decoded_size;
|
|
106
|
-
const size_t max_k = available / 3 * 3;
|
|
107
|
-
size_t max_i = srclen / 4 * 4;
|
|
108
|
-
size_t i = 0;
|
|
109
|
-
size_t k = 0;
|
|
110
|
-
while (i < max_i && k < max_k) {
|
|
111
|
-
const unsigned char txt[] = {
|
|
112
|
-
static_cast<unsigned char>(unbase64(static_cast<uint8_t>(src[i + 0]))),
|
|
113
|
-
static_cast<unsigned char>(unbase64(static_cast<uint8_t>(src[i + 1]))),
|
|
114
|
-
static_cast<unsigned char>(unbase64(static_cast<uint8_t>(src[i + 2]))),
|
|
115
|
-
static_cast<unsigned char>(unbase64(static_cast<uint8_t>(src[i + 3]))),
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
const uint32_t v = ReadUint32BE(txt);
|
|
119
|
-
// If MSB is set, input contains whitespace or is not valid base64.
|
|
120
|
-
if (v & 0x80808080) {
|
|
121
|
-
if (!base64_decode_group_slow(dst, dstlen, src, srclen, &i, &k))
|
|
122
|
-
return k;
|
|
123
|
-
max_i = i + (srclen - i) / 4 * 4; // Align max_i again.
|
|
124
|
-
} else {
|
|
125
|
-
dst[k + 0] = char(((v >> 22) & 0xFC) | ((v >> 20) & 0x03));
|
|
126
|
-
dst[k + 1] = char(((v >> 12) & 0xF0) | ((v >> 10) & 0x0F));
|
|
127
|
-
dst[k + 2] = char(((v >> 2) & 0xC0) | ((v >> 0) & 0x3F));
|
|
128
|
-
i += 4;
|
|
129
|
-
k += 3;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
if (i < srclen && k < dstlen) {
|
|
133
|
-
base64_decode_group_slow(dst, dstlen, src, srclen, &i, &k);
|
|
134
|
-
}
|
|
135
|
-
return k;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
template <typename TypeName>
|
|
139
|
-
size_t base64_decoded_size(const TypeName *src, size_t size) {
|
|
140
|
-
// 1-byte input cannot be decoded
|
|
141
|
-
if (size < 2)
|
|
142
|
-
return 0;
|
|
143
|
-
|
|
144
|
-
if (src[size - 1] == '=') {
|
|
145
|
-
size--;
|
|
146
|
-
if (src[size - 1] == '=')
|
|
147
|
-
size--;
|
|
148
|
-
}
|
|
149
|
-
return base64_decoded_size_fast(size);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
template <typename TypeName>
|
|
153
|
-
size_t base64_decode(char *const dst, const size_t dstlen,
|
|
154
|
-
const TypeName *const src, const size_t srclen) {
|
|
155
|
-
const size_t decoded_size = base64_decoded_size(src, srclen);
|
|
156
|
-
return base64_decode_fast(dst, dstlen, src, srclen, decoded_size);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
template size_t base64_decode<char>(char *const dst, const size_t dstlen,
|
|
160
|
-
const char *const src, const size_t srclen);
|
|
161
|
-
|
|
162
|
-
static inline constexpr size_t
|
|
163
|
-
base64_encoded_size(size_t size, Base64Mode mode = Base64Mode::NORMAL) {
|
|
164
|
-
return mode == Base64Mode::NORMAL ? ((size + 2) / 3 * 4)
|
|
165
|
-
: static_cast<size_t>(std::ceil(
|
|
166
|
-
static_cast<double>(size * 4) / 3));
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
inline constexpr char base64_table_url[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
170
|
-
"abcdefghijklmnopqrstuvwxyz"
|
|
171
|
-
"0123456789-_";
|
|
172
|
-
|
|
173
|
-
inline constexpr char base64_table_normal[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
174
|
-
"abcdefghijklmnopqrstuvwxyz"
|
|
175
|
-
"0123456789+/";
|
|
176
|
-
inline size_t base64_encode(const char *src, size_t slen, char *dst,
|
|
177
|
-
size_t dlen, Base64Mode mode) {
|
|
178
|
-
|
|
179
|
-
dlen = base64_encoded_size(slen, mode);
|
|
180
|
-
|
|
181
|
-
unsigned a;
|
|
182
|
-
unsigned b;
|
|
183
|
-
unsigned c;
|
|
184
|
-
unsigned i;
|
|
185
|
-
unsigned k;
|
|
186
|
-
unsigned n;
|
|
187
|
-
|
|
188
|
-
const char *table =
|
|
189
|
-
(mode == Base64Mode::NORMAL) ? base64_table_normal : base64_table_url;
|
|
190
|
-
|
|
191
|
-
i = 0;
|
|
192
|
-
k = 0;
|
|
193
|
-
n = slen / 3 * 3;
|
|
194
|
-
|
|
195
|
-
while (i < n) {
|
|
196
|
-
a = src[i + 0] & 0xff;
|
|
197
|
-
b = src[i + 1] & 0xff;
|
|
198
|
-
c = src[i + 2] & 0xff;
|
|
199
|
-
|
|
200
|
-
dst[k + 0] = table[a >> 2];
|
|
201
|
-
dst[k + 1] = table[((a & 3) << 4) | (b >> 4)];
|
|
202
|
-
dst[k + 2] = table[((b & 0x0f) << 2) | (c >> 6)];
|
|
203
|
-
dst[k + 3] = table[c & 0x3f];
|
|
204
|
-
|
|
205
|
-
i += 3;
|
|
206
|
-
k += 4;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
switch (slen - n) {
|
|
210
|
-
case 1:
|
|
211
|
-
a = src[i + 0] & 0xff;
|
|
212
|
-
dst[k + 0] = table[a >> 2];
|
|
213
|
-
dst[k + 1] = table[(a & 3) << 4];
|
|
214
|
-
break;
|
|
215
|
-
case 2:
|
|
216
|
-
a = src[i + 0] & 0xff;
|
|
217
|
-
b = src[i + 1] & 0xff;
|
|
218
|
-
dst[k + 0] = table[a >> 2];
|
|
219
|
-
dst[k + 1] = table[((a & 3) << 4) | (b >> 4)];
|
|
220
|
-
dst[k + 2] = table[(b & 0x0f) << 2];
|
|
221
|
-
break;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
return dlen;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
} // namespace node
|
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
// Taken form OpenSSL 3.4-dev, for benchmarking purposes.
|
|
2
|
-
// See
|
|
3
|
-
// https://github.com/openssl/openssl/blob/0285160ffa3b8c2b5491222243042593808298c4/crypto/evp/encode.c#L303
|
|
4
|
-
// and
|
|
5
|
-
// https://github.com/openssl/openssl/blob/0285160ffa3b8c2b5491222243042593808298c4/include/openssl/evp.h#L871-L875
|
|
6
|
-
#include <cmath>
|
|
7
|
-
#include <cstddef>
|
|
8
|
-
#include <cstdint>
|
|
9
|
-
#include <cstdio>
|
|
10
|
-
namespace openssl3 {
|
|
11
|
-
struct evp_Encode_Ctx_st {
|
|
12
|
-
/* number saved in a partial encode/decode */
|
|
13
|
-
int num;
|
|
14
|
-
/*
|
|
15
|
-
* The length is either the output line length (in input bytes) or the
|
|
16
|
-
* shortest input line length that is ok. Once decoding begins, the
|
|
17
|
-
* length is adjusted up each time a longer line is decoded
|
|
18
|
-
*/
|
|
19
|
-
int length;
|
|
20
|
-
/* data to encode */
|
|
21
|
-
unsigned char enc_data[80];
|
|
22
|
-
/* number read on current line */
|
|
23
|
-
int line_num;
|
|
24
|
-
unsigned int flags;
|
|
25
|
-
};
|
|
26
|
-
typedef struct evp_Encode_Ctx_st EVP_ENCODE_CTX;
|
|
27
|
-
|
|
28
|
-
struct buf_mem_st {
|
|
29
|
-
size_t length; /* current number of bytes */
|
|
30
|
-
char *data;
|
|
31
|
-
size_t max; /* size of buffer */
|
|
32
|
-
unsigned long flags;
|
|
33
|
-
};
|
|
34
|
-
typedef struct buf_mem_st BUF_MEM;
|
|
35
|
-
|
|
36
|
-
static int evp_decodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t,
|
|
37
|
-
const unsigned char *f, int n);
|
|
38
|
-
|
|
39
|
-
template <typename TypeName>
|
|
40
|
-
size_t base64_decode(char *const dst, const size_t dstlen,
|
|
41
|
-
const TypeName *const src, const size_t srclen);
|
|
42
|
-
|
|
43
|
-
void EVP_DecodeInit(EVP_ENCODE_CTX *ctx);
|
|
44
|
-
|
|
45
|
-
int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
|
|
46
|
-
const unsigned char *in, int inl);
|
|
47
|
-
|
|
48
|
-
int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl);
|
|
49
|
-
} // namespace openssl3
|
|
50
|
-
|
|
51
|
-
namespace openssl3 {
|
|
52
|
-
//// Base 64 ////
|
|
53
|
-
|
|
54
|
-
#define EVP_ENCODE_CTX_USE_SRP_ALPHABET 2
|
|
55
|
-
|
|
56
|
-
#define B64_EOF 0xF2
|
|
57
|
-
#define B64_WS 0xE0
|
|
58
|
-
#define B64_ERROR 0xFF
|
|
59
|
-
#define B64_NOT_BASE64(a) (((a) | 0x13) == 0xF3)
|
|
60
|
-
#define B64_BASE64(a) (!B64_NOT_BASE64(a))
|
|
61
|
-
|
|
62
|
-
static const unsigned char data_ascii2bin[128 * 2] = {
|
|
63
|
-
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xF0, 0xFF,
|
|
64
|
-
0xFF, 0xF1, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
65
|
-
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF,
|
|
66
|
-
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3E, 0xFF, 0xF2, 0xFF, 0x3F,
|
|
67
|
-
0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0xFF, 0xFF,
|
|
68
|
-
0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
|
|
69
|
-
0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12,
|
|
70
|
-
0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
71
|
-
0xFF, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24,
|
|
72
|
-
0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30,
|
|
73
|
-
0x31, 0x32, 0x33, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
74
|
-
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
75
|
-
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
76
|
-
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
77
|
-
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
78
|
-
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
79
|
-
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
80
|
-
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
81
|
-
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
82
|
-
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
83
|
-
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
84
|
-
0xFF, 0xFF, 0xFF, 0xFF,
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
static const unsigned char srpdata_ascii2bin[128] = {
|
|
88
|
-
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xF0, 0xFF,
|
|
89
|
-
0xFF, 0xF1, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
90
|
-
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xFF, 0xFF, 0xFF,
|
|
91
|
-
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF2, 0x3E, 0x3F,
|
|
92
|
-
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0xFF, 0xFF,
|
|
93
|
-
0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
|
|
94
|
-
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C,
|
|
95
|
-
0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
96
|
-
0xFF, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E,
|
|
97
|
-
0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A,
|
|
98
|
-
0x3B, 0x3C, 0x3D, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
inline static unsigned char conv_ascii2bin(unsigned char a,
|
|
102
|
-
const unsigned char *table) {
|
|
103
|
-
if (a & 0x80)
|
|
104
|
-
return B64_ERROR;
|
|
105
|
-
return table[a];
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
void OPENSSL_die(const char *message, const char *file, int line) {
|
|
109
|
-
printf("%s:%d: OpenSSL internal error: %s\n", file, line, message);
|
|
110
|
-
abort();
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
#define OPENSSL_assert(e) \
|
|
114
|
-
(void)((e) ? 0 \
|
|
115
|
-
: (OPENSSL_die("assertion failed: " #e, __FILE__, __LINE__), 1))
|
|
116
|
-
|
|
117
|
-
void EVP_DecodeInit(EVP_ENCODE_CTX *ctx) {
|
|
118
|
-
/* Only ctx->num and ctx->flags are used during decoding. */
|
|
119
|
-
ctx->num = 0;
|
|
120
|
-
ctx->length = 0;
|
|
121
|
-
ctx->line_num = 0;
|
|
122
|
-
ctx->flags = 0;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/*-
|
|
126
|
-
* -1 for error
|
|
127
|
-
* 0 for last line
|
|
128
|
-
* 1 for full line
|
|
129
|
-
*
|
|
130
|
-
* Note: even though EVP_DecodeUpdate attempts to detect and report end of
|
|
131
|
-
* content, the context doesn't currently remember it and will accept more data
|
|
132
|
-
* in the next call. Therefore, the caller is responsible for checking and
|
|
133
|
-
* rejecting a 0 return value in the middle of content.
|
|
134
|
-
*
|
|
135
|
-
* Note: even though EVP_DecodeUpdate has historically tried to detect end of
|
|
136
|
-
* content based on line length, this has never worked properly. Therefore,
|
|
137
|
-
* we now return 0 when one of the following is true:
|
|
138
|
-
* - Padding or B64_EOF was detected and the last block is complete.
|
|
139
|
-
* - Input has zero-length.
|
|
140
|
-
* -1 is returned if:
|
|
141
|
-
* - Invalid characters are detected.
|
|
142
|
-
* - There is extra trailing padding, or data after padding.
|
|
143
|
-
* - B64_EOF is detected after an incomplete base64 block.
|
|
144
|
-
*/
|
|
145
|
-
int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
|
|
146
|
-
const unsigned char *in, int inl) {
|
|
147
|
-
int seof = 0, eof = 0, rv = -1, ret = 0, i, v, tmp, n, decoded_len;
|
|
148
|
-
unsigned char *d;
|
|
149
|
-
const unsigned char *table;
|
|
150
|
-
|
|
151
|
-
n = ctx->num;
|
|
152
|
-
d = ctx->enc_data;
|
|
153
|
-
|
|
154
|
-
if (n > 0 && d[n - 1] == '=') {
|
|
155
|
-
eof++;
|
|
156
|
-
if (n > 1 && d[n - 2] == '=')
|
|
157
|
-
eof++;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/* Legacy behaviour: an empty input chunk signals end of input. */
|
|
161
|
-
if (inl == 0) {
|
|
162
|
-
rv = 0;
|
|
163
|
-
goto end;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if ((ctx->flags & EVP_ENCODE_CTX_USE_SRP_ALPHABET) != 0)
|
|
167
|
-
table = srpdata_ascii2bin;
|
|
168
|
-
else
|
|
169
|
-
table = data_ascii2bin;
|
|
170
|
-
|
|
171
|
-
for (i = 0; i < inl; i++) {
|
|
172
|
-
tmp = *(in++);
|
|
173
|
-
v = conv_ascii2bin(tmp, table);
|
|
174
|
-
if (v == B64_ERROR) {
|
|
175
|
-
rv = -1;
|
|
176
|
-
goto end;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
if (tmp == '=') {
|
|
180
|
-
eof++;
|
|
181
|
-
} else if (eof > 0 && B64_BASE64(v)) {
|
|
182
|
-
/* More data after padding. */
|
|
183
|
-
rv = -1;
|
|
184
|
-
goto end;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
if (eof > 2) {
|
|
188
|
-
rv = -1;
|
|
189
|
-
goto end;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
if (v == B64_EOF) {
|
|
193
|
-
seof = 1;
|
|
194
|
-
goto tail;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/* Only save valid base64 characters. */
|
|
198
|
-
if (B64_BASE64(v)) {
|
|
199
|
-
if (n >= 64) {
|
|
200
|
-
/*
|
|
201
|
-
* We increment n once per loop, and empty the buffer as soon as
|
|
202
|
-
* we reach 64 characters, so this can only happen if someone's
|
|
203
|
-
* manually messed with the ctx. Refuse to write any more data.
|
|
204
|
-
*/
|
|
205
|
-
rv = -1;
|
|
206
|
-
goto end;
|
|
207
|
-
}
|
|
208
|
-
OPENSSL_assert(n < (int)sizeof(ctx->enc_data));
|
|
209
|
-
d[n++] = tmp;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
if (n == 64) {
|
|
213
|
-
decoded_len = evp_decodeblock_int(ctx, out, d, n);
|
|
214
|
-
n = 0;
|
|
215
|
-
if (decoded_len < 0 || eof > decoded_len) {
|
|
216
|
-
rv = -1;
|
|
217
|
-
goto end;
|
|
218
|
-
}
|
|
219
|
-
ret += decoded_len - eof;
|
|
220
|
-
out += decoded_len - eof;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
/*
|
|
225
|
-
* Legacy behaviour: if the current line is a full base64-block (i.e., has
|
|
226
|
-
* 0 mod 4 base64 characters), it is processed immediately. We keep this
|
|
227
|
-
* behaviour as applications may not be calling EVP_DecodeFinal properly.
|
|
228
|
-
*/
|
|
229
|
-
tail:
|
|
230
|
-
if (n > 0) {
|
|
231
|
-
if ((n & 3) == 0) {
|
|
232
|
-
decoded_len = evp_decodeblock_int(ctx, out, d, n);
|
|
233
|
-
n = 0;
|
|
234
|
-
if (decoded_len < 0 || eof > decoded_len) {
|
|
235
|
-
rv = -1;
|
|
236
|
-
goto end;
|
|
237
|
-
}
|
|
238
|
-
ret += (decoded_len - eof);
|
|
239
|
-
} else if (seof) {
|
|
240
|
-
/* EOF in the middle of a base64 block. */
|
|
241
|
-
rv = -1;
|
|
242
|
-
goto end;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
rv = seof || (n == 0 && eof) ? 0 : 1;
|
|
247
|
-
end:
|
|
248
|
-
/* Legacy behaviour. This should probably rather be zeroed on error. */
|
|
249
|
-
*outl = ret;
|
|
250
|
-
ctx->num = n;
|
|
251
|
-
return rv;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
// use mega SIMD fast base64 decode.
|
|
255
|
-
static int evp_decodeblock_int(EVP_ENCODE_CTX *ctx, unsigned char *t,
|
|
256
|
-
const unsigned char *f, int n) {
|
|
257
|
-
int i, ret = 0, a, b, c, d;
|
|
258
|
-
unsigned long l;
|
|
259
|
-
const unsigned char *table;
|
|
260
|
-
|
|
261
|
-
if (ctx != NULL && (ctx->flags & EVP_ENCODE_CTX_USE_SRP_ALPHABET) != 0)
|
|
262
|
-
table = srpdata_ascii2bin;
|
|
263
|
-
else
|
|
264
|
-
table = data_ascii2bin;
|
|
265
|
-
|
|
266
|
-
/* trim whitespace from the start of the line. */
|
|
267
|
-
while ((n > 0) && (conv_ascii2bin(*f, table) == B64_WS)) {
|
|
268
|
-
f++;
|
|
269
|
-
n--;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/*
|
|
273
|
-
* strip off stuff at the end of the line ascii2bin values B64_WS,
|
|
274
|
-
* B64_EOLN, B64_EOLN and B64_EOF
|
|
275
|
-
*/
|
|
276
|
-
while ((n > 3) && (B64_NOT_BASE64(conv_ascii2bin(f[n - 1], table))))
|
|
277
|
-
n--;
|
|
278
|
-
|
|
279
|
-
if (n % 4 != 0)
|
|
280
|
-
return -1;
|
|
281
|
-
|
|
282
|
-
for (i = 0; i < n; i += 4) {
|
|
283
|
-
a = conv_ascii2bin(*(f++), table);
|
|
284
|
-
b = conv_ascii2bin(*(f++), table);
|
|
285
|
-
c = conv_ascii2bin(*(f++), table);
|
|
286
|
-
d = conv_ascii2bin(*(f++), table);
|
|
287
|
-
if ((a & 0x80) || (b & 0x80) || (c & 0x80) || (d & 0x80))
|
|
288
|
-
return -1;
|
|
289
|
-
l = ((((unsigned long)a) << 18L) | (((unsigned long)b) << 12L) |
|
|
290
|
-
(((unsigned long)c) << 6L) | (((unsigned long)d)));
|
|
291
|
-
*(t++) = (unsigned char)(l >> 16L) & 0xff;
|
|
292
|
-
*(t++) = (unsigned char)(l >> 8L) & 0xff;
|
|
293
|
-
*(t++) = (unsigned char)(l) & 0xff;
|
|
294
|
-
ret += 3;
|
|
295
|
-
}
|
|
296
|
-
return ret;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl) {
|
|
300
|
-
int i;
|
|
301
|
-
|
|
302
|
-
*outl = 0;
|
|
303
|
-
if (ctx->num != 0) {
|
|
304
|
-
i = evp_decodeblock_int(ctx, out, ctx->enc_data, ctx->num);
|
|
305
|
-
if (i < 0)
|
|
306
|
-
return -1;
|
|
307
|
-
ctx->num = 0;
|
|
308
|
-
*outl = i;
|
|
309
|
-
return 1;
|
|
310
|
-
} else
|
|
311
|
-
return 1;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
template <typename TypeName>
|
|
315
|
-
size_t base64_decode(char *const dst, const size_t dstlen,
|
|
316
|
-
const TypeName *const src, const size_t srclen) {
|
|
317
|
-
EVP_ENCODE_CTX *ctx = new EVP_ENCODE_CTX();
|
|
318
|
-
int len = dstlen;
|
|
319
|
-
int taillen = 0;
|
|
320
|
-
|
|
321
|
-
EVP_DecodeInit(ctx);
|
|
322
|
-
if (EVP_DecodeUpdate(ctx, (unsigned char *)dst, &len, (unsigned char *)src,
|
|
323
|
-
srclen) < 0 ||
|
|
324
|
-
EVP_DecodeFinal(ctx, (unsigned char *)&(dst[len]), &taillen) < 0) {
|
|
325
|
-
fprintf(stderr, "Invalid input for openssl base64 decode.\n");
|
|
326
|
-
exit(1);
|
|
327
|
-
}
|
|
328
|
-
delete ctx;
|
|
329
|
-
|
|
330
|
-
len += taillen;
|
|
331
|
-
return len;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
} // namespace openssl3
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
#include "src/cmdline.h"
|
|
2
|
-
#include "src/benchmark.h"
|
|
3
|
-
|
|
4
|
-
#include <iostream>
|
|
5
|
-
|
|
6
|
-
void info_message() {
|
|
7
|
-
std::cout
|
|
8
|
-
<< "We define the number of bytes to be the number of *input* bytes.\n";
|
|
9
|
-
std::cout
|
|
10
|
-
<< "We define a 'char' to be a code point (between 1 and 4 bytes).\n";
|
|
11
|
-
#ifdef ICU_AVAILABLE
|
|
12
|
-
std::cout << "Using ICU version " << U_ICU_VERSION << std::endl;
|
|
13
|
-
#endif
|
|
14
|
-
#ifdef _LIBICONV_VERSION
|
|
15
|
-
std::cout << "Using iconv version " << _LIBICONV_VERSION << std::endl;
|
|
16
|
-
#endif
|
|
17
|
-
#if defined(__clang__)
|
|
18
|
-
std::cout << "Compiler: Clang " << __clang_major__ << "." << __clang_minor__
|
|
19
|
-
<< "." << __clang_patchlevel__ << "\n";
|
|
20
|
-
#elif defined(__GNUC__)
|
|
21
|
-
std::cout << "Compiler: GCC " << __GNUC__ << "." << __GNUC_MINOR__ << "."
|
|
22
|
-
<< __GNUC_PATCHLEVEL__ << "\n";
|
|
23
|
-
#elif defined(_MSC_VER)
|
|
24
|
-
std::cout << "Compiler: MSVC " << _MSC_VER << "\n";
|
|
25
|
-
#endif
|
|
26
|
-
std::cout << "SIMDUTF version: " << SIMDUTF_VERSION << "\n";
|
|
27
|
-
std::cout << "System: " << simdutf::get_active_implementation()->name()
|
|
28
|
-
<< "\n";
|
|
29
|
-
std::cout << "===========================\n";
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
int main(int argc, char *argv[]) {
|
|
33
|
-
#ifdef INOUE2008
|
|
34
|
-
inoue2008::inoue_test(); // minimal testing
|
|
35
|
-
#endif
|
|
36
|
-
using simdutf::benchmarks::CommandLine;
|
|
37
|
-
CommandLine cmdline;
|
|
38
|
-
try {
|
|
39
|
-
cmdline = CommandLine::parse_arguments(argc, argv);
|
|
40
|
-
if (cmdline.show_help) {
|
|
41
|
-
CommandLine::print_help();
|
|
42
|
-
return EXIT_SUCCESS;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (cmdline.empty()) {
|
|
46
|
-
CommandLine::print_help();
|
|
47
|
-
return EXIT_FAILURE;
|
|
48
|
-
}
|
|
49
|
-
} catch (const std::exception &e) {
|
|
50
|
-
printf("%s\n", e.what());
|
|
51
|
-
return EXIT_FAILURE;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
using simdutf::benchmarks::Benchmark;
|
|
55
|
-
using simdutf::benchmarks::ListingMode;
|
|
56
|
-
|
|
57
|
-
Benchmark benchmark{Benchmark::create(cmdline)};
|
|
58
|
-
if (cmdline.show_procedures != ListingMode::None) {
|
|
59
|
-
benchmark.list_procedures(cmdline.show_procedures);
|
|
60
|
-
return EXIT_SUCCESS;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
info_message();
|
|
64
|
-
return benchmark.run() ? EXIT_SUCCESS : EXIT_FAILURE;
|
|
65
|
-
}
|