@hxa-rn/react-native-quick-crypto 1.1.0-beta.1
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/LICENSE +21 -0
- package/README.md +171 -0
- package/dist/commonjs/argon2.js +39 -0
- package/dist/commonjs/argon2.js.map +1 -0
- package/dist/commonjs/blake3.js +106 -0
- package/dist/commonjs/blake3.js.map +1 -0
- package/dist/commonjs/certificate.js +35 -0
- package/dist/commonjs/certificate.js.map +1 -0
- package/dist/commonjs/cipher.js +202 -0
- package/dist/commonjs/cipher.js.map +1 -0
- package/dist/commonjs/constants.js +32 -0
- package/dist/commonjs/constants.js.map +1 -0
- package/dist/commonjs/dh-groups.js +29 -0
- package/dist/commonjs/dh-groups.js.map +1 -0
- package/dist/commonjs/dhKeyPair.js +113 -0
- package/dist/commonjs/dhKeyPair.js.map +1 -0
- package/dist/commonjs/diffie-hellman.js +155 -0
- package/dist/commonjs/diffie-hellman.js.map +1 -0
- package/dist/commonjs/dsa.js +96 -0
- package/dist/commonjs/dsa.js.map +1 -0
- package/dist/commonjs/ec.js +368 -0
- package/dist/commonjs/ec.js.map +1 -0
- package/dist/commonjs/ecdh.js +114 -0
- package/dist/commonjs/ecdh.js.map +1 -0
- package/dist/commonjs/ed.js +395 -0
- package/dist/commonjs/ed.js.map +1 -0
- package/dist/commonjs/expo-plugin/@types.js +2 -0
- package/dist/commonjs/expo-plugin/@types.js.map +1 -0
- package/dist/commonjs/expo-plugin/withRNQC.js +25 -0
- package/dist/commonjs/expo-plugin/withRNQC.js.map +1 -0
- package/dist/commonjs/expo-plugin/withSodiumAndroid.js +25 -0
- package/dist/commonjs/expo-plugin/withSodiumAndroid.js.map +1 -0
- package/dist/commonjs/expo-plugin/withSodiumIos.js +23 -0
- package/dist/commonjs/expo-plugin/withSodiumIos.js.map +1 -0
- package/dist/commonjs/expo-plugin/withXCode.js +51 -0
- package/dist/commonjs/expo-plugin/withXCode.js.map +1 -0
- package/dist/commonjs/hash.js +241 -0
- package/dist/commonjs/hash.js.map +1 -0
- package/dist/commonjs/hkdf.js +81 -0
- package/dist/commonjs/hkdf.js.map +1 -0
- package/dist/commonjs/hmac.js +121 -0
- package/dist/commonjs/hmac.js.map +1 -0
- package/dist/commonjs/index.js +358 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/keys/classes.js +272 -0
- package/dist/commonjs/keys/classes.js.map +1 -0
- package/dist/commonjs/keys/generateKeyPair.js +156 -0
- package/dist/commonjs/keys/generateKeyPair.js.map +1 -0
- package/dist/commonjs/keys/index.js +327 -0
- package/dist/commonjs/keys/index.js.map +1 -0
- package/dist/commonjs/keys/publicCipher.js +165 -0
- package/dist/commonjs/keys/publicCipher.js.map +1 -0
- package/dist/commonjs/keys/signVerify.js +225 -0
- package/dist/commonjs/keys/signVerify.js.map +1 -0
- package/dist/commonjs/keys/utils.js +123 -0
- package/dist/commonjs/keys/utils.js.map +1 -0
- package/dist/commonjs/mldsa.js +74 -0
- package/dist/commonjs/mldsa.js.map +1 -0
- package/dist/commonjs/mlkem.js +224 -0
- package/dist/commonjs/mlkem.js.map +1 -0
- package/dist/commonjs/pbkdf2.js +106 -0
- package/dist/commonjs/pbkdf2.js.map +1 -0
- package/dist/commonjs/prime.js +96 -0
- package/dist/commonjs/prime.js.map +1 -0
- package/dist/commonjs/random.js +233 -0
- package/dist/commonjs/random.js.map +1 -0
- package/dist/commonjs/rsa.js +207 -0
- package/dist/commonjs/rsa.js.map +1 -0
- package/dist/commonjs/scrypt.js +98 -0
- package/dist/commonjs/scrypt.js.map +1 -0
- package/dist/commonjs/specs/v1/NativeQuickCrypto.js +17 -0
- package/dist/commonjs/specs/v1/NativeQuickCrypto.js.map +1 -0
- package/dist/commonjs/specs/v1/argon2.nitro.js +6 -0
- package/dist/commonjs/specs/v1/argon2.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/blake3.nitro.js +6 -0
- package/dist/commonjs/specs/v1/blake3.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/certificate.nitro.js +6 -0
- package/dist/commonjs/specs/v1/certificate.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/cipher.nitro.js +6 -0
- package/dist/commonjs/specs/v1/cipher.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/dhKeyPair.nitro.js +6 -0
- package/dist/commonjs/specs/v1/dhKeyPair.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/diffie-hellman.nitro.js +6 -0
- package/dist/commonjs/specs/v1/diffie-hellman.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/dsaKeyPair.nitro.js +6 -0
- package/dist/commonjs/specs/v1/dsaKeyPair.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/ecKeyPair.nitro.js +6 -0
- package/dist/commonjs/specs/v1/ecKeyPair.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/ecdh.nitro.js +6 -0
- package/dist/commonjs/specs/v1/ecdh.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/edKeyPair.nitro.js +6 -0
- package/dist/commonjs/specs/v1/edKeyPair.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/hash.nitro.js +6 -0
- package/dist/commonjs/specs/v1/hash.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/hkdf.nitro.js +6 -0
- package/dist/commonjs/specs/v1/hkdf.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/hmac.nitro.js +6 -0
- package/dist/commonjs/specs/v1/hmac.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/keyObjectHandle.nitro.js +6 -0
- package/dist/commonjs/specs/v1/keyObjectHandle.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/kmac.nitro.js +6 -0
- package/dist/commonjs/specs/v1/kmac.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/mlDsaKeyPair.nitro.js +6 -0
- package/dist/commonjs/specs/v1/mlDsaKeyPair.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/mlKemKeyPair.nitro.js +6 -0
- package/dist/commonjs/specs/v1/mlKemKeyPair.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/pbkdf2.nitro.js +6 -0
- package/dist/commonjs/specs/v1/pbkdf2.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/prime.nitro.js +6 -0
- package/dist/commonjs/specs/v1/prime.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/random.nitro.js +6 -0
- package/dist/commonjs/specs/v1/random.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/rsaCipher.nitro.js +6 -0
- package/dist/commonjs/specs/v1/rsaCipher.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/rsaKeyPair.nitro.js +6 -0
- package/dist/commonjs/specs/v1/rsaKeyPair.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/scrypt.nitro.js +6 -0
- package/dist/commonjs/specs/v1/scrypt.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/sign.nitro.js +6 -0
- package/dist/commonjs/specs/v1/sign.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/utils.nitro.js +6 -0
- package/dist/commonjs/specs/v1/utils.nitro.js.map +1 -0
- package/dist/commonjs/specs/v1/x509certificate.nitro.js +6 -0
- package/dist/commonjs/specs/v1/x509certificate.nitro.js.map +1 -0
- package/dist/commonjs/subtle.js +1811 -0
- package/dist/commonjs/subtle.js.map +1 -0
- package/dist/commonjs/utils/cipher.js +64 -0
- package/dist/commonjs/utils/cipher.js.map +1 -0
- package/dist/commonjs/utils/conversion.js +181 -0
- package/dist/commonjs/utils/conversion.js.map +1 -0
- package/dist/commonjs/utils/errors.js +14 -0
- package/dist/commonjs/utils/errors.js.map +1 -0
- package/dist/commonjs/utils/hashnames.js +122 -0
- package/dist/commonjs/utils/hashnames.js.map +1 -0
- package/dist/commonjs/utils/index.js +83 -0
- package/dist/commonjs/utils/index.js.map +1 -0
- package/dist/commonjs/utils/noble.js +82 -0
- package/dist/commonjs/utils/noble.js.map +1 -0
- package/dist/commonjs/utils/timingSafeEqual.js +24 -0
- package/dist/commonjs/utils/timingSafeEqual.js.map +1 -0
- package/dist/commonjs/utils/types.js +55 -0
- package/dist/commonjs/utils/types.js.map +1 -0
- package/dist/commonjs/utils/validation.js +98 -0
- package/dist/commonjs/utils/validation.js.map +1 -0
- package/dist/commonjs/x509certificate.js +193 -0
- package/dist/commonjs/x509certificate.js.map +1 -0
- package/dist/module/argon2.js +32 -0
- package/dist/module/argon2.js.map +1 -0
- package/dist/module/blake3.js +96 -0
- package/dist/module/blake3.js.map +1 -0
- package/dist/module/certificate.js +28 -0
- package/dist/module/certificate.js.map +1 -0
- package/dist/module/cipher.js +194 -0
- package/dist/module/cipher.js.map +1 -0
- package/dist/module/constants.js +26 -0
- package/dist/module/constants.js.map +1 -0
- package/dist/module/dh-groups.js +23 -0
- package/dist/module/dh-groups.js.map +1 -0
- package/dist/module/dhKeyPair.js +104 -0
- package/dist/module/dhKeyPair.js.map +1 -0
- package/dist/module/diffie-hellman.js +147 -0
- package/dist/module/diffie-hellman.js.map +1 -0
- package/dist/module/dsa.js +87 -0
- package/dist/module/dsa.js.map +1 -0
- package/dist/module/ec.js +354 -0
- package/dist/module/ec.js.map +1 -0
- package/dist/module/ecdh.js +106 -0
- package/dist/module/ecdh.js.map +1 -0
- package/dist/module/ed.js +383 -0
- package/dist/module/ed.js.map +1 -0
- package/dist/module/expo-plugin/@types.js +2 -0
- package/dist/module/expo-plugin/@types.js.map +1 -0
- package/dist/module/expo-plugin/withRNQC.js +19 -0
- package/dist/module/expo-plugin/withRNQC.js.map +1 -0
- package/dist/module/expo-plugin/withSodiumAndroid.js +18 -0
- package/dist/module/expo-plugin/withSodiumAndroid.js.map +1 -0
- package/dist/module/expo-plugin/withSodiumIos.js +15 -0
- package/dist/module/expo-plugin/withSodiumIos.js.map +1 -0
- package/dist/module/expo-plugin/withXCode.js +44 -0
- package/dist/module/expo-plugin/withXCode.js.map +1 -0
- package/dist/module/hash.js +230 -0
- package/dist/module/hash.js.map +1 -0
- package/dist/module/hkdf.js +73 -0
- package/dist/module/hkdf.js.map +1 -0
- package/dist/module/hmac.js +114 -0
- package/dist/module/hmac.js.map +1 -0
- package/dist/module/index.js +134 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/keys/classes.js +261 -0
- package/dist/module/keys/classes.js.map +1 -0
- package/dist/module/keys/generateKeyPair.js +148 -0
- package/dist/module/keys/generateKeyPair.js.map +1 -0
- package/dist/module/keys/index.js +190 -0
- package/dist/module/keys/index.js.map +1 -0
- package/dist/module/keys/publicCipher.js +156 -0
- package/dist/module/keys/publicCipher.js.map +1 -0
- package/dist/module/keys/signVerify.js +213 -0
- package/dist/module/keys/signVerify.js.map +1 -0
- package/dist/module/keys/utils.js +112 -0
- package/dist/module/keys/utils.js.map +1 -0
- package/dist/module/mldsa.js +66 -0
- package/dist/module/mldsa.js.map +1 -0
- package/dist/module/mlkem.js +214 -0
- package/dist/module/mlkem.js.map +1 -0
- package/dist/module/pbkdf2.js +98 -0
- package/dist/module/pbkdf2.js.map +1 -0
- package/dist/module/prime.js +87 -0
- package/dist/module/prime.js.map +1 -0
- package/dist/module/random.js +220 -0
- package/dist/module/random.js.map +1 -0
- package/dist/module/rsa.js +197 -0
- package/dist/module/rsa.js.map +1 -0
- package/dist/module/scrypt.js +91 -0
- package/dist/module/scrypt.js.map +1 -0
- package/dist/module/specs/v1/NativeQuickCrypto.js +13 -0
- package/dist/module/specs/v1/NativeQuickCrypto.js.map +1 -0
- package/dist/module/specs/v1/argon2.nitro.js +2 -0
- package/dist/module/specs/v1/argon2.nitro.js.map +1 -0
- package/dist/module/specs/v1/blake3.nitro.js +2 -0
- package/dist/module/specs/v1/blake3.nitro.js.map +1 -0
- package/dist/module/specs/v1/certificate.nitro.js +2 -0
- package/dist/module/specs/v1/certificate.nitro.js.map +1 -0
- package/dist/module/specs/v1/cipher.nitro.js +2 -0
- package/dist/module/specs/v1/cipher.nitro.js.map +1 -0
- package/dist/module/specs/v1/dhKeyPair.nitro.js +2 -0
- package/dist/module/specs/v1/dhKeyPair.nitro.js.map +1 -0
- package/dist/module/specs/v1/diffie-hellman.nitro.js +2 -0
- package/dist/module/specs/v1/diffie-hellman.nitro.js.map +1 -0
- package/dist/module/specs/v1/dsaKeyPair.nitro.js +2 -0
- package/dist/module/specs/v1/dsaKeyPair.nitro.js.map +1 -0
- package/dist/module/specs/v1/ecKeyPair.nitro.js +2 -0
- package/dist/module/specs/v1/ecKeyPair.nitro.js.map +1 -0
- package/dist/module/specs/v1/ecdh.nitro.js +2 -0
- package/dist/module/specs/v1/ecdh.nitro.js.map +1 -0
- package/dist/module/specs/v1/edKeyPair.nitro.js +2 -0
- package/dist/module/specs/v1/edKeyPair.nitro.js.map +1 -0
- package/dist/module/specs/v1/hash.nitro.js +2 -0
- package/dist/module/specs/v1/hash.nitro.js.map +1 -0
- package/dist/module/specs/v1/hkdf.nitro.js +2 -0
- package/dist/module/specs/v1/hkdf.nitro.js.map +1 -0
- package/dist/module/specs/v1/hmac.nitro.js +2 -0
- package/dist/module/specs/v1/hmac.nitro.js.map +1 -0
- package/dist/module/specs/v1/keyObjectHandle.nitro.js +2 -0
- package/dist/module/specs/v1/keyObjectHandle.nitro.js.map +1 -0
- package/dist/module/specs/v1/kmac.nitro.js +2 -0
- package/dist/module/specs/v1/kmac.nitro.js.map +1 -0
- package/dist/module/specs/v1/mlDsaKeyPair.nitro.js +2 -0
- package/dist/module/specs/v1/mlDsaKeyPair.nitro.js.map +1 -0
- package/dist/module/specs/v1/mlKemKeyPair.nitro.js +2 -0
- package/dist/module/specs/v1/mlKemKeyPair.nitro.js.map +1 -0
- package/dist/module/specs/v1/pbkdf2.nitro.js +2 -0
- package/dist/module/specs/v1/pbkdf2.nitro.js.map +1 -0
- package/dist/module/specs/v1/prime.nitro.js +2 -0
- package/dist/module/specs/v1/prime.nitro.js.map +1 -0
- package/dist/module/specs/v1/random.nitro.js +2 -0
- package/dist/module/specs/v1/random.nitro.js.map +1 -0
- package/dist/module/specs/v1/rsaCipher.nitro.js +2 -0
- package/dist/module/specs/v1/rsaCipher.nitro.js.map +1 -0
- package/dist/module/specs/v1/rsaKeyPair.nitro.js +2 -0
- package/dist/module/specs/v1/rsaKeyPair.nitro.js.map +1 -0
- package/dist/module/specs/v1/scrypt.nitro.js +2 -0
- package/dist/module/specs/v1/scrypt.nitro.js.map +1 -0
- package/dist/module/specs/v1/sign.nitro.js +2 -0
- package/dist/module/specs/v1/sign.nitro.js.map +1 -0
- package/dist/module/specs/v1/utils.nitro.js +2 -0
- package/dist/module/specs/v1/utils.nitro.js.map +1 -0
- package/dist/module/specs/v1/x509certificate.nitro.js +2 -0
- package/dist/module/specs/v1/x509certificate.nitro.js.map +1 -0
- package/dist/module/subtle.js +1803 -0
- package/dist/module/subtle.js.map +1 -0
- package/dist/module/utils/cipher.js +54 -0
- package/dist/module/utils/cipher.js.map +1 -0
- package/dist/module/utils/conversion.js +146 -0
- package/dist/module/utils/conversion.js.map +1 -0
- package/dist/module/utils/errors.js +8 -0
- package/dist/module/utils/errors.js.map +1 -0
- package/dist/module/utils/hashnames.js +118 -0
- package/dist/module/utils/hashnames.js.map +1 -0
- package/dist/module/utils/index.js +8 -0
- package/dist/module/utils/index.js.map +1 -0
- package/dist/module/utils/noble.js +74 -0
- package/dist/module/utils/noble.js.map +1 -0
- package/dist/module/utils/timingSafeEqual.js +18 -0
- package/dist/module/utils/timingSafeEqual.js.map +1 -0
- package/dist/module/utils/types.js +55 -0
- package/dist/module/utils/types.js.map +1 -0
- package/dist/module/utils/validation.js +85 -0
- package/dist/module/utils/validation.js.map +1 -0
- package/dist/module/x509certificate.js +186 -0
- package/dist/module/x509certificate.js.map +1 -0
- package/dist/typescript/argon2.d.ts +15 -0
- package/dist/typescript/blake3.d.ts +32 -0
- package/dist/typescript/certificate.d.ts +7 -0
- package/dist/typescript/cipher.d.ts +74 -0
- package/dist/typescript/constants.d.ts +20 -0
- package/dist/typescript/dh-groups.d.ts +4 -0
- package/dist/typescript/dhKeyPair.d.ts +18 -0
- package/dist/typescript/diffie-hellman.d.ts +17 -0
- package/dist/typescript/dsa.d.ts +18 -0
- package/dist/typescript/ec.d.ts +23 -0
- package/dist/typescript/ecdh.d.ts +18 -0
- package/dist/typescript/ed.d.ts +46 -0
- package/dist/typescript/hash.d.ts +125 -0
- package/dist/typescript/hkdf.d.ts +21 -0
- package/dist/typescript/hmac.d.ts +65 -0
- package/dist/typescript/index.d.ts +224 -0
- package/dist/typescript/keys/classes.d.ts +85 -0
- package/dist/typescript/keys/generateKeyPair.d.ts +5 -0
- package/dist/typescript/keys/index.d.ts +23 -0
- package/dist/typescript/keys/publicCipher.d.ts +22 -0
- package/dist/typescript/keys/signVerify.d.ts +34 -0
- package/dist/typescript/keys/utils.d.ts +33 -0
- package/dist/typescript/mldsa.d.ts +17 -0
- package/dist/typescript/mlkem.d.ts +29 -0
- package/dist/typescript/pbkdf2.d.ts +11 -0
- package/dist/typescript/prime.d.ts +18 -0
- package/dist/typescript/random.d.ts +26 -0
- package/dist/typescript/rsa.d.ts +19 -0
- package/dist/typescript/scrypt.d.ts +17 -0
- package/dist/typescript/specs/v1/NativeQuickCrypto.d.ts +17 -0
- package/dist/typescript/specs/v1/argon2.nitro.d.ts +8 -0
- package/dist/typescript/specs/v1/blake3.nitro.d.ts +14 -0
- package/dist/typescript/specs/v1/certificate.nitro.d.ts +9 -0
- package/dist/typescript/specs/v1/cipher.nitro.d.ts +37 -0
- package/dist/typescript/specs/v1/dhKeyPair.nitro.d.ts +13 -0
- package/dist/typescript/specs/v1/diffie-hellman.nitro.d.ts +17 -0
- package/dist/typescript/specs/v1/dsaKeyPair.nitro.d.ts +12 -0
- package/dist/typescript/specs/v1/ecKeyPair.nitro.d.ts +20 -0
- package/dist/typescript/specs/v1/ecdh.nitro.d.ts +14 -0
- package/dist/typescript/specs/v1/edKeyPair.nitro.d.ts +16 -0
- package/dist/typescript/specs/v1/hash.nitro.d.ts +12 -0
- package/dist/typescript/specs/v1/hkdf.nitro.d.ts +8 -0
- package/dist/typescript/specs/v1/hmac.nitro.d.ts +9 -0
- package/dist/typescript/specs/v1/keyObjectHandle.nitro.d.ts +17 -0
- package/dist/typescript/specs/v1/kmac.nitro.d.ts +9 -0
- package/dist/typescript/specs/v1/mlDsaKeyPair.nitro.d.ts +15 -0
- package/dist/typescript/specs/v1/mlKemKeyPair.nitro.d.ts +17 -0
- package/dist/typescript/specs/v1/pbkdf2.nitro.d.ts +8 -0
- package/dist/typescript/specs/v1/prime.nitro.d.ts +10 -0
- package/dist/typescript/specs/v1/random.nitro.d.ts +8 -0
- package/dist/typescript/specs/v1/rsaCipher.nitro.d.ts +53 -0
- package/dist/typescript/specs/v1/rsaKeyPair.nitro.d.ts +19 -0
- package/dist/typescript/specs/v1/scrypt.nitro.d.ts +8 -0
- package/dist/typescript/specs/v1/sign.nitro.d.ts +18 -0
- package/dist/typescript/specs/v1/utils.nitro.d.ts +9 -0
- package/dist/typescript/specs/v1/x509certificate.nitro.d.ts +33 -0
- package/dist/typescript/subtle.d.ts +31 -0
- package/dist/typescript/utils/cipher.d.ts +6 -0
- package/dist/typescript/utils/conversion.d.ts +29 -0
- package/dist/typescript/utils/errors.d.ts +6 -0
- package/dist/typescript/utils/hashnames.d.ts +12 -0
- package/dist/typescript/utils/index.d.ts +7 -0
- package/dist/typescript/utils/noble.d.ts +18 -0
- package/dist/typescript/utils/timingSafeEqual.d.ts +2 -0
- package/dist/typescript/utils/types.d.ts +294 -0
- package/dist/typescript/utils/validation.d.ts +12 -0
- package/dist/typescript/x509certificate.d.ts +63 -0
- package/harmony/quick_crypto/LICENSE +21 -0
- package/harmony/quick_crypto/NOTICE +33 -0
- package/harmony/quick_crypto/OAT.xml +38 -0
- package/harmony/quick_crypto/build-profile.json5 +16 -0
- package/harmony/quick_crypto/deps/blake3/blake3.c +650 -0
- package/harmony/quick_crypto/deps/blake3/blake3.h +86 -0
- package/harmony/quick_crypto/deps/blake3/blake3_avx2.c +326 -0
- package/harmony/quick_crypto/deps/blake3/blake3_avx512.c +1388 -0
- package/harmony/quick_crypto/deps/blake3/blake3_dispatch.c +332 -0
- package/harmony/quick_crypto/deps/blake3/blake3_impl.h +333 -0
- package/harmony/quick_crypto/deps/blake3/blake3_neon.c +366 -0
- package/harmony/quick_crypto/deps/blake3/blake3_portable.c +160 -0
- package/harmony/quick_crypto/deps/blake3/blake3_sse2.c +566 -0
- package/harmony/quick_crypto/deps/blake3/blake3_sse41.c +560 -0
- package/harmony/quick_crypto/deps/blake3/example.c +36 -0
- package/harmony/quick_crypto/deps/blake3/example_tbb.c +57 -0
- package/harmony/quick_crypto/deps/blake3/main.c +166 -0
- package/harmony/quick_crypto/deps/fastpbkdf2/fastpbkdf2.c +356 -0
- package/harmony/quick_crypto/deps/fastpbkdf2/fastpbkdf2.h +68 -0
- package/harmony/quick_crypto/deps/ncrypto/include/dh-primes.h +67 -0
- package/harmony/quick_crypto/deps/ncrypto/include/ncrypto/aead.h +137 -0
- package/harmony/quick_crypto/deps/ncrypto/include/ncrypto/version.h +14 -0
- package/harmony/quick_crypto/deps/ncrypto/include/ncrypto.h +1752 -0
- package/harmony/quick_crypto/deps/ncrypto/src/aead.cpp +302 -0
- package/harmony/quick_crypto/deps/ncrypto/src/engine.cpp +93 -0
- package/harmony/quick_crypto/deps/ncrypto/src/ncrypto.cpp +5331 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/avx512.h +79 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/base64_implementation.h +158 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/base64_tables.h +887 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/common_defs.h +186 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/compiler_check.h +50 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/constexpr_ptr.h +138 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/encoding_types.h +189 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/error.h +126 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/implementation.h +7081 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/internal/isadetection.h +325 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/portability.h +285 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/ascii.h +86 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/atomic_util.h +105 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/base64.h +911 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/latin1.h +26 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/latin1_to_utf16/latin1_to_utf16.h +52 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/latin1_to_utf32/latin1_to_utf32.h +27 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/latin1_to_utf8/latin1_to_utf8.h +191 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/swap_bytes.h +35 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf16.h +226 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf16_to_latin1/utf16_to_latin1.h +108 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf16_to_latin1/valid_utf16_to_latin1.h +40 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf16_to_utf32/utf16_to_utf32.h +86 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf16_to_utf32/valid_utf16_to_utf32.h +44 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf16_to_utf8/utf16_to_utf8.h +295 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf16_to_utf8/valid_utf16_to_utf8.h +91 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf32.h +82 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf32_to_latin1/utf32_to_latin1.h +68 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf32_to_latin1/valid_utf32_to_latin1.h +67 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf32_to_utf16/utf32_to_utf16.h +84 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf32_to_utf16/valid_utf32_to_utf16.h +44 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf32_to_utf8/utf32_to_utf8.h +142 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf32_to_utf8/valid_utf32_to_utf8.h +72 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf8.h +326 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf8_to_latin1/utf8_to_latin1.h +225 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf8_to_latin1/valid_utf8_to_latin1.h +87 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf8_to_utf16/utf8_to_utf16.h +342 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf8_to_utf16/valid_utf8_to_utf16.h +106 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf8_to_utf32/utf8_to_utf32.h +299 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/scalar/utf8_to_utf32/valid_utf8_to_utf32.h +83 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf/simdutf_version.h +26 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf.h +26 -0
- package/harmony/quick_crypto/deps/simdutf/include/simdutf_c.h +342 -0
- package/harmony/quick_crypto/deps/simdutf/src/CMakeLists.txt +78 -0
- package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_base64.cpp +791 -0
- package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_latin1_to_utf16.cpp +24 -0
- package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_latin1_to_utf32.cpp +24 -0
- package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_latin1_to_utf8.cpp +70 -0
- package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_utf16_to_latin1.cpp +61 -0
- package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_utf16_to_utf32.cpp +185 -0
- package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_utf16_to_utf8.cpp +780 -0
- package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_utf32_to_latin1.cpp +60 -0
- package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_utf32_to_utf16.cpp +208 -0
- package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_utf32_to_utf8.cpp +505 -0
- package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_utf8_to_latin1.cpp +69 -0
- package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_utf8_to_utf16.cpp +313 -0
- package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_convert_utf8_to_utf32.cpp +179 -0
- package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_find.cpp +199 -0
- package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_utf16fix.cpp +185 -0
- package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_validate_utf16.cpp +165 -0
- package/harmony/quick_crypto/deps/simdutf/src/arm64/arm_validate_utf32le.cpp +65 -0
- package/harmony/quick_crypto/deps/simdutf/src/arm64/implementation.cpp +1442 -0
- package/harmony/quick_crypto/deps/simdutf/src/encoding_types.cpp +67 -0
- package/harmony/quick_crypto/deps/simdutf/src/error.cpp +3 -0
- package/harmony/quick_crypto/deps/simdutf/src/fallback/implementation.cpp +589 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/ascii_validation.h +50 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/base64.h +233 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/base64lengths.h +63 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/buf_block_reader.h +109 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/find.h +75 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/utf16/change_endianness.h +24 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/utf16/count_code_points_bytemask.h +58 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/utf16/to_well_formed.h +93 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/utf16/utf32_length_from_utf16.h +15 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/utf16/utf8_length_from_utf16.h +35 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/utf16/utf8_length_from_utf16_bytemask.h +199 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/utf16.h +73 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/utf32.h +136 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/utf8/utf16_length_from_utf8_bytemask.h +53 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/utf8.h +92 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/utf8_to_latin1/utf8_to_latin1.h +316 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/utf8_to_latin1/valid_utf8_to_latin1.h +78 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/utf8_to_utf16/utf8_to_utf16.h +332 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/utf8_to_utf16/valid_utf8_to_utf16.h +74 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/utf8_to_utf32/utf8_to_utf32.h +318 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/utf8_to_utf32/valid_utf8_to_utf32.h +42 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/utf8_validation/utf8_lookup4_algorithm.h +223 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/utf8_validation/utf8_validator.h +84 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/validate_utf16.h +164 -0
- package/harmony/quick_crypto/deps/simdutf/src/generic/validate_utf32.h +99 -0
- package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_base64.cpp +837 -0
- package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_latin1_to_utf16.cpp +28 -0
- package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_latin1_to_utf32.cpp +20 -0
- package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_latin1_to_utf8.cpp +83 -0
- package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_utf16_to_latin1.cpp +83 -0
- package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_utf16_to_utf32.cpp +210 -0
- package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_utf16_to_utf8.cpp +602 -0
- package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_utf32_to_latin1.cpp +116 -0
- package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_utf32_to_utf16.cpp +164 -0
- package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_utf32_to_utf8.cpp +569 -0
- package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_utf8_to_latin1.cpp +60 -0
- package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_utf8_to_utf16.cpp +195 -0
- package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_convert_utf8_to_utf32.cpp +135 -0
- package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_utf16fix.cpp +173 -0
- package/harmony/quick_crypto/deps/simdutf/src/haswell/avx2_validate_utf16.cpp +17 -0
- package/harmony/quick_crypto/deps/simdutf/src/haswell/implementation.cpp +1447 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_ascii_validation.inl.cpp +19 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_base64.inl.cpp +630 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_common.inl.cpp +37 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_latin1_to_utf16.inl.cpp +36 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_latin1_to_utf32.inl.cpp +23 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_latin1_to_utf8.inl.cpp +107 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_utf16_to_latin1.inl.cpp +103 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_utf16_to_utf32.inl.cpp +136 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_utf16_to_utf8.inl.cpp +206 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_utf32_to_latin1.inl.cpp +74 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_utf32_to_utf16.inl.cpp +338 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_utf32_to_utf8.inl.cpp +574 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_utf8_to_latin1.inl.cpp +104 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_utf8_to_utf16.inl.cpp +75 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_convert_valid_utf8_to_latin1.inl.cpp +69 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_find.inl.cpp +146 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_from_utf8.inl.cpp +266 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_from_valid_utf8.inl.cpp +136 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_macros.inl.cpp +143 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_utf16fix.cpp +138 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_utf32_validation.inl.cpp +63 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_utf8_common.inl.cpp +753 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_utf8_length_from_utf16.inl.cpp +269 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/icelake_utf8_validation.inl.cpp +116 -0
- package/harmony/quick_crypto/deps/simdutf/src/icelake/implementation.cpp +1903 -0
- package/harmony/quick_crypto/deps/simdutf/src/implementation.cpp +2526 -0
- package/harmony/quick_crypto/deps/simdutf/src/lasx/implementation.cpp +1531 -0
- package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_base64.cpp +695 -0
- package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_latin1_to_utf16.cpp +76 -0
- package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_latin1_to_utf32.cpp +55 -0
- package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_latin1_to_utf8.cpp +65 -0
- package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_utf16_to_latin1.cpp +64 -0
- package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_utf16_to_utf32.cpp +183 -0
- package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_utf16_to_utf8.cpp +550 -0
- package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_utf32_to_latin1.cpp +73 -0
- package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_utf32_to_utf16.cpp +218 -0
- package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_utf32_to_utf8.cpp +589 -0
- package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_utf8_to_latin1.cpp +72 -0
- package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_utf8_to_utf16.cpp +296 -0
- package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_convert_utf8_to_utf32.cpp +190 -0
- package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_find.cpp +64 -0
- package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_validate_utf16.cpp +13 -0
- package/harmony/quick_crypto/deps/simdutf/src/lasx/lasx_validate_utf32le.cpp +84 -0
- package/harmony/quick_crypto/deps/simdutf/src/lsx/implementation.cpp +1417 -0
- package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_base64.cpp +675 -0
- package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_latin1_to_utf16.cpp +39 -0
- package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_latin1_to_utf32.cpp +27 -0
- package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_latin1_to_utf8.cpp +56 -0
- package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_utf16_to_latin1.cpp +64 -0
- package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_utf16_to_utf32.cpp +133 -0
- package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_utf16_to_utf8.cpp +518 -0
- package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_utf32_to_latin1.cpp +66 -0
- package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_utf32_to_utf16.cpp +155 -0
- package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_utf32_to_utf8.cpp +459 -0
- package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_utf8_to_latin1.cpp +75 -0
- package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_utf8_to_utf16.cpp +291 -0
- package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_convert_utf8_to_utf32.cpp +179 -0
- package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_find.cpp +60 -0
- package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_validate_utf16.cpp +13 -0
- package/harmony/quick_crypto/deps/simdutf/src/lsx/lsx_validate_utf32le.cpp +68 -0
- package/harmony/quick_crypto/deps/simdutf/src/ppc64/implementation.cpp +992 -0
- package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_base64.cpp +480 -0
- package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_base64_internal_tests.cpp +401 -0
- package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_latin1_to_utf16.cpp +12 -0
- package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_latin1_to_utf32.cpp +12 -0
- package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_latin1_to_utf8.cpp +149 -0
- package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_utf16_to_latin1.cpp +67 -0
- package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_utf16_to_utf32.cpp +87 -0
- package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_utf16_to_utf8.cpp +296 -0
- package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_utf32_to_latin1.cpp +57 -0
- package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_utf32_to_utf16.cpp +117 -0
- package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_utf32_to_utf8.cpp +166 -0
- package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_utf8_to_latin1.cpp +69 -0
- package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_utf8_to_utf16.cpp +211 -0
- package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_convert_utf8_to_utf32.cpp +153 -0
- package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_utf16_to_utf8_tables.h +1011 -0
- package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_utf8_length_from_latin1.cpp +37 -0
- package/harmony/quick_crypto/deps/simdutf/src/ppc64/ppc64_validate_utf16.cpp +19 -0
- package/harmony/quick_crypto/deps/simdutf/src/ppc64/templates.cpp +91 -0
- package/harmony/quick_crypto/deps/simdutf/src/rvv/implementation.cpp +138 -0
- package/harmony/quick_crypto/deps/simdutf/src/rvv/rvv_find.cpp +27 -0
- package/harmony/quick_crypto/deps/simdutf/src/rvv/rvv_helpers.inl.cpp +23 -0
- package/harmony/quick_crypto/deps/simdutf/src/rvv/rvv_latin1_to.inl.cpp +71 -0
- package/harmony/quick_crypto/deps/simdutf/src/rvv/rvv_length_from.inl.cpp +164 -0
- package/harmony/quick_crypto/deps/simdutf/src/rvv/rvv_utf16_to.inl.cpp +399 -0
- package/harmony/quick_crypto/deps/simdutf/src/rvv/rvv_utf16fix.cpp +110 -0
- package/harmony/quick_crypto/deps/simdutf/src/rvv/rvv_utf32_to.inl.cpp +307 -0
- package/harmony/quick_crypto/deps/simdutf/src/rvv/rvv_utf8_to.inl.cpp +435 -0
- package/harmony/quick_crypto/deps/simdutf/src/rvv/rvv_validate.inl.cpp +275 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64/begin.h +2 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64/bitmanipulation.h +34 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64/end.h +2 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64/implementation.h +307 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64/intrinsics.h +10 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64/simd.h +547 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64/simd16-inl.h +403 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64/simd32-inl.h +129 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64/simd64-inl.h +28 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/arm64.h +43 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/fallback/begin.h +1 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/fallback/bitmanipulation.h +13 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/fallback/end.h +1 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/fallback/implementation.h +331 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/fallback.h +42 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell/begin.h +15 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell/bitmanipulation.h +35 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell/end.h +13 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell/implementation.h +338 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell/intrinsics.h +67 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell/simd.h +363 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell/simd16-inl.h +261 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell/simd32-inl.h +111 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell/simd64-inl.h +34 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/haswell.h +63 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/icelake/begin.h +14 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/icelake/bitmanipulation.h +44 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/icelake/end.h +12 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/icelake/implementation.h +346 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/icelake/intrinsics.h +138 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/icelake/simd.h +17 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/icelake/simd16-inl.h +90 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/icelake/simd32-inl.h +47 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/icelake.h +81 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx/begin.h +8 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx/bitmanipulation.h +25 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx/end.h +8 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx/implementation.h +310 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx/intrinsics.h +319 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx/simd.h +551 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx/simd16-inl.h +234 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx/simd32-inl.h +74 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx/simd64-inl.h +52 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lasx.h +49 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx/begin.h +2 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx/bitmanipulation.h +25 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx/end.h +2 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx/implementation.h +309 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx/intrinsics.h +196 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx/simd.h +421 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx/simd16-inl.h +242 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx/simd32-inl.h +69 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx/simd64-inl.h +50 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/lsx.h +52 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64/begin.h +1 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64/bitmanipulation.h +29 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64/end.h +1 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64/implementation.h +348 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64/intrinsics.h +19 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64/simd.h +177 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64/simd16-inl.h +327 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64/simd32-inl.h +247 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64/simd8-inl.h +618 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/ppc64.h +40 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/rvv/begin.h +7 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/rvv/end.h +7 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/rvv/implementation.h +321 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/rvv/intrinsics.h +131 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/rvv.h +41 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere/begin.h +8 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere/bitmanipulation.h +37 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere/end.h +8 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere/implementation.h +338 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere/intrinsics.h +38 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere/simd.h +379 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere/simd16-inl.h +242 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere/simd32-inl.h +151 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere/simd64-inl.h +33 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf/westmere.h +59 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf.cpp +152 -0
- package/harmony/quick_crypto/deps/simdutf/src/simdutf_c.cpp +525 -0
- package/harmony/quick_crypto/deps/simdutf/src/tables/utf16_to_utf8_tables.h +768 -0
- package/harmony/quick_crypto/deps/simdutf/src/tables/utf32_to_utf16_tables.h +53 -0
- package/harmony/quick_crypto/deps/simdutf/src/tables/utf8_to_utf16_tables.h +826 -0
- package/harmony/quick_crypto/deps/simdutf/src/westmere/implementation.cpp +1479 -0
- package/harmony/quick_crypto/deps/simdutf/src/westmere/internal/loader.cpp +7 -0
- package/harmony/quick_crypto/deps/simdutf/src/westmere/internal/write_v_u16_11bits_to_utf8.cpp +66 -0
- package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_base64.cpp +672 -0
- package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_latin1_to_utf16.cpp +21 -0
- package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_latin1_to_utf32.cpp +31 -0
- package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_latin1_to_utf8.cpp +71 -0
- package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_utf16_to_latin1.cpp +70 -0
- package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_utf16_to_utf32.cpp +206 -0
- package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_utf16_to_utf8.cpp +504 -0
- package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_utf32_to_latin1.cpp +82 -0
- package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_utf32_to_utf16.cpp +209 -0
- package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_utf32_to_utf8.cpp +589 -0
- package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_utf8_to_latin1.cpp +58 -0
- package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_utf8_to_utf16.cpp +197 -0
- package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_convert_utf8_to_utf32.cpp +141 -0
- package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_utf16fix.cpp +82 -0
- package/harmony/quick_crypto/deps/simdutf/src/westmere/sse_validate_utf16.cpp +17 -0
- package/harmony/quick_crypto/hvigorfile.ts +2 -0
- package/harmony/quick_crypto/index.ets +1 -0
- package/harmony/quick_crypto/oh-package.json5 +14 -0
- package/harmony/quick_crypto/src/main/cpp/CMakeLists.txt +296 -0
- package/harmony/quick_crypto/src/main/cpp/QuickCryptoOnLoad.cpp +211 -0
- package/harmony/quick_crypto/src/main/cpp/QuickCryptoOnLoad.hpp +16 -0
- package/harmony/quick_crypto/src/main/cpp/QuickCryptoPackage.h +50 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/argon2/HybridArgon2.cpp +103 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/argon2/HybridArgon2.hpp +32 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/blake3/HybridBlake3.cpp +118 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/blake3/HybridBlake3.hpp +35 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/certificate/HybridCertificate.cpp +42 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/certificate/HybridCertificate.hpp +16 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/CCMCipher.cpp +202 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/CCMCipher.hpp +26 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/ChaCha20Cipher.cpp +99 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/ChaCha20Cipher.hpp +25 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/ChaCha20Poly1305Cipher.cpp +170 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/ChaCha20Poly1305Cipher.hpp +29 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/GCMCipher.cpp +68 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/GCMCipher.hpp +14 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/HybridCipher.cpp +415 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/HybridCipher.hpp +74 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/HybridCipherFactory.hpp +119 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/HybridRsaCipher.cpp +440 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/HybridRsaCipher.hpp +33 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/OCBCipher.cpp +55 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/OCBCipher.hpp +19 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/XChaCha20Poly1305Cipher.cpp +163 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/XChaCha20Poly1305Cipher.hpp +42 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/XSalsa20Cipher.cpp +65 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/XSalsa20Cipher.hpp +33 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/XSalsa20Poly1305Cipher.cpp +147 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/cipher/XSalsa20Poly1305Cipher.hpp +41 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/dh/HybridDhKeyPair.cpp +179 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/dh/HybridDhKeyPair.hpp +37 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/dh/HybridDiffieHellman.cpp +501 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/dh/HybridDiffieHellman.hpp +42 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/dsa/HybridDsaKeyPair.cpp +128 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/dsa/HybridDsaKeyPair.hpp +32 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/ec/HybridEcKeyPair.cpp +479 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/ec/HybridEcKeyPair.hpp +49 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/ecdh/HybridECDH.cpp +228 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/ecdh/HybridECDH.hpp +43 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/ed25519/HybridEdKeyPair.cpp +404 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/ed25519/HybridEdKeyPair.hpp +71 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/hash/HybridHash.cpp +207 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/hash/HybridHash.hpp +43 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/hkdf/HybridHkdf.cpp +96 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/hkdf/HybridHkdf.hpp +28 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/hmac/HybridHmac.cpp +104 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/hmac/HybridHmac.hpp +32 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/keys/HybridKeyObjectHandle.cpp +891 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/keys/HybridKeyObjectHandle.hpp +58 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/keys/KeyObjectData.cpp +284 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/keys/KeyObjectData.hpp +73 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/keys/node.h +5 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/kmac/HybridKmac.cpp +83 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/kmac/HybridKmac.hpp +31 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/mldsa/HybridMlDsaKeyPair.cpp +255 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/mldsa/HybridMlDsaKeyPair.hpp +49 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/mlkem/HybridMlKemKeyPair.cpp +319 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/mlkem/HybridMlKemKeyPair.hpp +48 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/pbkdf2/HybridPbkdf2.cpp +51 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/pbkdf2/HybridPbkdf2.hpp +24 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/prime/HybridPrime.cpp +81 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/prime/HybridPrime.hpp +20 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/random/HybridRandom.cpp +48 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/random/HybridRandom.hpp +32 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/rsa/HybridRsaKeyPair.cpp +154 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/rsa/HybridRsaKeyPair.hpp +43 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/scrypt/HybridScrypt.cpp +62 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/scrypt/HybridScrypt.hpp +28 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/sign/HybridSignHandle.cpp +266 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/sign/HybridSignHandle.hpp +36 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/sign/HybridVerifyHandle.cpp +227 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/sign/HybridVerifyHandle.hpp +36 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/sign/SignUtils.hpp +91 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/utils/HybridUtils.cpp +197 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/utils/HybridUtils.hpp +17 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/utils/Macros.hpp +68 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/utils/QuickCryptoUtils.cpp +44 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/utils/QuickCryptoUtils.hpp +114 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/utils/base64.h +309 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/x509/HybridX509Certificate.cpp +174 -0
- package/harmony/quick_crypto/src/main/cpp/cpp/x509/HybridX509Certificate.hpp +51 -0
- package/harmony/quick_crypto/src/main/cpp/generated/RNOH/generated/BaseQuickCryptoPackage.h +72 -0
- package/harmony/quick_crypto/src/main/cpp/generated/RNOH/generated/dummy.cpp +2 -0
- package/harmony/quick_crypto/src/main/cpp/generated/RNOH/generated/turbo_modules/QuickCrypto.cpp +16 -0
- package/harmony/quick_crypto/src/main/cpp/generated/RNOH/generated/turbo_modules/QuickCrypto.h +16 -0
- package/harmony/quick_crypto/src/main/cpp/generated/react/renderer/components/quick_crypto/ComponentDescriptors.h +24 -0
- package/harmony/quick_crypto/src/main/cpp/generated/react/renderer/components/quick_crypto/EventEmitters.cpp +16 -0
- package/harmony/quick_crypto/src/main/cpp/generated/react/renderer/components/quick_crypto/EventEmitters.h +17 -0
- package/harmony/quick_crypto/src/main/cpp/generated/react/renderer/components/quick_crypto/Props.cpp +19 -0
- package/harmony/quick_crypto/src/main/cpp/generated/react/renderer/components/quick_crypto/Props.h +18 -0
- package/harmony/quick_crypto/src/main/cpp/generated/react/renderer/components/quick_crypto/ShadowNodes.cpp +17 -0
- package/harmony/quick_crypto/src/main/cpp/generated/react/renderer/components/quick_crypto/ShadowNodes.h +23 -0
- package/harmony/quick_crypto/src/main/cpp/generated/react/renderer/components/quick_crypto/States.cpp +16 -0
- package/harmony/quick_crypto/src/main/cpp/generated/react/renderer/components/quick_crypto/States.h +19 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/HarmonyDispatcher.h +84 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/AnyMap.hpp +216 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/ArrayBuffer.hpp +157 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/AssertPromiseState.hpp +34 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/BorrowingReference.hpp +223 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/BoxedHybridObject.hpp +36 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/CachedProp.hpp +44 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/CallInvokerDispatcher.hpp +38 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/CountTrailingOptionals.hpp +64 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/Dispatcher.hpp +83 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/FastVectorCopy.hpp +45 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/FutureType.hpp +28 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/HybridFunction.hpp +269 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/HybridNitroModulesProxy.hpp +52 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/HybridObject.hpp +152 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/HybridObjectPrototype.hpp +93 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/HybridObjectRegistry.hpp +53 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/InstallNitro.hpp +41 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/InstanceMethod.hpp +23 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/IsSharedPtrTo.hpp +27 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSCallback.hpp +132 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSICache.hpp +123 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+AnyMap.hpp +86 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+ArrayBuffer.hpp +96 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+Date.hpp +83 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+Exception.hpp +59 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+Function.hpp +92 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+HostObject.hpp +73 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+NativeState.hpp +93 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+Null.hpp +38 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+Optional.hpp +50 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+Promise.hpp +112 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+Tuple.hpp +93 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+UnorderedMap.hpp +70 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+Variant.hpp +67 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter+Vector.hpp +69 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIConverter.hpp +197 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/JSIHelpers.hpp +52 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/NitroDefines.hpp +73 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/NitroHash.hpp +61 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/NitroLogger.hpp +69 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/NitroTypeInfo.hpp +66 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/Null.hpp +42 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/ObjectUtils.hpp +94 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/Promise.hpp +324 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/PromiseType.hpp +44 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/PropNameIDCache.hpp +24 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/Prototype.hpp +182 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/PrototypeChain.hpp +78 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/ReferenceState.hpp +40 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/ThreadPool.hpp +66 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/ThreadUtils.hpp +31 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/TypeIndex.hpp +29 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/WeakReference+Owning.hpp +33 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModules/WeakReference.hpp +102 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModulesTurboModule.cpp +92 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/NitroModulesTurboModule.h +74 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/platform/ThreadUtils.cpp +60 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/AnyMap.cpp +202 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/AnyMap.hpp +216 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/ArrayBuffer.cpp +125 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/ArrayBuffer.hpp +157 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/AssertPromiseState.hpp +34 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/BorrowingReference.hpp +223 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/BoxedHybridObject.cpp +30 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/BoxedHybridObject.hpp +36 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/CachedProp.hpp +44 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/CallInvokerDispatcher.hpp +38 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/CountTrailingOptionals.hpp +64 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/Dispatcher.cpp +71 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/Dispatcher.hpp +83 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/FastVectorCopy.hpp +45 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/FutureType.hpp +28 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/HybridFunction.hpp +269 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/HybridNitroModulesProxy.cpp +92 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/HybridNitroModulesProxy.hpp +52 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/HybridObject.cpp +107 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/HybridObject.hpp +152 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/HybridObjectPrototype.cpp +113 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/HybridObjectPrototype.hpp +93 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/HybridObjectRegistry.cpp +105 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/HybridObjectRegistry.hpp +53 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/InstallNitro.cpp +29 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/InstallNitro.hpp +41 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/InstanceMethod.hpp +23 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/IsSharedPtrTo.hpp +27 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSCallback.hpp +132 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSICache.cpp +66 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSICache.hpp +123 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+AnyMap.hpp +86 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+ArrayBuffer.hpp +96 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+Date.hpp +83 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+Exception.hpp +59 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+Function.hpp +92 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+HostObject.hpp +73 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+NativeState.hpp +93 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+Null.hpp +38 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+Optional.hpp +50 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+Promise.hpp +112 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+Tuple.hpp +93 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+UnorderedMap.hpp +70 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+Variant.hpp +67 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter+Vector.hpp +69 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIConverter.hpp +197 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/JSIHelpers.hpp +52 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/NitroDefines.hpp +73 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/NitroHash.hpp +61 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/NitroLogger.hpp +69 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/NitroTypeInfo.cpp +80 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/NitroTypeInfo.hpp +66 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/Null.hpp +42 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/ObjectUtils.cpp +172 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/ObjectUtils.hpp +94 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/Promise.cpp +136 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/Promise.hpp +324 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/PromiseType.hpp +44 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/Prototype.hpp +182 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/PrototypeChain.hpp +78 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/ReferenceState.hpp +40 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/ThreadPool.cpp +99 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/ThreadPool.hpp +66 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/ThreadUtils.hpp +31 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/TypeIndex.hpp +29 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/WeakReference+Owning.hpp +33 -0
- package/harmony/quick_crypto/src/main/cpp/nitro/shared/WeakReference.hpp +102 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/AsymmetricKeyType.hpp +128 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/CipherArgs.hpp +101 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/CipherInfo.hpp +104 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridArgon2Spec.cpp +22 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridArgon2Spec.hpp +66 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridBlake3Spec.cpp +28 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridBlake3Spec.hpp +74 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridCertificateSpec.cpp +23 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridCertificateSpec.hpp +64 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridCipherFactorySpec.cpp +21 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridCipherFactorySpec.hpp +67 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridCipherSpec.cpp +29 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridCipherSpec.hpp +78 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridDhKeyPairSpec.cpp +27 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridDhKeyPairSpec.hpp +69 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridDiffieHellmanSpec.cpp +31 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridDiffieHellmanSpec.hpp +72 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridDsaKeyPairSpec.cpp +26 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridDsaKeyPairSpec.hpp +68 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridECDHSpec.cpp +28 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridECDHSpec.hpp +70 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridEcKeyPairSpec.cpp +30 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridEcKeyPairSpec.hpp +76 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridEdKeyPairSpec.cpp +30 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridEdKeyPairSpec.hpp +74 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridHashSpec.cpp +26 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridHashSpec.hpp +74 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridHkdfSpec.cpp +22 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridHkdfSpec.hpp +65 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridHmacSpec.cpp +23 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridHmacSpec.hpp +66 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridKeyObjectHandleSpec.cpp +30 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridKeyObjectHandleSpec.hpp +98 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridKmacSpec.cpp +23 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridKmacSpec.hpp +66 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridMlDsaKeyPairSpec.cpp +29 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridMlDsaKeyPairSpec.hpp +72 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridMlKemKeyPairSpec.cpp +31 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridMlKemKeyPairSpec.hpp +74 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridPbkdf2Spec.cpp +22 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridPbkdf2Spec.hpp +65 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridPrimeSpec.cpp +24 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridPrimeSpec.hpp +67 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridRandomSpec.cpp +22 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridRandomSpec.hpp +64 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridRsaCipherSpec.cpp +25 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridRsaCipherSpec.hpp +71 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridRsaKeyPairSpec.cpp +29 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridRsaKeyPairSpec.hpp +75 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridScryptSpec.cpp +22 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridScryptSpec.hpp +64 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridSignHandleSpec.cpp +23 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridSignHandleSpec.hpp +69 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridUtilsSpec.cpp +23 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridUtilsSpec.hpp +65 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridVerifyHandleSpec.cpp +23 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridVerifyHandleSpec.hpp +69 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridX509CertificateHandleSpec.cpp +46 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/HybridX509CertificateHandleSpec.hpp +96 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/JWK.hpp +177 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/JWKkty.hpp +88 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/JWKuse.hpp +76 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/KFormatType.hpp +63 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/KeyDetail.hpp +108 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/KeyEncoding.hpp +64 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/KeyObject.hpp +83 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/KeyType.hpp +63 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/KeyUsage.hpp +116 -0
- package/harmony/quick_crypto/src/main/cpp/nitrogen/shared/NamedCurve.hpp +80 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/README.md +11 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/__DECC_INCLUDE_EPILOGUE.H +22 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/__DECC_INCLUDE_PROLOGUE.H +26 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/aes.h +111 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/asn1.h +1134 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/asn1.h.in +967 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/asn1err.h +142 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/asn1t.h +946 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/asn1t.h.in +923 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/async.h +104 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/asyncerr.h +29 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/bio.h +1022 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/bio.h.in +999 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/bioerr.h +72 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/blowfish.h +78 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/bn.h +590 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/bnerr.h +47 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/buffer.h +62 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/buffererr.h +25 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/byteorder.h +339 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/camellia.h +117 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cast.h +71 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cmac.h +52 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cmp.h +727 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cmp.h.in +584 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cmp_util.h +56 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cmperr.h +134 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cms.h +520 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cms.h.in +422 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cmserr.h +129 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/comp.h +98 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/comp.h.in +76 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/comperr.h +38 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/conf.h +214 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/conf.h.in +177 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/conf_api.h +46 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/conferr.h +52 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/configuration.h +224 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/configuration.h.in +75 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/conftypes.h +44 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/core.h +236 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/core_dispatch.h +1156 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/core_names.h +584 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/core_names.h.in +129 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/core_object.h +41 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/crmf.h +278 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/crmf.h.in +207 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/crmferr.h +57 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/crypto.h +614 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/crypto.h.in +591 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cryptoerr.h +56 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cryptoerr_legacy.h +1466 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ct.h +573 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ct.h.in +525 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/cterr.h +45 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/decoder.h +133 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/decodererr.h +28 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/des.h +211 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/dh.h +339 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/dherr.h +59 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/dsa.h +280 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/dsaerr.h +44 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/dtls1.h +57 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/e_os2.h +310 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/e_ostime.h +38 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ebcdic.h +39 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ec.h +1588 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ecdh.h +10 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ecdsa.h +10 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ecerr.h +104 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/encoder.h +124 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/encodererr.h +28 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/engine.h +833 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/engineerr.h +63 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/err.h +512 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/err.h.in +501 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ess.h +128 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ess.h.in +81 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/esserr.h +32 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/evp.h +2345 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/evperr.h +148 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/fips_names.h +50 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/fipskey.h +41 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/fipskey.h.in +40 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/hmac.h +62 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/hpke.h +169 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/http.h +119 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/httperr.h +56 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/idea.h +82 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/indicator.h +31 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/kdf.h +142 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/kdferr.h +16 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/lhash.h +398 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/lhash.h.in +373 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/macros.h +361 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/md2.h +56 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/md4.h +63 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/md5.h +62 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/mdc2.h +55 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ml_kem.h +31 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/modes.h +219 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/obj_mac.h +6695 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/objects.h +184 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/objectserr.h +28 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ocsp.h +483 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ocsp.h.in +387 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ocsperr.h +53 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/opensslconf.h +17 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/opensslv.h +109 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/opensslv.h.in +108 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ossl_typ.h +16 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/param_build.h +63 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/params.h +166 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/pem.h +548 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/pem2.h +19 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/pemerr.h +59 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/pkcs12.h +372 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/pkcs12.h.in +349 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/pkcs12err.h +46 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/pkcs7.h +430 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/pkcs7.h.in +359 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/pkcs7err.h +63 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/prov_ssl.h +38 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/proverr.h +171 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/provider.h +94 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/quic.h +75 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/rand.h +131 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/randerr.h +70 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/rc2.h +68 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/rc4.h +47 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/rc5.h +79 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ripemd.h +59 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/rsa.h +615 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/rsaerr.h +107 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/safestack.h +320 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/safestack.h.in +250 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/seed.h +113 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/self_test.h +116 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/sha.h +139 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/srp.h +285 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/srp.h.in +214 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/srtp.h +68 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ssl.h +2940 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ssl.h.in +2893 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ssl2.h +30 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ssl3.h +358 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/sslerr.h +382 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/sslerr_legacy.h +467 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/stack.h +92 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/store.h +379 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/storeerr.h +49 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/symhacks.h +39 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/thread.h +31 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/tls1.h +1226 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/trace.h +321 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ts.h +522 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/tserr.h +67 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/txt_db.h +63 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/types.h +248 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ui.h +407 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/ui.h.in +384 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/uierr.h +38 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/whrlpool.h +62 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509.h +1304 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509.h.in +1110 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509_acert.h +294 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509_acert.h.in +199 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509_vfy.h +921 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509_vfy.h.in +824 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509err.h +70 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509v3.h +1968 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509v3.h.in +1367 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/include/openssl/x509v3err.h +97 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/lib/libcrypto.a +0 -0
- package/harmony/quick_crypto/src/main/cpp/third_party/openssl/lib/libssl.a +0 -0
- package/harmony/quick_crypto/src/main/ets/QuickCryptoTurboModule.ts +14 -0
- package/harmony/quick_crypto/src/main/ets/QuickCryptoTurboModulesFactory.ets +26 -0
- package/harmony/quick_crypto/src/main/ets/generated/index.ets +5 -0
- package/harmony/quick_crypto/src/main/ets/generated/ts.ts +5 -0
- package/harmony/quick_crypto/src/main/ets/generated/turboModules/QuickCrypto.ts +14 -0
- package/harmony/quick_crypto/src/main/ets/generated/turboModules/ts.ts +5 -0
- package/harmony/quick_crypto/src/main/ets/nitro/Logger.ts +58 -0
- package/harmony/quick_crypto/src/main/ets/nitro/NitroModulesModule.ts +134 -0
- package/harmony/quick_crypto/src/main/module.json5 +13 -0
- package/harmony/quick_crypto/src/main/resources/base/element/string.json +8 -0
- package/harmony/quick_crypto/src/main/resources/en_US/element/string.json +8 -0
- package/harmony/quick_crypto/src/main/resources/zh_CN/element/string.json +8 -0
- package/harmony/quick_crypto.har +0 -0
- package/package.json +87 -0
- package/src/argon2.ts +83 -0
- package/src/blake3.ts +124 -0
- package/src/certificate.ts +41 -0
- package/src/cipher.ts +373 -0
- package/src/constants.ts +32 -0
- package/src/dh-groups.ts +27 -0
- package/src/dhKeyPair.ts +156 -0
- package/src/diffie-hellman.ts +195 -0
- package/src/dsa.ts +129 -0
- package/src/ec.ts +557 -0
- package/src/ecdh.ts +132 -0
- package/src/ed.ts +526 -0
- package/src/expo-plugin/@types.ts +7 -0
- package/src/expo-plugin/withRNQC.ts +23 -0
- package/src/expo-plugin/withSodiumAndroid.ts +24 -0
- package/src/expo-plugin/withSodiumIos.ts +25 -0
- package/src/expo-plugin/withXCode.ts +55 -0
- package/src/hash.ts +320 -0
- package/src/hkdf.ts +147 -0
- package/src/hmac.ts +140 -0
- package/src/index.ts +144 -0
- package/src/keys/classes.ts +332 -0
- package/src/keys/generateKeyPair.ts +212 -0
- package/src/keys/index.ts +298 -0
- package/src/keys/publicCipher.ts +250 -0
- package/src/keys/signVerify.ts +318 -0
- package/src/keys/utils.ts +190 -0
- package/src/mldsa.ts +125 -0
- package/src/mlkem.ts +350 -0
- package/src/pbkdf2.ts +183 -0
- package/src/prime.ts +134 -0
- package/src/random.ts +334 -0
- package/src/rsa.ts +311 -0
- package/src/scrypt.ts +134 -0
- package/src/specs/v1/.gitkeep +1 -0
- package/src/specs/v1/NativeQuickCrypto.ts +19 -0
- package/src/specs/v1/argon2.nitro.ts +29 -0
- package/src/specs/v1/blake3.nitro.ts +12 -0
- package/src/specs/v1/certificate.nitro.ts +8 -0
- package/src/specs/v1/cipher.nitro.ts +39 -0
- package/src/specs/v1/dhKeyPair.nitro.ts +14 -0
- package/src/specs/v1/diffie-hellman.nitro.ts +16 -0
- package/src/specs/v1/dsaKeyPair.nitro.ts +13 -0
- package/src/specs/v1/ecKeyPair.nitro.ts +40 -0
- package/src/specs/v1/ecdh.nitro.ts +12 -0
- package/src/specs/v1/edKeyPair.nitro.ts +43 -0
- package/src/specs/v1/hash.nitro.ts +10 -0
- package/src/specs/v1/hkdf.nitro.ts +19 -0
- package/src/specs/v1/hmac.nitro.ts +7 -0
- package/src/specs/v1/keyObjectHandle.nitro.ts +39 -0
- package/src/specs/v1/kmac.nitro.ts +12 -0
- package/src/specs/v1/mlDsaKeyPair.nitro.ts +29 -0
- package/src/specs/v1/mlKemKeyPair.nitro.ts +32 -0
- package/src/specs/v1/pbkdf2.nitro.ts +18 -0
- package/src/specs/v1/prime.nitro.ts +18 -0
- package/src/specs/v1/random.nitro.ts +14 -0
- package/src/specs/v1/rsaCipher.nitro.ts +82 -0
- package/src/specs/v1/rsaKeyPair.nitro.ts +33 -0
- package/src/specs/v1/scrypt.nitro.ts +23 -0
- package/src/specs/v1/sign.nitro.ts +31 -0
- package/src/specs/v1/utils.nitro.ts +7 -0
- package/src/specs/v1/x509certificate.nitro.ts +38 -0
- package/src/specs/v2/.gitkeep +1 -0
- package/src/subtle.ts +2922 -0
- package/src/utils/cipher.ts +60 -0
- package/src/utils/conversion.ts +194 -0
- package/src/utils/errors.ts +15 -0
- package/src/utils/hashnames.ts +129 -0
- package/src/utils/index.ts +7 -0
- package/src/utils/noble.ts +85 -0
- package/src/utils/timingSafeEqual.ts +23 -0
- package/src/utils/types.ts +547 -0
- package/src/utils/validation.ts +130 -0
- package/src/x509certificate.ts +277 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["lazyDOMException","message","domName","cause","Error"],"sources":["errors.ts"],"sourcesContent":["type DOMName =\r\n | string\r\n | {\r\n name: string;\r\n cause: unknown;\r\n };\r\n\r\nexport function lazyDOMException(message: string, domName: DOMName): Error {\r\n let cause = '';\r\n if (typeof domName !== 'string') {\r\n cause = `\\nCaused by: ${domName.cause}`;\r\n }\r\n\r\n return new Error(`[${domName}]: ${message}${cause}`);\r\n}\r\n"],"mappings":"AAOA,OAAO,SAASA,gBAAgBA,CAACC,OAAe,EAAEC,OAAgB,EAAS;EACzE,IAAIC,KAAK,GAAG,EAAE;EACd,IAAI,OAAOD,OAAO,KAAK,QAAQ,EAAE;IAC/BC,KAAK,GAAG,gBAAgBD,OAAO,CAACC,KAAK,EAAE;EACzC;EAEA,OAAO,IAAIC,KAAK,CAAC,IAAIF,OAAO,MAAMD,OAAO,GAAGE,KAAK,EAAE,CAAC;AACtD","ignoreList":[]}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
export let HashContext = /*#__PURE__*/function (HashContext) {
|
|
2
|
+
HashContext[HashContext["Node"] = 0] = "Node";
|
|
3
|
+
HashContext[HashContext["WebCrypto"] = 1] = "WebCrypto";
|
|
4
|
+
HashContext[HashContext["JwkRsa"] = 2] = "JwkRsa";
|
|
5
|
+
HashContext[HashContext["JwkRsaPss"] = 3] = "JwkRsaPss";
|
|
6
|
+
HashContext[HashContext["JwkRsaOaep"] = 4] = "JwkRsaOaep";
|
|
7
|
+
HashContext[HashContext["JwkHmac"] = 5] = "JwkHmac";
|
|
8
|
+
return HashContext;
|
|
9
|
+
}({});
|
|
10
|
+
|
|
11
|
+
// WebCrypto and JWK use a bunch of different names for the
|
|
12
|
+
// standard set of SHA-* digest algorithms... which is ... fun.
|
|
13
|
+
// Here we provide a utility for mapping between them in order
|
|
14
|
+
// make it easier in the code.
|
|
15
|
+
|
|
16
|
+
const kHashNames = {
|
|
17
|
+
sha1: {
|
|
18
|
+
[HashContext.Node]: 'sha1',
|
|
19
|
+
[HashContext.WebCrypto]: 'SHA-1',
|
|
20
|
+
[HashContext.JwkRsa]: 'RS1',
|
|
21
|
+
[HashContext.JwkRsaPss]: 'PS1',
|
|
22
|
+
[HashContext.JwkRsaOaep]: 'RSA-OAEP',
|
|
23
|
+
[HashContext.JwkHmac]: 'HS1'
|
|
24
|
+
},
|
|
25
|
+
sha224: {
|
|
26
|
+
[HashContext.Node]: 'sha224',
|
|
27
|
+
[HashContext.WebCrypto]: 'SHA-224',
|
|
28
|
+
[HashContext.JwkRsa]: 'RS224',
|
|
29
|
+
[HashContext.JwkRsaPss]: 'PS224',
|
|
30
|
+
[HashContext.JwkRsaOaep]: 'RSA-OAEP-224',
|
|
31
|
+
[HashContext.JwkHmac]: 'HS224'
|
|
32
|
+
},
|
|
33
|
+
sha256: {
|
|
34
|
+
[HashContext.Node]: 'sha256',
|
|
35
|
+
[HashContext.WebCrypto]: 'SHA-256',
|
|
36
|
+
[HashContext.JwkRsa]: 'RS256',
|
|
37
|
+
[HashContext.JwkRsaPss]: 'PS256',
|
|
38
|
+
[HashContext.JwkRsaOaep]: 'RSA-OAEP-256',
|
|
39
|
+
[HashContext.JwkHmac]: 'HS256'
|
|
40
|
+
},
|
|
41
|
+
sha384: {
|
|
42
|
+
[HashContext.Node]: 'sha384',
|
|
43
|
+
[HashContext.WebCrypto]: 'SHA-384',
|
|
44
|
+
[HashContext.JwkRsa]: 'RS384',
|
|
45
|
+
[HashContext.JwkRsaPss]: 'PS384',
|
|
46
|
+
[HashContext.JwkRsaOaep]: 'RSA-OAEP-384',
|
|
47
|
+
[HashContext.JwkHmac]: 'HS384'
|
|
48
|
+
},
|
|
49
|
+
sha512: {
|
|
50
|
+
[HashContext.Node]: 'sha512',
|
|
51
|
+
[HashContext.WebCrypto]: 'SHA-512',
|
|
52
|
+
[HashContext.JwkRsa]: 'RS512',
|
|
53
|
+
[HashContext.JwkRsaPss]: 'PS512',
|
|
54
|
+
[HashContext.JwkRsaOaep]: 'RSA-OAEP-512',
|
|
55
|
+
[HashContext.JwkHmac]: 'HS512'
|
|
56
|
+
},
|
|
57
|
+
ripemd160: {
|
|
58
|
+
[HashContext.Node]: 'ripemd160',
|
|
59
|
+
[HashContext.WebCrypto]: 'RIPEMD-160'
|
|
60
|
+
},
|
|
61
|
+
'sha3-256': {
|
|
62
|
+
[HashContext.Node]: 'sha3-256',
|
|
63
|
+
[HashContext.WebCrypto]: 'SHA3-256'
|
|
64
|
+
},
|
|
65
|
+
'sha3-384': {
|
|
66
|
+
[HashContext.Node]: 'sha3-384',
|
|
67
|
+
[HashContext.WebCrypto]: 'SHA3-384'
|
|
68
|
+
},
|
|
69
|
+
'sha3-512': {
|
|
70
|
+
[HashContext.Node]: 'sha3-512',
|
|
71
|
+
[HashContext.WebCrypto]: 'SHA3-512'
|
|
72
|
+
},
|
|
73
|
+
shake128: {
|
|
74
|
+
[HashContext.Node]: 'shake128',
|
|
75
|
+
[HashContext.WebCrypto]: 'cSHAKE128'
|
|
76
|
+
},
|
|
77
|
+
shake256: {
|
|
78
|
+
[HashContext.Node]: 'shake256',
|
|
79
|
+
[HashContext.WebCrypto]: 'cSHAKE256'
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
{
|
|
83
|
+
// Index the aliases
|
|
84
|
+
const keys = Object.keys(kHashNames);
|
|
85
|
+
for (let n = 0; n < keys.length; n++) {
|
|
86
|
+
const contexts = Object.keys(kHashNames[keys[n]]);
|
|
87
|
+
for (let i = 0; i < contexts.length; i++) {
|
|
88
|
+
const alias = kHashNames[keys[n]][contexts[i]].toLowerCase();
|
|
89
|
+
if (kHashNames[alias] === undefined) kHashNames[alias] = kHashNames[keys[n]];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Add OpenSSL legacy RSA-* aliases (e.g. RSA-SHA256 -> sha256)
|
|
94
|
+
for (let n = 0; n < keys.length; n++) {
|
|
95
|
+
const key = keys[n];
|
|
96
|
+
if (key.startsWith('sha') || key === 'ripemd160') {
|
|
97
|
+
const rsaAlias = 'rsa-' + key;
|
|
98
|
+
if (kHashNames[rsaAlias] === undefined) {
|
|
99
|
+
kHashNames[rsaAlias] = kHashNames[key];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
export function normalizeHashName(algo, context = HashContext.Node) {
|
|
105
|
+
if (typeof algo !== 'undefined') {
|
|
106
|
+
const hashName = typeof algo === 'string' ? algo : algo.name || algo.toString();
|
|
107
|
+
const normAlgo = hashName.toLowerCase();
|
|
108
|
+
try {
|
|
109
|
+
const alias = kHashNames[normAlgo][context];
|
|
110
|
+
if (alias) return alias;
|
|
111
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
112
|
+
} catch (_e) {
|
|
113
|
+
// ignore
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
throw new Error(`Invalid Hash Algorithm: ${algo}`);
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=hashnames.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["HashContext","kHashNames","sha1","Node","WebCrypto","JwkRsa","JwkRsaPss","JwkRsaOaep","JwkHmac","sha224","sha256","sha384","sha512","ripemd160","shake128","shake256","keys","Object","n","length","contexts","i","alias","toLowerCase","undefined","key","startsWith","rsaAlias","normalizeHashName","algo","context","hashName","name","toString","normAlgo","_e","Error"],"sources":["hashnames.ts"],"sourcesContent":["import type { HashAlgorithm } from '.';\r\n\r\nexport enum HashContext {\r\n Node,\r\n WebCrypto,\r\n JwkRsa,\r\n JwkRsaPss,\r\n JwkRsaOaep,\r\n JwkHmac,\r\n}\r\n\r\n// WebCrypto and JWK use a bunch of different names for the\r\n// standard set of SHA-* digest algorithms... which is ... fun.\r\n// Here we provide a utility for mapping between them in order\r\n// make it easier in the code.\r\n\r\ntype HashNames = {\r\n [key: string]: { [key in HashContext as string]: string };\r\n};\r\n\r\nconst kHashNames: HashNames = {\r\n sha1: {\r\n [HashContext.Node]: 'sha1',\r\n [HashContext.WebCrypto]: 'SHA-1',\r\n [HashContext.JwkRsa]: 'RS1',\r\n [HashContext.JwkRsaPss]: 'PS1',\r\n [HashContext.JwkRsaOaep]: 'RSA-OAEP',\r\n [HashContext.JwkHmac]: 'HS1',\r\n },\r\n sha224: {\r\n [HashContext.Node]: 'sha224',\r\n [HashContext.WebCrypto]: 'SHA-224',\r\n [HashContext.JwkRsa]: 'RS224',\r\n [HashContext.JwkRsaPss]: 'PS224',\r\n [HashContext.JwkRsaOaep]: 'RSA-OAEP-224',\r\n [HashContext.JwkHmac]: 'HS224',\r\n },\r\n sha256: {\r\n [HashContext.Node]: 'sha256',\r\n [HashContext.WebCrypto]: 'SHA-256',\r\n [HashContext.JwkRsa]: 'RS256',\r\n [HashContext.JwkRsaPss]: 'PS256',\r\n [HashContext.JwkRsaOaep]: 'RSA-OAEP-256',\r\n [HashContext.JwkHmac]: 'HS256',\r\n },\r\n sha384: {\r\n [HashContext.Node]: 'sha384',\r\n [HashContext.WebCrypto]: 'SHA-384',\r\n [HashContext.JwkRsa]: 'RS384',\r\n [HashContext.JwkRsaPss]: 'PS384',\r\n [HashContext.JwkRsaOaep]: 'RSA-OAEP-384',\r\n [HashContext.JwkHmac]: 'HS384',\r\n },\r\n sha512: {\r\n [HashContext.Node]: 'sha512',\r\n [HashContext.WebCrypto]: 'SHA-512',\r\n [HashContext.JwkRsa]: 'RS512',\r\n [HashContext.JwkRsaPss]: 'PS512',\r\n [HashContext.JwkRsaOaep]: 'RSA-OAEP-512',\r\n [HashContext.JwkHmac]: 'HS512',\r\n },\r\n ripemd160: {\r\n [HashContext.Node]: 'ripemd160',\r\n [HashContext.WebCrypto]: 'RIPEMD-160',\r\n },\r\n 'sha3-256': {\r\n [HashContext.Node]: 'sha3-256',\r\n [HashContext.WebCrypto]: 'SHA3-256',\r\n },\r\n 'sha3-384': {\r\n [HashContext.Node]: 'sha3-384',\r\n [HashContext.WebCrypto]: 'SHA3-384',\r\n },\r\n 'sha3-512': {\r\n [HashContext.Node]: 'sha3-512',\r\n [HashContext.WebCrypto]: 'SHA3-512',\r\n },\r\n shake128: {\r\n [HashContext.Node]: 'shake128',\r\n [HashContext.WebCrypto]: 'cSHAKE128',\r\n },\r\n shake256: {\r\n [HashContext.Node]: 'shake256',\r\n [HashContext.WebCrypto]: 'cSHAKE256',\r\n },\r\n};\r\n\r\n{\r\n // Index the aliases\r\n const keys: string[] = Object.keys(kHashNames);\r\n for (let n: number = 0; n < keys.length; n++) {\r\n const contexts: string[] = Object.keys(kHashNames[keys[n]!]!);\r\n for (let i: number = 0; i < contexts.length; i++) {\r\n const alias: string = kHashNames[keys[n]!]![contexts[i]!]!.toLowerCase();\r\n if (kHashNames[alias] === undefined)\r\n kHashNames[alias] = kHashNames[keys[n]!]!;\r\n }\r\n }\r\n\r\n // Add OpenSSL legacy RSA-* aliases (e.g. RSA-SHA256 -> sha256)\r\n for (let n: number = 0; n < keys.length; n++) {\r\n const key = keys[n]!;\r\n if (key.startsWith('sha') || key === 'ripemd160') {\r\n const rsaAlias = 'rsa-' + key;\r\n if (kHashNames[rsaAlias] === undefined) {\r\n kHashNames[rsaAlias] = kHashNames[key]!;\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function normalizeHashName(\r\n algo: string | HashAlgorithm | { name: string } | undefined,\r\n context: HashContext = HashContext.Node,\r\n): string {\r\n if (typeof algo !== 'undefined') {\r\n const hashName =\r\n typeof algo === 'string' ? algo : algo.name || algo.toString();\r\n const normAlgo = hashName.toLowerCase();\r\n try {\r\n const alias = kHashNames[normAlgo]![context];\r\n if (alias) return alias;\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n } catch (_e) {\r\n // ignore\r\n }\r\n }\r\n throw new Error(`Invalid Hash Algorithm: ${algo}`);\r\n}\r\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './conversion';\r\nexport * from './errors';\r\nexport * from './hashnames';\r\nexport * from './timingSafeEqual';\r\nexport * from './types';\r\nexport * from './validation';\r\nexport * from './cipher';\r\n"],"mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,UAAU;AACxB,cAAc,aAAa;AAC3B,cAAc,mBAAmB;AACjC,cAAc,SAAS;AACvB,cAAc,cAAc;AAC5B,cAAc,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Takes hex string or Uint8Array, converts to Uint8Array.
|
|
3
|
+
* Validates output length.
|
|
4
|
+
* Will throw error for other types.
|
|
5
|
+
* @param title descriptive title for an error e.g. 'private key'
|
|
6
|
+
* @param hex hex string or Uint8Array
|
|
7
|
+
* @param expectedLength optional, will compare to result array's length
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export function ensureBytes(title, hex, expectedLength) {
|
|
11
|
+
let res;
|
|
12
|
+
if (typeof hex === 'string') {
|
|
13
|
+
try {
|
|
14
|
+
res = hexToBytes(hex);
|
|
15
|
+
} catch (e) {
|
|
16
|
+
throw new Error(title + ' must be hex string or Uint8Array, cause: ' + e);
|
|
17
|
+
}
|
|
18
|
+
} else if (isBytes(hex)) {
|
|
19
|
+
// Uint8Array.from() instead of hash.slice() because node.js Buffer
|
|
20
|
+
// is instance of Uint8Array, and its slice() creates **mutable** copy
|
|
21
|
+
res = Uint8Array.from(hex);
|
|
22
|
+
} else {
|
|
23
|
+
throw new Error(title + ' must be hex string or Uint8Array');
|
|
24
|
+
}
|
|
25
|
+
const len = res.length;
|
|
26
|
+
if (typeof expectedLength === 'number' && len !== expectedLength) throw new Error(title + ' of length ' + expectedLength + ' expected, got ' + len);
|
|
27
|
+
return res;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */
|
|
31
|
+
export function isBytes(a) {
|
|
32
|
+
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// We use optimized technique to convert hex string to byte array
|
|
36
|
+
const asciis = {
|
|
37
|
+
_0: 48,
|
|
38
|
+
_9: 57,
|
|
39
|
+
A: 65,
|
|
40
|
+
F: 70,
|
|
41
|
+
a: 97,
|
|
42
|
+
f: 102
|
|
43
|
+
};
|
|
44
|
+
function asciiToBase16(ch) {
|
|
45
|
+
if (ch >= asciis._0 && ch <= asciis._9) return ch - asciis._0; // '2' => 50-48
|
|
46
|
+
if (ch >= asciis.A && ch <= asciis.F) return ch - (asciis.A - 10); // 'B' => 66-(65-10)
|
|
47
|
+
if (ch >= asciis.a && ch <= asciis.f) return ch - (asciis.a - 10); // 'b' => 98-(97-10)
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Convert hex string to byte array. Uses built-in function, when available.
|
|
53
|
+
* @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])
|
|
54
|
+
*/
|
|
55
|
+
export function hexToBytes(hex) {
|
|
56
|
+
if (typeof hex !== 'string') throw new Error('hex string expected, got ' + typeof hex);
|
|
57
|
+
// @ts-expect-error Uint8Array.fromHex
|
|
58
|
+
if (hasHexBuiltin) return Uint8Array.fromHex(hex);
|
|
59
|
+
const hl = hex.length;
|
|
60
|
+
const al = hl / 2;
|
|
61
|
+
if (hl % 2) throw new Error('hex string expected, got unpadded hex of length ' + hl);
|
|
62
|
+
const array = new Uint8Array(al);
|
|
63
|
+
for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {
|
|
64
|
+
const n1 = asciiToBase16(hex.charCodeAt(hi));
|
|
65
|
+
const n2 = asciiToBase16(hex.charCodeAt(hi + 1));
|
|
66
|
+
if (n1 === undefined || n2 === undefined) {
|
|
67
|
+
const char = hex.substring(hi, hi + 2);
|
|
68
|
+
throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi);
|
|
69
|
+
}
|
|
70
|
+
array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163
|
|
71
|
+
}
|
|
72
|
+
return array;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=noble.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ensureBytes","title","hex","expectedLength","res","hexToBytes","e","Error","isBytes","Uint8Array","from","len","length","a","ArrayBuffer","isView","constructor","name","asciis","_0","_9","A","F","f","asciiToBase16","ch","hasHexBuiltin","fromHex","hl","al","array","ai","hi","n1","charCodeAt","n2","undefined","char","substring"],"sources":["noble.ts"],"sourcesContent":["import type { Hex } from './types';\r\n\r\n/**\r\n * Takes hex string or Uint8Array, converts to Uint8Array.\r\n * Validates output length.\r\n * Will throw error for other types.\r\n * @param title descriptive title for an error e.g. 'private key'\r\n * @param hex hex string or Uint8Array\r\n * @param expectedLength optional, will compare to result array's length\r\n * @returns\r\n */\r\nexport function ensureBytes(\r\n title: string,\r\n hex: Hex,\r\n expectedLength?: number,\r\n): Uint8Array {\r\n let res: Uint8Array;\r\n if (typeof hex === 'string') {\r\n try {\r\n res = hexToBytes(hex);\r\n } catch (e) {\r\n throw new Error(title + ' must be hex string or Uint8Array, cause: ' + e);\r\n }\r\n } else if (isBytes(hex)) {\r\n // Uint8Array.from() instead of hash.slice() because node.js Buffer\r\n // is instance of Uint8Array, and its slice() creates **mutable** copy\r\n res = Uint8Array.from(hex);\r\n } else {\r\n throw new Error(title + ' must be hex string or Uint8Array');\r\n }\r\n const len = res.length;\r\n if (typeof expectedLength === 'number' && len !== expectedLength)\r\n throw new Error(\r\n title + ' of length ' + expectedLength + ' expected, got ' + len,\r\n );\r\n return res;\r\n}\r\n\r\n/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */\r\nexport function isBytes(a: unknown): a is Uint8Array {\r\n return (\r\n a instanceof Uint8Array ||\r\n (ArrayBuffer.isView(a) && a.constructor.name === 'Uint8Array')\r\n );\r\n}\r\n\r\n// We use optimized technique to convert hex string to byte array\r\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 } as const;\r\nfunction asciiToBase16(ch: number): number | undefined {\r\n if (ch >= asciis._0 && ch <= asciis._9) return ch - asciis._0; // '2' => 50-48\r\n if (ch >= asciis.A && ch <= asciis.F) return ch - (asciis.A - 10); // 'B' => 66-(65-10)\r\n if (ch >= asciis.a && ch <= asciis.f) return ch - (asciis.a - 10); // 'b' => 98-(97-10)\r\n return;\r\n}\r\n\r\n/**\r\n * Convert hex string to byte array. Uses built-in function, when available.\r\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\r\n */\r\nexport function hexToBytes(hex: string): Uint8Array {\r\n if (typeof hex !== 'string')\r\n throw new Error('hex string expected, got ' + typeof hex);\r\n // @ts-expect-error Uint8Array.fromHex\r\n if (hasHexBuiltin) return Uint8Array.fromHex(hex);\r\n const hl = hex.length;\r\n const al = hl / 2;\r\n if (hl % 2)\r\n throw new Error('hex string expected, got unpadded hex of length ' + hl);\r\n const array = new Uint8Array(al);\r\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\r\n const n1 = asciiToBase16(hex.charCodeAt(hi));\r\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\r\n if (n1 === undefined || n2 === undefined) {\r\n const char = hex.substring(hi, hi + 2);\r\n throw new Error(\r\n 'hex string expected, got non-hex character \"' +\r\n char +\r\n '\" at index ' +\r\n hi,\r\n );\r\n }\r\n array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\r\n }\r\n return array;\r\n}\r\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NitroModules } from 'react-native-nitro-modules';
|
|
2
|
+
import { abvToArrayBuffer } from './conversion';
|
|
3
|
+
let utils;
|
|
4
|
+
function getNative() {
|
|
5
|
+
if (utils == null) {
|
|
6
|
+
utils = NitroModules.createHybridObject('Utils');
|
|
7
|
+
}
|
|
8
|
+
return utils;
|
|
9
|
+
}
|
|
10
|
+
export function timingSafeEqual(a, b) {
|
|
11
|
+
const bufA = abvToArrayBuffer(a);
|
|
12
|
+
const bufB = abvToArrayBuffer(b);
|
|
13
|
+
if (bufA.byteLength !== bufB.byteLength) {
|
|
14
|
+
throw new RangeError('Input buffers must have the same byte length');
|
|
15
|
+
}
|
|
16
|
+
return getNative().timingSafeEqual(bufA, bufB);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=timingSafeEqual.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NitroModules","abvToArrayBuffer","utils","getNative","createHybridObject","timingSafeEqual","a","b","bufA","bufB","byteLength","RangeError"],"sources":["timingSafeEqual.ts"],"sourcesContent":["import { NitroModules } from 'react-native-nitro-modules';\r\nimport type { Utils } from '../specs/v1/utils.nitro';\r\nimport type { ABV } from './types';\r\nimport { abvToArrayBuffer } from './conversion';\r\n\r\nlet utils: Utils;\r\nfunction getNative(): Utils {\r\n if (utils == null) {\r\n utils = NitroModules.createHybridObject<Utils>('Utils');\r\n }\r\n return utils;\r\n}\r\n\r\nexport function timingSafeEqual(a: ABV, b: ABV): boolean {\r\n const bufA = abvToArrayBuffer(a);\r\n const bufB = abvToArrayBuffer(b);\r\n\r\n if (bufA.byteLength !== bufB.byteLength) {\r\n throw new RangeError('Input buffers must have the same byte length');\r\n }\r\n\r\n return getNative().timingSafeEqual(bufA, bufB);\r\n}\r\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,4BAA4B;AAGzD,SAASC,gBAAgB,QAAQ,cAAc;AAE/C,IAAIC,KAAY;AAChB,SAASC,SAASA,CAAA,EAAU;EAC1B,IAAID,KAAK,IAAI,IAAI,EAAE;IACjBA,KAAK,GAAGF,YAAY,CAACI,kBAAkB,CAAQ,OAAO,CAAC;EACzD;EACA,OAAOF,KAAK;AACd;AAEA,OAAO,SAASG,eAAeA,CAACC,CAAM,EAAEC,CAAM,EAAW;EACvD,MAAMC,IAAI,GAAGP,gBAAgB,CAACK,CAAC,CAAC;EAChC,MAAMG,IAAI,GAAGR,gBAAgB,CAACM,CAAC,CAAC;EAEhC,IAAIC,IAAI,CAACE,UAAU,KAAKD,IAAI,CAACC,UAAU,EAAE;IACvC,MAAM,IAAIC,UAAU,CAAC,8CAA8C,CAAC;EACtE;EAEA,OAAOR,SAAS,CAAC,CAAC,CAACE,eAAe,CAACG,IAAI,EAAEC,IAAI,CAAC;AAChD","ignoreList":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// @types/node
|
|
2
|
+
|
|
3
|
+
// Node.js style key pair types (lowercase)
|
|
4
|
+
|
|
5
|
+
// TODO: These enums need to be defined on the native side
|
|
6
|
+
export let KFormatType = /*#__PURE__*/function (KFormatType) {
|
|
7
|
+
KFormatType[KFormatType["DER"] = 0] = "DER";
|
|
8
|
+
KFormatType[KFormatType["PEM"] = 1] = "PEM";
|
|
9
|
+
KFormatType[KFormatType["JWK"] = 2] = "JWK";
|
|
10
|
+
return KFormatType;
|
|
11
|
+
}({});
|
|
12
|
+
export let KeyType = /*#__PURE__*/function (KeyType) {
|
|
13
|
+
KeyType[KeyType["SECRET"] = 0] = "SECRET";
|
|
14
|
+
KeyType[KeyType["PUBLIC"] = 1] = "PUBLIC";
|
|
15
|
+
KeyType[KeyType["PRIVATE"] = 2] = "PRIVATE";
|
|
16
|
+
return KeyType;
|
|
17
|
+
}({});
|
|
18
|
+
export let KeyEncoding = /*#__PURE__*/function (KeyEncoding) {
|
|
19
|
+
KeyEncoding[KeyEncoding["PKCS1"] = 0] = "PKCS1";
|
|
20
|
+
KeyEncoding[KeyEncoding["PKCS8"] = 1] = "PKCS8";
|
|
21
|
+
KeyEncoding[KeyEncoding["SPKI"] = 2] = "SPKI";
|
|
22
|
+
KeyEncoding[KeyEncoding["SEC1"] = 3] = "SEC1";
|
|
23
|
+
return KeyEncoding;
|
|
24
|
+
}({});
|
|
25
|
+
export let KeyFormat = /*#__PURE__*/function (KeyFormat) {
|
|
26
|
+
KeyFormat[KeyFormat["RAW"] = 0] = "RAW";
|
|
27
|
+
KeyFormat[KeyFormat["PKCS8"] = 1] = "PKCS8";
|
|
28
|
+
KeyFormat[KeyFormat["SPKI"] = 2] = "SPKI";
|
|
29
|
+
KeyFormat[KeyFormat["JWK"] = 3] = "JWK";
|
|
30
|
+
return KeyFormat;
|
|
31
|
+
}({});
|
|
32
|
+
export const kNamedCurveAliases = {
|
|
33
|
+
'P-256': 'prime256v1',
|
|
34
|
+
'P-384': 'secp384r1',
|
|
35
|
+
'P-521': 'secp521r1'
|
|
36
|
+
};
|
|
37
|
+
// end TODO
|
|
38
|
+
|
|
39
|
+
export let KeyVariant = /*#__PURE__*/function (KeyVariant) {
|
|
40
|
+
KeyVariant[KeyVariant["RSA_SSA_PKCS1_v1_5"] = 0] = "RSA_SSA_PKCS1_v1_5";
|
|
41
|
+
KeyVariant[KeyVariant["RSA_PSS"] = 1] = "RSA_PSS";
|
|
42
|
+
KeyVariant[KeyVariant["RSA_OAEP"] = 2] = "RSA_OAEP";
|
|
43
|
+
KeyVariant[KeyVariant["DSA"] = 3] = "DSA";
|
|
44
|
+
KeyVariant[KeyVariant["EC"] = 4] = "EC";
|
|
45
|
+
KeyVariant[KeyVariant["NID"] = 5] = "NID";
|
|
46
|
+
KeyVariant[KeyVariant["DH"] = 6] = "DH";
|
|
47
|
+
return KeyVariant;
|
|
48
|
+
}({});
|
|
49
|
+
|
|
50
|
+
// These are for shortcomings in @types/node
|
|
51
|
+
// Here we use "*Type" instead of "*Types" like node does.
|
|
52
|
+
// export type CipherCBCType = 'aes-128-cbc' | 'aes-192-cbc' | 'aes-256-cbc';
|
|
53
|
+
|
|
54
|
+
// from @paulmillr/noble-curves
|
|
55
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["KFormatType","KeyType","KeyEncoding","KeyFormat","kNamedCurveAliases","KeyVariant"],"sources":["types.ts"],"sourcesContent":["import type { Buffer as CraftzdogBuffer } from '@craftzdog/react-native-buffer';\r\nimport type { Buffer } from 'buffer';\r\nimport type { CipherKey } from 'node:crypto'; // @types/node\r\nimport type { Buffer as SafeBuffer } from 'safe-buffer';\r\nimport type { KeyObjectHandle as KeyObjectHandleType } from '../specs/v1/keyObjectHandle.nitro';\r\nimport type { KeyObject, CryptoKey } from '../keys';\r\n\r\nexport type ABV = TypedArray | DataView | ArrayBufferLike | CraftzdogBuffer;\r\n\r\nexport type TypedArray =\r\n | Uint8Array\r\n | Uint8ClampedArray\r\n | Uint16Array\r\n | Uint32Array\r\n | Int8Array\r\n | Int16Array\r\n | Int32Array\r\n | Float32Array\r\n | Float64Array;\r\n\r\nexport type RandomCallback<T> = (err: Error | null, value: T) => void;\r\n\r\nexport type BufferLike =\r\n | ArrayBuffer\r\n | ArrayBufferLike\r\n | CraftzdogBuffer\r\n | SafeBuffer\r\n | ArrayBufferView;\r\n\r\nexport type BinaryLike =\r\n | string\r\n | Buffer\r\n | ArrayBuffer\r\n | ArrayBufferLike\r\n | ArrayBufferView\r\n | CraftzdogBuffer\r\n | SafeBuffer\r\n | TypedArray\r\n | DataView;\r\n\r\nexport type BinaryLikeNode = CipherKey | BinaryLike | KeyObject;\r\n\r\nexport type DigestAlgorithm =\r\n | 'SHA-1'\r\n | 'SHA-256'\r\n | 'SHA-384'\r\n | 'SHA-512'\r\n | 'SHA3-256'\r\n | 'SHA3-384'\r\n | 'SHA3-512'\r\n | 'cSHAKE128'\r\n | 'cSHAKE256';\r\n\r\nexport type HashAlgorithm = DigestAlgorithm | 'SHA-224' | 'RIPEMD-160';\r\n\r\nexport type RSAKeyPairAlgorithm = 'RSASSA-PKCS1-v1_5' | 'RSA-PSS' | 'RSA-OAEP';\r\n\r\nexport interface RsaHashedKeyGenParams {\r\n name: RSAKeyPairAlgorithm;\r\n modulusLength: number;\r\n publicExponent: Uint8Array;\r\n hash: string | { name: string };\r\n}\r\n\r\nexport interface RsaKeyAlgorithm {\r\n name: RSAKeyPairAlgorithm;\r\n modulusLength: number;\r\n publicExponent: Uint8Array;\r\n hash: { name: string };\r\n}\r\n\r\nexport type ECKeyPairAlgorithm = 'ECDSA' | 'ECDH';\r\n\r\nexport type CFRGKeyPairAlgorithm = 'Ed25519' | 'Ed448' | 'X25519' | 'X448';\r\nexport type CFRGKeyPairType = 'ed25519' | 'ed448' | 'x25519' | 'x448';\r\n\r\nexport type PQCKeyPairAlgorithm =\r\n | 'ML-DSA-44'\r\n | 'ML-DSA-65'\r\n | 'ML-DSA-87'\r\n | 'ML-KEM-512'\r\n | 'ML-KEM-768'\r\n | 'ML-KEM-1024';\r\nexport type PQCKeyPairType =\r\n | 'ml-dsa-44'\r\n | 'ml-dsa-65'\r\n | 'ml-dsa-87'\r\n | 'ml-kem-512'\r\n | 'ml-kem-768'\r\n | 'ml-kem-1024';\r\n\r\nexport type MlKemAlgorithm = 'ML-KEM-512' | 'ML-KEM-768' | 'ML-KEM-1024';\r\n\r\nexport interface EncapsulateResult {\r\n sharedKey: ArrayBuffer;\r\n ciphertext: ArrayBuffer;\r\n}\r\n\r\n// Node.js style key pair types (lowercase)\r\nexport type RSAKeyPairType = 'rsa' | 'rsa-pss';\r\nexport type ECKeyPairType = 'ec';\r\nexport type DSAKeyPairType = 'dsa';\r\nexport type DHKeyPairType = 'dh';\r\n\r\nexport type KeyPairAlgorithm =\r\n | RSAKeyPairAlgorithm\r\n | ECKeyPairAlgorithm\r\n | CFRGKeyPairAlgorithm\r\n | PQCKeyPairAlgorithm;\r\n\r\nexport type AESAlgorithm =\r\n | 'AES-CTR'\r\n | 'AES-CBC'\r\n | 'AES-GCM'\r\n | 'AES-KW'\r\n | 'AES-OCB';\r\n\r\nexport type SecretKeyAlgorithm = 'HMAC' | AESAlgorithm;\r\n\r\nexport type SignVerifyAlgorithm =\r\n | 'RSASSA-PKCS1-v1_5'\r\n | 'RSA-PSS'\r\n | 'ECDSA'\r\n | 'HMAC'\r\n | 'KMAC128'\r\n | 'KMAC256'\r\n | 'Ed25519'\r\n | 'Ed448'\r\n | 'ML-DSA-44'\r\n | 'ML-DSA-65'\r\n | 'ML-DSA-87';\r\n\r\nexport type Argon2Algorithm = 'Argon2d' | 'Argon2i' | 'Argon2id';\r\n\r\nexport type DeriveBitsAlgorithm =\r\n | 'PBKDF2'\r\n | 'HKDF'\r\n | 'ECDH'\r\n | 'X25519'\r\n | 'X448'\r\n | Argon2Algorithm;\r\n\r\nexport type EncryptDecryptAlgorithm =\r\n | 'RSA-OAEP'\r\n | 'AES-CTR'\r\n | 'AES-CBC'\r\n | 'AES-GCM'\r\n | 'AES-KW'\r\n | 'AES-OCB'\r\n | 'ChaCha20-Poly1305';\r\n\r\nexport type RsaOaepParams = {\r\n name: 'RSA-OAEP';\r\n label?: BufferLike;\r\n};\r\n\r\nexport type AesCbcParams = {\r\n name: 'AES-CBC';\r\n iv: BufferLike;\r\n};\r\n\r\nexport type AesCtrParams = {\r\n name: 'AES-CTR';\r\n counter: TypedArray;\r\n length: number;\r\n};\r\n\r\nexport type AesGcmParams = {\r\n name: 'AES-GCM';\r\n iv: BufferLike;\r\n tagLength?: TagLength;\r\n additionalData?: BufferLike;\r\n};\r\n\r\nexport type ChaCha20Poly1305Params = {\r\n name: 'ChaCha20-Poly1305';\r\n iv: BufferLike;\r\n tagLength?: 128;\r\n additionalData?: BufferLike;\r\n};\r\n\r\nexport type AesOcbParams = {\r\n name: 'AES-OCB';\r\n iv: BufferLike;\r\n tagLength?: 64 | 96 | 128;\r\n additionalData?: BufferLike;\r\n};\r\n\r\nexport type AesKwParams = {\r\n name: 'AES-KW';\r\n wrappingKey?: BufferLike;\r\n};\r\n\r\nexport type AesKeyGenParams = {\r\n length: AESLength;\r\n name?: AESAlgorithm;\r\n};\r\n\r\nexport type TagLength = 32 | 64 | 96 | 104 | 112 | 120 | 128;\r\n\r\nexport type AESLength = 128 | 192 | 256;\r\n\r\nexport type EncryptDecryptParams =\r\n | AesCbcParams\r\n | AesCtrParams\r\n | AesGcmParams\r\n | AesOcbParams\r\n | AesKwParams\r\n | RsaOaepParams\r\n | ChaCha20Poly1305Params;\r\n\r\nexport type AnyAlgorithm =\r\n | DigestAlgorithm\r\n | HashAlgorithm\r\n | KeyPairAlgorithm\r\n | SecretKeyAlgorithm\r\n | SignVerifyAlgorithm\r\n | DeriveBitsAlgorithm\r\n | EncryptDecryptAlgorithm\r\n | AESAlgorithm\r\n | 'PBKDF2'\r\n | 'HKDF'\r\n | 'unknown';\r\n\r\nexport type NamedCurve = 'P-256' | 'P-384' | 'P-521';\r\n\r\nexport type SubtleAlgorithm = {\r\n name: AnyAlgorithm;\r\n salt?: string | BufferLike;\r\n iterations?: number;\r\n hash?: HashAlgorithm | string | { name: string };\r\n namedCurve?: NamedCurve;\r\n length?: number;\r\n modulusLength?: number;\r\n publicExponent?: number | Uint8Array;\r\n saltLength?: number;\r\n public?: CryptoKey;\r\n info?: BufferLike;\r\n // Argon2 parameters\r\n nonce?: BufferLike;\r\n parallelism?: number;\r\n tagLength?: number;\r\n memory?: number;\r\n passes?: number;\r\n secretValue?: BufferLike;\r\n associatedData?: BufferLike;\r\n version?: number;\r\n // KMAC parameters\r\n customization?: BufferLike;\r\n};\r\n\r\nexport type KeyPairType =\r\n | CFRGKeyPairType\r\n | RSAKeyPairType\r\n | ECKeyPairType\r\n | DSAKeyPairType\r\n | DHKeyPairType;\r\n\r\nexport type KeyUsage =\r\n | 'encrypt'\r\n | 'decrypt'\r\n | 'sign'\r\n | 'verify'\r\n | 'deriveKey'\r\n | 'deriveBits'\r\n | 'encapsulateBits'\r\n | 'decapsulateBits'\r\n | 'encapsulateKey'\r\n | 'decapsulateKey'\r\n | 'wrapKey'\r\n | 'unwrapKey';\r\n\r\n// TODO: These enums need to be defined on the native side\r\nexport enum KFormatType {\r\n DER,\r\n PEM,\r\n JWK,\r\n}\r\n\r\nexport enum KeyType {\r\n SECRET,\r\n PUBLIC,\r\n PRIVATE,\r\n}\r\n\r\nexport enum KeyEncoding {\r\n PKCS1,\r\n PKCS8,\r\n SPKI,\r\n SEC1,\r\n}\r\n\r\nexport enum KeyFormat {\r\n RAW,\r\n PKCS8,\r\n SPKI,\r\n JWK,\r\n}\r\n\r\nexport type KeyData = BufferLike | BinaryLike | JWK;\r\n\r\nexport const kNamedCurveAliases = {\r\n 'P-256': 'prime256v1',\r\n 'P-384': 'secp384r1',\r\n 'P-521': 'secp521r1',\r\n} as const;\r\n// end TODO\r\n\r\nexport type KeyPairGenConfig = {\r\n publicFormat?: KFormatType | -1;\r\n publicType?: KeyEncoding;\r\n privateFormat?: KFormatType | -1;\r\n privateType?: KeyEncoding;\r\n cipher?: string;\r\n passphrase?: ArrayBuffer;\r\n};\r\n\r\nexport type AsymmetricKeyType =\r\n | 'rsa'\r\n | 'rsa-pss'\r\n | 'dsa'\r\n | 'ec'\r\n | 'dh'\r\n | CFRGKeyPairType\r\n | PQCKeyPairType;\r\n\r\ntype JWKkty = 'AES' | 'RSA' | 'EC' | 'oct' | 'OKP';\r\ntype JWKuse = 'sig' | 'enc';\r\n\r\nexport interface JWK {\r\n kty?: JWKkty;\r\n use?: JWKuse;\r\n key_ops?: KeyUsage[];\r\n alg?: string; // TODO: enumerate these (RFC-7517)\r\n crv?: string;\r\n kid?: string;\r\n x5u?: string;\r\n x5c?: string[];\r\n x5t?: string;\r\n 'x5t#256'?: string;\r\n n?: string;\r\n e?: string;\r\n d?: string;\r\n p?: string;\r\n q?: string;\r\n x?: string;\r\n y?: string;\r\n k?: string;\r\n dp?: string;\r\n dq?: string;\r\n qi?: string;\r\n ext?: boolean;\r\n}\r\n\r\nexport type KTypePrivate = 'pkcs1' | 'pkcs8' | 'sec1';\r\nexport type KTypePublic = 'pkcs1' | 'spki';\r\nexport type KType = KTypePrivate | KTypePublic;\r\n\r\nexport type KFormat = 'der' | 'pem' | 'jwk';\r\n\r\nexport type DSAEncoding = 'der' | 'ieee-p1363';\r\n\r\nexport type EncodingOptions = {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n key?: any;\r\n type?: KType;\r\n encoding?: string;\r\n dsaEncoding?: DSAEncoding;\r\n format?: KFormat;\r\n padding?: number;\r\n cipher?: string;\r\n passphrase?: BinaryLike;\r\n saltLength?: number;\r\n oaepHash?: string;\r\n oaepLabel?: BinaryLike;\r\n};\r\n\r\nexport interface KeyDetail {\r\n length?: number;\r\n publicExponent?: number;\r\n modulusLength?: number;\r\n hashAlgorithm?: string;\r\n mgf1HashAlgorithm?: string;\r\n saltLength?: number;\r\n namedCurve?: string;\r\n}\r\n\r\nexport type GenerateKeyPairOptions = {\r\n modulusLength?: number; // Key size in bits (RSA, DSA).\r\n publicExponent?: number; // Public exponent (RSA). Default: 0x10001.\r\n hashAlgorithm?: string; // Name of the message digest (RSA-PSS).\r\n mgf1HashAlgorithm?: string; // string Name of the message digest used by MGF1 (RSA-PSS).\r\n saltLength?: number; // Minimal salt length in bytes (RSA-PSS).\r\n divisorLength?: number; // Size of q in bits (DSA).\r\n namedCurve?: string; // Name of the curve to use (EC).\r\n prime?: CraftzdogBuffer; // The prime parameter (DH).\r\n primeLength?: number; // Prime length in bits (DH).\r\n generator?: number; // Custom generator (DH). Default: 2.\r\n groupName?: string; // Diffie-Hellman group name (DH). See crypto.getDiffieHellman().\r\n publicKeyEncoding?: EncodingOptions; // See keyObject.export().\r\n privateKeyEncoding?: EncodingOptions; // See keyObject.export().\r\n paramEncoding?: string;\r\n hash?: string;\r\n mgf1Hash?: string;\r\n};\r\n\r\nexport type KeyPairKey =\r\n | ArrayBuffer\r\n | Buffer\r\n | string\r\n | KeyObject\r\n | KeyObjectHandle\r\n | CryptoKey\r\n | undefined;\r\n\r\nexport type GenerateKeyPairReturn = [\r\n error?: Error,\r\n privateKey?: KeyPairKey,\r\n publicKey?: KeyPairKey,\r\n];\r\n\r\nexport type GenerateKeyPairCallback = (\r\n error?: Error,\r\n publicKey?: KeyPairKey,\r\n privateKey?: KeyPairKey,\r\n) => GenerateKeyPairReturn | void;\r\n\r\nexport type KeyPair = {\r\n publicKey?: KeyPairKey;\r\n privateKey?: KeyPairKey;\r\n};\r\n\r\nexport type GenerateKeyPairPromiseReturn = [error?: Error, keypair?: KeyPair];\r\n\r\nexport type CryptoKeyPair = {\r\n publicKey: KeyPairKey;\r\n privateKey: KeyPairKey;\r\n};\r\n\r\nexport type WebCryptoKeyPair = {\r\n publicKey: CryptoKey;\r\n privateKey: CryptoKey;\r\n};\r\n\r\nexport enum KeyVariant {\r\n RSA_SSA_PKCS1_v1_5,\r\n RSA_PSS,\r\n RSA_OAEP,\r\n DSA,\r\n EC,\r\n NID,\r\n DH,\r\n}\r\n\r\nexport type SignCallback = (err: Error | null, signature?: ArrayBuffer) => void;\r\n\r\nexport type VerifyCallback = (err: Error | null, valid?: boolean) => void;\r\n\r\nexport type BinaryToTextEncoding = 'base64' | 'base64url' | 'hex' | 'binary';\r\nexport type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1';\r\nexport type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2';\r\nexport type Encoding =\r\n | BinaryToTextEncoding\r\n | CharacterEncoding\r\n | LegacyCharacterEncoding\r\n | 'buffer';\r\n\r\n// These are for shortcomings in @types/node\r\n// Here we use \"*Type\" instead of \"*Types\" like node does.\r\n// export type CipherCBCType = 'aes-128-cbc' | 'aes-192-cbc' | 'aes-256-cbc';\r\nexport type CipherCFBType =\r\n | 'aes-128-cfb'\r\n | 'aes-192-cfb'\r\n | 'aes-256-cfb'\r\n | 'aes-128-cfb1'\r\n | 'aes-192-cfb1'\r\n | 'aes-256-cfb1'\r\n | 'aes-128-cfb8'\r\n | 'aes-192-cfb8'\r\n | 'aes-256-cfb8';\r\nexport type CipherCTRType = 'aes-128-ctr' | 'aes-192-ctr' | 'aes-256-ctr';\r\nexport type CipherDESType =\r\n | 'des'\r\n | 'des3'\r\n | 'des-cbc'\r\n | 'des-ecb'\r\n | 'des-ede'\r\n | 'des-ede-cbc'\r\n | 'des-ede3'\r\n | 'des-ede3-cbc';\r\nexport type CipherECBType = 'aes-128-ecb' | 'aes-192-ecb' | 'aes-256-ecb';\r\nexport type CipherGCMType = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm';\r\nexport type CipherOFBType = 'aes-128-ofb' | 'aes-192-ofb' | 'aes-256-ofb';\r\n\r\nexport type KeyObjectHandle = KeyObjectHandleType;\r\n\r\nexport type DiffieHellmanOptions = {\r\n privateKey: KeyObject;\r\n publicKey: KeyObject;\r\n};\r\n\r\nexport type DiffieHellmanCallback = (\r\n err: Error | null,\r\n secret?: CraftzdogBuffer,\r\n) => CraftzdogBuffer | void;\r\n\r\n// from @paulmillr/noble-curves\r\nexport type Hex = string | Uint8Array;\r\n\r\nexport type ImportFormat =\r\n | 'raw'\r\n | 'raw-public'\r\n | 'raw-secret'\r\n | 'raw-seed'\r\n | 'pkcs8'\r\n | 'spki'\r\n | 'jwk';\r\n\r\nexport type Operation =\r\n | 'encrypt'\r\n | 'decrypt'\r\n | 'sign'\r\n | 'verify'\r\n | 'generateKey'\r\n | 'importKey'\r\n | 'exportKey'\r\n | 'deriveBits'\r\n | 'wrapKey'\r\n | 'unwrapKey'\r\n | 'encapsulateBits'\r\n | 'decapsulateBits'\r\n | 'encapsulateKey'\r\n | 'decapsulateKey';\r\n\r\nexport interface KeyPairOptions {\r\n namedCurve: string;\r\n publicKeyEncoding?: {\r\n type: 'spki';\r\n format: 'pem' | 'der';\r\n };\r\n privateKeyEncoding?: {\r\n type: 'pkcs8';\r\n format: 'pem' | 'der';\r\n cipher?: string;\r\n passphrase?: string;\r\n };\r\n}\r\n"],"mappings":"AAE8C;;AAgG9C;;AA8KA;AACA,WAAYA,WAAW,0BAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAMvB,WAAYC,OAAO,0BAAPA,OAAO;EAAPA,OAAO,CAAPA,OAAO;EAAPA,OAAO,CAAPA,OAAO;EAAPA,OAAO,CAAPA,OAAO;EAAA,OAAPA,OAAO;AAAA;AAMnB,WAAYC,WAAW,0BAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAXA,WAAW,CAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAOvB,WAAYC,SAAS,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAAA,OAATA,SAAS;AAAA;AASrB,OAAO,MAAMC,kBAAkB,GAAG;EAChC,OAAO,EAAE,YAAY;EACrB,OAAO,EAAE,WAAW;EACpB,OAAO,EAAE;AACX,CAAU;AACV;;AA0IA,WAAYC,UAAU,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;;AAuBtB;AACA;AACA;;AAqCA","ignoreList":[]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Buffer as SBuffer } from 'safe-buffer';
|
|
2
|
+
import { lazyDOMException } from './errors';
|
|
3
|
+
|
|
4
|
+
// The maximum buffer size that we'll support in the WebCrypto impl
|
|
5
|
+
const kMaxBufferLength = 2 ** 31 - 1;
|
|
6
|
+
export function validateFunction(f) {
|
|
7
|
+
return f !== null && typeof f === 'function';
|
|
8
|
+
}
|
|
9
|
+
export function isStringOrBuffer(val) {
|
|
10
|
+
return typeof val === 'string' || ArrayBuffer.isView(val) || val instanceof ArrayBuffer;
|
|
11
|
+
}
|
|
12
|
+
export function validateObject(value, name, options) {
|
|
13
|
+
const useDefaultOptions = options == null;
|
|
14
|
+
const allowArray = useDefaultOptions ? false : options.allowArray;
|
|
15
|
+
const allowFunction = useDefaultOptions ? false : options.allowFunction;
|
|
16
|
+
const nullable = useDefaultOptions ? false : options.nullable;
|
|
17
|
+
if (!nullable && value === null || !allowArray && Array.isArray(value) || typeof value !== 'object' && (!allowFunction || typeof value !== 'function')) {
|
|
18
|
+
throw new Error(`${name} is not a valid object ${value}`);
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
export const validateMaxBufferLength = (data, name) => {
|
|
23
|
+
const length = typeof data === 'string' || data instanceof SBuffer ? data.length : data.byteLength;
|
|
24
|
+
if (length > kMaxBufferLength) {
|
|
25
|
+
throw lazyDOMException(`${name} must be less than ${kMaxBufferLength + 1} bits`, 'OperationError');
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
export const getUsagesUnion = (usageSet, ...usages) => {
|
|
29
|
+
const newset = [];
|
|
30
|
+
for (let n = 0; n < usages.length; n++) {
|
|
31
|
+
if (!usages[n] || usages[n] === undefined) continue;
|
|
32
|
+
if (usageSet.includes(usages[n])) newset.push(usages[n]);
|
|
33
|
+
}
|
|
34
|
+
return newset;
|
|
35
|
+
};
|
|
36
|
+
const kKeyOps = {
|
|
37
|
+
sign: 1,
|
|
38
|
+
verify: 2,
|
|
39
|
+
encrypt: 3,
|
|
40
|
+
decrypt: 4,
|
|
41
|
+
wrapKey: 5,
|
|
42
|
+
unwrapKey: 6,
|
|
43
|
+
deriveKey: 7,
|
|
44
|
+
deriveBits: 8,
|
|
45
|
+
encapsulateBits: 9,
|
|
46
|
+
decapsulateBits: 10,
|
|
47
|
+
encapsulateKey: 11,
|
|
48
|
+
decapsulateKey: 12
|
|
49
|
+
};
|
|
50
|
+
export const validateKeyOps = (keyOps, usagesSet) => {
|
|
51
|
+
if (keyOps === undefined) return;
|
|
52
|
+
if (!Array.isArray(keyOps)) {
|
|
53
|
+
throw lazyDOMException('keyData.key_ops', 'InvalidArgument');
|
|
54
|
+
}
|
|
55
|
+
let flags = 0;
|
|
56
|
+
for (let n = 0; n < keyOps.length; n++) {
|
|
57
|
+
const op = keyOps[n];
|
|
58
|
+
const op_flag = kKeyOps[op];
|
|
59
|
+
// Skipping unknown key ops
|
|
60
|
+
if (op_flag === undefined) continue;
|
|
61
|
+
// Have we seen it already? if so, error
|
|
62
|
+
if (flags & 1 << op_flag) throw lazyDOMException('Duplicate key operation', 'DataError');
|
|
63
|
+
flags |= 1 << op_flag;
|
|
64
|
+
|
|
65
|
+
// TODO(@jasnell): RFC7517 section 4.3 strong recommends validating
|
|
66
|
+
// key usage combinations. Specifically, it says that unrelated key
|
|
67
|
+
// ops SHOULD NOT be used together. We're not yet validating that here.
|
|
68
|
+
}
|
|
69
|
+
if (usagesSet !== undefined) {
|
|
70
|
+
for (const use of usagesSet) {
|
|
71
|
+
if (!keyOps.includes(use)) {
|
|
72
|
+
throw lazyDOMException('Key operations and usage mismatch', 'DataError');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
export function hasAnyNotIn(set, checks) {
|
|
78
|
+
for (const s of set) {
|
|
79
|
+
if (!checks.includes(s)) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Buffer","SBuffer","lazyDOMException","kMaxBufferLength","validateFunction","f","isStringOrBuffer","val","ArrayBuffer","isView","validateObject","value","name","options","useDefaultOptions","allowArray","allowFunction","nullable","Array","isArray","Error","validateMaxBufferLength","data","length","byteLength","getUsagesUnion","usageSet","usages","newset","n","undefined","includes","push","kKeyOps","sign","verify","encrypt","decrypt","wrapKey","unwrapKey","deriveKey","deriveBits","encapsulateBits","decapsulateBits","encapsulateKey","decapsulateKey","validateKeyOps","keyOps","usagesSet","flags","op","op_flag","use","hasAnyNotIn","set","checks","s"],"sources":["validation.ts"],"sourcesContent":["import { Buffer as SBuffer } from 'safe-buffer';\r\nimport type { BinaryLike, BufferLike, KeyUsage } from './types';\r\nimport { lazyDOMException } from './errors';\r\n\r\n// The maximum buffer size that we'll support in the WebCrypto impl\r\nconst kMaxBufferLength = 2 ** 31 - 1;\r\n\r\nexport function validateFunction(f: unknown): boolean {\r\n return f !== null && typeof f === 'function';\r\n}\r\n\r\nexport function isStringOrBuffer(val: unknown): val is string | ArrayBuffer {\r\n return (\r\n typeof val === 'string' ||\r\n ArrayBuffer.isView(val) ||\r\n val instanceof ArrayBuffer\r\n );\r\n}\r\n\r\nexport function validateObject<T>(\r\n value: unknown,\r\n name: string,\r\n options?: {\r\n allowArray: boolean;\r\n allowFunction: boolean;\r\n nullable: boolean;\r\n } | null,\r\n): value is T {\r\n const useDefaultOptions = options == null;\r\n const allowArray = useDefaultOptions ? false : options.allowArray;\r\n const allowFunction = useDefaultOptions ? false : options.allowFunction;\r\n const nullable = useDefaultOptions ? false : options.nullable;\r\n if (\r\n (!nullable && value === null) ||\r\n (!allowArray && Array.isArray(value)) ||\r\n (typeof value !== 'object' &&\r\n (!allowFunction || typeof value !== 'function'))\r\n ) {\r\n throw new Error(`${name} is not a valid object ${value}`);\r\n }\r\n return true;\r\n}\r\n\r\nexport const validateMaxBufferLength = (\r\n data: BinaryLike | BufferLike,\r\n name: string,\r\n): void => {\r\n const length =\r\n typeof data === 'string' || data instanceof SBuffer\r\n ? data.length\r\n : data.byteLength;\r\n if (length > kMaxBufferLength) {\r\n throw lazyDOMException(\r\n `${name} must be less than ${kMaxBufferLength + 1} bits`,\r\n 'OperationError',\r\n );\r\n }\r\n};\r\n\r\nexport const getUsagesUnion = (usageSet: KeyUsage[], ...usages: KeyUsage[]) => {\r\n const newset: KeyUsage[] = [];\r\n for (let n = 0; n < usages.length; n++) {\r\n if (!usages[n] || usages[n] === undefined) continue;\r\n if (usageSet.includes(usages[n] as KeyUsage))\r\n newset.push(usages[n] as KeyUsage);\r\n }\r\n return newset;\r\n};\r\n\r\nconst kKeyOps: {\r\n [key in KeyUsage]: number;\r\n} = {\r\n sign: 1,\r\n verify: 2,\r\n encrypt: 3,\r\n decrypt: 4,\r\n wrapKey: 5,\r\n unwrapKey: 6,\r\n deriveKey: 7,\r\n deriveBits: 8,\r\n encapsulateBits: 9,\r\n decapsulateBits: 10,\r\n encapsulateKey: 11,\r\n decapsulateKey: 12,\r\n};\r\n\r\nexport const validateKeyOps = (\r\n keyOps: KeyUsage[] | undefined,\r\n usagesSet: KeyUsage[],\r\n) => {\r\n if (keyOps === undefined) return;\r\n if (!Array.isArray(keyOps)) {\r\n throw lazyDOMException('keyData.key_ops', 'InvalidArgument');\r\n }\r\n let flags = 0;\r\n for (let n = 0; n < keyOps.length; n++) {\r\n const op: KeyUsage = keyOps[n] as KeyUsage;\r\n const op_flag = kKeyOps[op];\r\n // Skipping unknown key ops\r\n if (op_flag === undefined) continue;\r\n // Have we seen it already? if so, error\r\n if (flags & (1 << op_flag))\r\n throw lazyDOMException('Duplicate key operation', 'DataError');\r\n flags |= 1 << op_flag;\r\n\r\n // TODO(@jasnell): RFC7517 section 4.3 strong recommends validating\r\n // key usage combinations. Specifically, it says that unrelated key\r\n // ops SHOULD NOT be used together. We're not yet validating that here.\r\n }\r\n\r\n if (usagesSet !== undefined) {\r\n for (const use of usagesSet) {\r\n if (!keyOps.includes(use)) {\r\n throw lazyDOMException(\r\n 'Key operations and usage mismatch',\r\n 'DataError',\r\n );\r\n }\r\n }\r\n }\r\n};\r\n\r\nexport function hasAnyNotIn(set: string[], checks: string[]) {\r\n for (const s of set) {\r\n if (!checks.includes(s)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n"],"mappings":"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","ignoreList":[]}
|