@btc-vision/transaction 1.8.0-beta.1 → 1.8.0-beta.4
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/browser/_version.d.ts +1 -0
- package/browser/_version.d.ts.map +1 -0
- package/browser/abi/ABICoder.d.ts +1 -1
- package/browser/abi/ABICoder.d.ts.map +1 -0
- package/browser/branded/Branded.d.ts +4 -0
- package/browser/branded/Branded.d.ts.map +1 -0
- package/browser/btc-vision-bitcoin.js +12420 -3637
- package/browser/buffer/BinaryReader.d.ts +120 -1
- package/browser/buffer/BinaryReader.d.ts.map +1 -0
- package/browser/buffer/BinaryWriter.d.ts +51 -1
- package/browser/buffer/BinaryWriter.d.ts.map +1 -0
- package/browser/bytecode/Compressor.d.ts +12 -0
- package/browser/bytecode/Compressor.d.ts.map +1 -0
- package/browser/chain/ChainData.d.ts +2 -2
- package/browser/chain/ChainData.d.ts.map +1 -0
- package/browser/consensus/Consensus.d.ts +11 -3
- package/browser/consensus/Consensus.d.ts.map +1 -0
- package/browser/consensus/ConsensusConfig.d.ts +1 -0
- package/browser/consensus/ConsensusConfig.d.ts.map +1 -0
- package/browser/consensus/IConsensusConfig.d.ts +1 -0
- package/browser/consensus/IConsensusConfig.d.ts.map +1 -0
- package/browser/consensus/metadata/RoswellConsensus.d.ts +1 -0
- package/browser/consensus/metadata/RoswellConsensus.d.ts.map +1 -0
- package/browser/crypto/crypto.d.ts +1 -0
- package/browser/crypto/crypto.d.ts.map +1 -0
- package/browser/deterministic/AddressMap.d.ts +6 -1
- package/browser/deterministic/AddressMap.d.ts.map +1 -0
- package/browser/deterministic/AddressSet.d.ts +3 -1
- package/browser/deterministic/AddressSet.d.ts.map +1 -0
- package/browser/deterministic/CustomMap.d.ts +3 -1
- package/browser/deterministic/CustomMap.d.ts.map +1 -0
- package/browser/deterministic/DeterministicMap.d.ts +3 -1
- package/browser/deterministic/DeterministicMap.d.ts.map +1 -0
- package/browser/deterministic/DeterministicSet.d.ts +3 -1
- package/browser/deterministic/DeterministicSet.d.ts.map +1 -0
- package/browser/deterministic/ExtendedAddressMap.d.ts +7 -1
- package/browser/deterministic/ExtendedAddressMap.d.ts.map +1 -0
- package/browser/deterministic/FastMap.d.ts +7 -1
- package/browser/deterministic/FastMap.d.ts.map +1 -0
- package/browser/ecc/backend.d.ts +13 -0
- package/browser/ecc/backend.d.ts.map +1 -0
- package/browser/epoch/ChallengeSolution.d.ts +33 -1
- package/browser/epoch/ChallengeSolution.d.ts.map +1 -0
- package/browser/epoch/interfaces/IChallengeSolution.d.ts +14 -13
- package/browser/epoch/interfaces/IChallengeSolution.d.ts.map +1 -0
- package/browser/epoch/validator/EpochValidator.d.ts +37 -7
- package/browser/epoch/validator/EpochValidator.d.ts.map +1 -0
- package/browser/event/NetEvent.d.ts +1 -0
- package/browser/event/NetEvent.d.ts.map +1 -0
- package/browser/generators/AddressGenerator.d.ts +4 -3
- package/browser/generators/AddressGenerator.d.ts.map +1 -0
- package/browser/generators/Features.d.ts +1 -0
- package/browser/generators/Features.d.ts.map +1 -0
- package/browser/generators/Generator.d.ts +46 -10
- package/browser/generators/Generator.d.ts.map +1 -0
- package/browser/generators/MLDSAData.d.ts +1 -0
- package/browser/generators/MLDSAData.d.ts.map +1 -0
- package/browser/generators/builders/CalldataGenerator.d.ts +25 -4
- package/browser/generators/builders/CalldataGenerator.d.ts.map +1 -0
- package/browser/generators/builders/CustomGenerator.d.ts +13 -3
- package/browser/generators/builders/CustomGenerator.d.ts.map +1 -0
- package/browser/generators/builders/DeploymentGenerator.d.ts +15 -4
- package/browser/generators/builders/DeploymentGenerator.d.ts.map +1 -0
- package/browser/generators/builders/HashCommitmentGenerator.d.ts +164 -12
- package/browser/generators/builders/HashCommitmentGenerator.d.ts.map +1 -0
- package/browser/generators/builders/LegacyCalldataGenerator.d.ts +26 -4
- package/browser/generators/builders/LegacyCalldataGenerator.d.ts.map +1 -0
- package/browser/generators/builders/MultiSignGenerator.d.ts +6 -1
- package/browser/generators/builders/MultiSignGenerator.d.ts.map +1 -0
- package/browser/generators/builders/P2WDAGenerator.d.ts +42 -4
- package/browser/generators/builders/P2WDAGenerator.d.ts.map +1 -0
- package/browser/index.d.ts +1 -0
- package/browser/index.d.ts.map +1 -0
- package/browser/index.js +3602 -3203
- package/browser/keypair/Address.d.ts +283 -13
- package/browser/keypair/Address.d.ts.map +1 -0
- package/browser/keypair/AddressVerificator.d.ts +7 -6
- package/browser/keypair/AddressVerificator.d.ts.map +1 -0
- package/browser/keypair/EcKeyPair.d.ts +183 -21
- package/browser/keypair/EcKeyPair.d.ts.map +1 -0
- package/browser/keypair/MessageSigner.d.ts +17 -16
- package/browser/keypair/MessageSigner.d.ts.map +1 -0
- package/browser/keypair/Secp256k1PointDeriver.d.ts +55 -0
- package/browser/keypair/Secp256k1PointDeriver.d.ts.map +1 -0
- package/browser/keypair/Wallet.d.ts +27 -13
- package/browser/keypair/Wallet.d.ts.map +1 -0
- package/browser/keypair/interfaces/IWallet.d.ts +19 -0
- package/browser/keypair/interfaces/IWallet.d.ts.map +1 -0
- package/browser/metadata/ContractBaseMetadata.d.ts +10 -2
- package/browser/metadata/ContractBaseMetadata.d.ts.map +1 -0
- package/browser/mnemonic/BIPStandard.d.ts +59 -0
- package/browser/mnemonic/BIPStandard.d.ts.map +1 -0
- package/browser/mnemonic/Mnemonic.d.ts +15 -3
- package/browser/mnemonic/Mnemonic.d.ts.map +1 -0
- package/browser/mnemonic/MnemonicStrength.d.ts +6 -0
- package/browser/mnemonic/MnemonicStrength.d.ts.map +1 -0
- package/browser/network/ChainId.d.ts +1 -0
- package/browser/network/ChainId.d.ts.map +1 -0
- package/browser/noble-curves.js +920 -2966
- package/browser/noble-hashes.js +2067 -1038
- package/browser/opnet.d.ts +22 -1
- package/browser/opnet.d.ts.map +1 -0
- package/browser/p2wda/P2WDADetector.d.ts +36 -9
- package/browser/p2wda/P2WDADetector.d.ts.map +1 -0
- package/browser/polyfill/disposable.d.ts +16 -0
- package/browser/polyfill/disposable.d.ts.map +1 -0
- package/browser/signer/AddressRotation.d.ts +36 -0
- package/browser/signer/AddressRotation.d.ts.map +1 -0
- package/browser/signer/IRotationSigner.d.ts +27 -3
- package/browser/signer/IRotationSigner.d.ts.map +1 -0
- package/browser/signer/ParallelSignerAdapter.d.ts +14 -0
- package/browser/signer/ParallelSignerAdapter.d.ts.map +1 -0
- package/browser/signer/SignerUtils.d.ts +11 -4
- package/browser/signer/SignerUtils.d.ts.map +1 -0
- package/browser/signer/TweakedSigner.d.ts +28 -4
- package/browser/signer/TweakedSigner.d.ts.map +1 -0
- package/browser/transaction/ContractAddress.d.ts +2 -2
- package/browser/transaction/ContractAddress.d.ts.map +1 -0
- package/browser/transaction/TransactionFactory.d.ts +140 -2
- package/browser/transaction/TransactionFactory.d.ts.map +1 -0
- package/browser/transaction/browser/BrowserSignerBase.d.ts +12 -6
- package/browser/transaction/browser/BrowserSignerBase.d.ts.map +1 -0
- package/browser/transaction/browser/WalletNetworks.d.ts +1 -0
- package/browser/transaction/browser/WalletNetworks.d.ts.map +1 -0
- package/browser/transaction/browser/Web3Provider.d.ts +27 -0
- package/browser/transaction/browser/Web3Provider.d.ts.map +1 -0
- package/browser/transaction/browser/extensions/UnisatSigner.d.ts +9 -7
- package/browser/transaction/browser/extensions/UnisatSigner.d.ts.map +1 -0
- package/browser/transaction/browser/extensions/XverseSigner.d.ts +9 -7
- package/browser/transaction/browser/extensions/XverseSigner.d.ts.map +1 -0
- package/browser/transaction/browser/types/OPWallet.d.ts +10 -0
- package/browser/transaction/browser/types/OPWallet.d.ts.map +1 -0
- package/browser/transaction/browser/types/Unisat.d.ts +1 -0
- package/browser/transaction/browser/types/Unisat.d.ts.map +1 -0
- package/browser/transaction/browser/types/Xverse.d.ts +1 -0
- package/browser/transaction/browser/types/Xverse.d.ts.map +1 -0
- package/browser/transaction/builders/CancelTransaction.d.ts +29 -4
- package/browser/transaction/builders/CancelTransaction.d.ts.map +1 -0
- package/browser/transaction/builders/ChallengeSolutionTransaction.d.ts +1 -0
- package/browser/transaction/builders/ChallengeSolutionTransaction.d.ts.map +1 -0
- package/browser/transaction/builders/ConsolidatedInteractionTransaction.d.ts +137 -10
- package/browser/transaction/builders/ConsolidatedInteractionTransaction.d.ts.map +1 -0
- package/browser/transaction/builders/CustomScriptTransaction.d.ts +106 -6
- package/browser/transaction/builders/CustomScriptTransaction.d.ts.map +1 -0
- package/browser/transaction/builders/DeploymentTransaction.d.ts +116 -5
- package/browser/transaction/builders/DeploymentTransaction.d.ts.map +1 -0
- package/browser/transaction/builders/FundingTransaction.d.ts +4 -3
- package/browser/transaction/builders/FundingTransaction.d.ts.map +1 -0
- package/browser/transaction/builders/InteractionTransaction.d.ts +12 -3
- package/browser/transaction/builders/InteractionTransaction.d.ts.map +1 -0
- package/browser/transaction/builders/InteractionTransactionP2WDA.d.ts +56 -5
- package/browser/transaction/builders/InteractionTransactionP2WDA.d.ts.map +1 -0
- package/browser/transaction/builders/MultiSignTransaction.d.ts +125 -16
- package/browser/transaction/builders/MultiSignTransaction.d.ts.map +1 -0
- package/browser/transaction/builders/SharedInteractionTransaction.d.ts +103 -15
- package/browser/transaction/builders/SharedInteractionTransaction.d.ts.map +1 -0
- package/browser/transaction/builders/TransactionBuilder.d.ts +243 -14
- package/browser/transaction/builders/TransactionBuilder.d.ts.map +1 -0
- package/browser/transaction/enums/TransactionType.d.ts +1 -0
- package/browser/transaction/enums/TransactionType.d.ts.map +1 -0
- package/browser/transaction/interfaces/ICancelTransactionParameters.d.ts +2 -1
- package/browser/transaction/interfaces/ICancelTransactionParameters.d.ts.map +1 -0
- package/browser/transaction/interfaces/IConsolidatedTransactionParameters.d.ts +46 -3
- package/browser/transaction/interfaces/IConsolidatedTransactionParameters.d.ts.map +1 -0
- package/browser/transaction/interfaces/ICustomTransactionParameters.d.ts +6 -4
- package/browser/transaction/interfaces/ICustomTransactionParameters.d.ts.map +1 -0
- package/browser/transaction/interfaces/ITransactionParameters.d.ts +22 -10
- package/browser/transaction/interfaces/ITransactionParameters.d.ts.map +1 -0
- package/browser/transaction/interfaces/ITransactionResponses.d.ts +1 -0
- package/browser/transaction/interfaces/ITransactionResponses.d.ts.map +1 -0
- package/browser/transaction/interfaces/ITweakedTransactionData.d.ts +18 -5
- package/browser/transaction/interfaces/ITweakedTransactionData.d.ts.map +1 -0
- package/browser/transaction/interfaces/IWeb3ProviderTypes.d.ts +26 -0
- package/browser/transaction/interfaces/IWeb3ProviderTypes.d.ts.map +1 -0
- package/browser/transaction/interfaces/Tap.d.ts +4 -3
- package/browser/transaction/interfaces/Tap.d.ts.map +1 -0
- package/browser/transaction/mineable/IP2WSHAddress.d.ts +2 -1
- package/browser/transaction/mineable/IP2WSHAddress.d.ts.map +1 -0
- package/browser/transaction/mineable/TimelockGenerator.d.ts +12 -3
- package/browser/transaction/mineable/TimelockGenerator.d.ts.map +1 -0
- package/browser/transaction/offline/OfflineTransactionManager.d.ts +190 -9
- package/browser/transaction/offline/OfflineTransactionManager.d.ts.map +1 -0
- package/browser/transaction/offline/TransactionReconstructor.d.ts +53 -3
- package/browser/transaction/offline/TransactionReconstructor.d.ts.map +1 -0
- package/browser/transaction/offline/TransactionSerializer.d.ts +53 -2
- package/browser/transaction/offline/TransactionSerializer.d.ts.map +1 -0
- package/browser/transaction/offline/TransactionStateCapture.d.ts +64 -5
- package/browser/transaction/offline/TransactionStateCapture.d.ts.map +1 -0
- package/browser/transaction/offline/interfaces/ISerializableState.d.ts +71 -0
- package/browser/transaction/offline/interfaces/ISerializableState.d.ts.map +1 -0
- package/browser/transaction/offline/interfaces/ITypeSpecificData.d.ts +76 -0
- package/browser/transaction/offline/interfaces/ITypeSpecificData.d.ts.map +1 -0
- package/browser/transaction/psbt/PSBTTypes.d.ts +1 -0
- package/browser/transaction/psbt/PSBTTypes.d.ts.map +1 -0
- package/browser/transaction/shared/P2TR_MS.d.ts +11 -2
- package/browser/transaction/shared/P2TR_MS.d.ts.map +1 -0
- package/browser/transaction/shared/TweakedTransaction.d.ts +275 -33
- package/browser/transaction/shared/TweakedTransaction.d.ts.map +1 -0
- package/browser/transaction/utils/WitnessUtils.d.ts +7 -1
- package/browser/transaction/utils/WitnessUtils.d.ts.map +1 -0
- package/browser/utils/BitcoinUtils.d.ts +19 -0
- package/browser/utils/BitcoinUtils.d.ts.map +1 -0
- package/browser/utils/BufferHelper.d.ts +1 -0
- package/browser/utils/BufferHelper.d.ts.map +1 -0
- package/browser/utils/StringToBuffer.d.ts +1 -0
- package/browser/utils/StringToBuffer.d.ts.map +1 -0
- package/browser/utils/lengths.d.ts +1 -0
- package/browser/utils/lengths.d.ts.map +1 -0
- package/browser/utils/types.d.ts +1 -0
- package/browser/utils/types.d.ts.map +1 -0
- package/browser/utxo/OPNetLimitedProvider.d.ts +37 -1
- package/browser/utxo/OPNetLimitedProvider.d.ts.map +1 -0
- package/browser/utxo/interfaces/BroadcastResponse.d.ts +1 -0
- package/browser/utxo/interfaces/BroadcastResponse.d.ts.map +1 -0
- package/browser/utxo/interfaces/IUTXO.d.ts +11 -5
- package/browser/utxo/interfaces/IUTXO.d.ts.map +1 -0
- package/browser/vendors.js +13940 -9389
- package/browser/verification/TapscriptVerificator.d.ts +10 -8
- package/browser/verification/TapscriptVerificator.d.ts.map +1 -0
- package/build/_version.d.ts +1 -0
- package/build/_version.d.ts.map +1 -0
- package/build/_version.js +1 -0
- package/build/_version.js.map +1 -0
- package/build/abi/ABICoder.d.ts +1 -1
- package/build/abi/ABICoder.d.ts.map +1 -0
- package/build/abi/ABICoder.js +9 -10
- package/build/abi/ABICoder.js.map +1 -0
- package/build/branded/Branded.d.ts +4 -0
- package/build/branded/Branded.d.ts.map +1 -0
- package/build/branded/Branded.js +2 -0
- package/build/branded/Branded.js.map +1 -0
- package/build/buffer/BinaryReader.d.ts +121 -2
- package/build/buffer/BinaryReader.d.ts.map +1 -0
- package/build/buffer/BinaryReader.js +129 -5
- package/build/buffer/BinaryReader.js.map +1 -0
- package/build/buffer/BinaryWriter.d.ts +52 -2
- package/build/buffer/BinaryWriter.d.ts.map +1 -0
- package/build/buffer/BinaryWriter.js +62 -2
- package/build/buffer/BinaryWriter.js.map +1 -0
- package/build/bytecode/Compressor.d.ts +12 -0
- package/build/bytecode/Compressor.d.ts.map +1 -0
- package/build/bytecode/Compressor.js +17 -5
- package/build/bytecode/Compressor.js.map +1 -0
- package/build/chain/ChainData.d.ts +2 -2
- package/build/chain/ChainData.d.ts.map +1 -0
- package/build/chain/ChainData.js +35 -17
- package/build/chain/ChainData.js.map +1 -0
- package/build/consensus/Consensus.d.ts +11 -3
- package/build/consensus/Consensus.d.ts.map +1 -0
- package/build/consensus/Consensus.js +8 -0
- package/build/consensus/Consensus.js.map +1 -0
- package/build/consensus/ConsensusConfig.d.ts +2 -1
- package/build/consensus/ConsensusConfig.d.ts.map +1 -0
- package/build/consensus/ConsensusConfig.js +1 -0
- package/build/consensus/ConsensusConfig.js.map +1 -0
- package/build/consensus/IConsensusConfig.d.ts +1 -0
- package/build/consensus/IConsensusConfig.d.ts.map +1 -0
- package/build/consensus/IConsensusConfig.js +2 -1
- package/build/consensus/IConsensusConfig.js.map +1 -0
- package/build/consensus/metadata/RoswellConsensus.d.ts +2 -1
- package/build/consensus/metadata/RoswellConsensus.d.ts.map +1 -0
- package/build/consensus/metadata/RoswellConsensus.js +2 -0
- package/build/consensus/metadata/RoswellConsensus.js.map +1 -0
- package/build/crypto/crypto.d.ts +1 -0
- package/build/crypto/crypto.d.ts.map +1 -0
- package/build/crypto/crypto.js +1 -0
- package/build/crypto/crypto.js.map +1 -0
- package/build/deterministic/AddressMap.d.ts +6 -1
- package/build/deterministic/AddressMap.d.ts.map +1 -0
- package/build/deterministic/AddressMap.js +8 -0
- package/build/deterministic/AddressMap.js.map +1 -0
- package/build/deterministic/AddressSet.d.ts +3 -1
- package/build/deterministic/AddressSet.d.ts.map +1 -0
- package/build/deterministic/AddressSet.js +7 -0
- package/build/deterministic/AddressSet.js.map +1 -0
- package/build/deterministic/CustomMap.d.ts +3 -1
- package/build/deterministic/CustomMap.d.ts.map +1 -0
- package/build/deterministic/CustomMap.js +65 -47
- package/build/deterministic/CustomMap.js.map +1 -0
- package/build/deterministic/DeterministicMap.d.ts +4 -2
- package/build/deterministic/DeterministicMap.d.ts.map +1 -0
- package/build/deterministic/DeterministicMap.js +24 -27
- package/build/deterministic/DeterministicMap.js.map +1 -0
- package/build/deterministic/DeterministicSet.d.ts +3 -1
- package/build/deterministic/DeterministicSet.d.ts.map +1 -0
- package/build/deterministic/DeterministicSet.js +6 -0
- package/build/deterministic/DeterministicSet.js.map +1 -0
- package/build/deterministic/ExtendedAddressMap.d.ts +7 -1
- package/build/deterministic/ExtendedAddressMap.d.ts.map +1 -0
- package/build/deterministic/ExtendedAddressMap.js +18 -2
- package/build/deterministic/ExtendedAddressMap.js.map +1 -0
- package/build/deterministic/FastMap.d.ts +7 -1
- package/build/deterministic/FastMap.d.ts.map +1 -0
- package/build/deterministic/FastMap.js +7 -2
- package/build/deterministic/FastMap.js.map +1 -0
- package/build/ecc/backend.d.ts +13 -0
- package/build/ecc/backend.d.ts.map +1 -0
- package/build/ecc/backend.js +15 -0
- package/build/ecc/backend.js.map +1 -0
- package/build/epoch/ChallengeSolution.d.ts +34 -2
- package/build/epoch/ChallengeSolution.d.ts.map +1 -0
- package/build/epoch/ChallengeSolution.js +52 -0
- package/build/epoch/ChallengeSolution.js.map +1 -0
- package/build/epoch/interfaces/IChallengeSolution.d.ts +14 -13
- package/build/epoch/interfaces/IChallengeSolution.d.ts.map +1 -0
- package/build/epoch/interfaces/IChallengeSolution.js +2 -1
- package/build/epoch/interfaces/IChallengeSolution.js.map +1 -0
- package/build/epoch/validator/EpochValidator.d.ts +38 -8
- package/build/epoch/validator/EpochValidator.d.ts.map +1 -0
- package/build/epoch/validator/EpochValidator.js +45 -19
- package/build/epoch/validator/EpochValidator.js.map +1 -0
- package/build/event/NetEvent.d.ts +1 -0
- package/build/event/NetEvent.d.ts.map +1 -0
- package/build/event/NetEvent.js +3 -0
- package/build/event/NetEvent.js.map +1 -0
- package/build/generators/AddressGenerator.d.ts +4 -3
- package/build/generators/AddressGenerator.d.ts.map +1 -0
- package/build/generators/AddressGenerator.js +10 -3
- package/build/generators/AddressGenerator.js.map +1 -0
- package/build/generators/Features.d.ts +4 -3
- package/build/generators/Features.d.ts.map +1 -0
- package/build/generators/Features.js +1 -0
- package/build/generators/Features.js.map +1 -0
- package/build/generators/Generator.d.ts +47 -11
- package/build/generators/Generator.d.ts.map +1 -0
- package/build/generators/Generator.js +48 -12
- package/build/generators/Generator.js.map +1 -0
- package/build/generators/MLDSAData.d.ts +1 -0
- package/build/generators/MLDSAData.d.ts.map +1 -0
- package/build/generators/MLDSAData.js +1 -0
- package/build/generators/MLDSAData.js.map +1 -0
- package/build/generators/builders/CalldataGenerator.d.ts +27 -6
- package/build/generators/builders/CalldataGenerator.d.ts.map +1 -0
- package/build/generators/builders/CalldataGenerator.js +33 -4
- package/build/generators/builders/CalldataGenerator.js.map +1 -0
- package/build/generators/builders/CustomGenerator.d.ts +13 -3
- package/build/generators/builders/CustomGenerator.d.ts.map +1 -0
- package/build/generators/builders/CustomGenerator.js +11 -0
- package/build/generators/builders/CustomGenerator.js.map +1 -0
- package/build/generators/builders/DeploymentGenerator.d.ts +17 -6
- package/build/generators/builders/DeploymentGenerator.d.ts.map +1 -0
- package/build/generators/builders/DeploymentGenerator.js +18 -2
- package/build/generators/builders/DeploymentGenerator.js.map +1 -0
- package/build/generators/builders/HashCommitmentGenerator.d.ts +166 -14
- package/build/generators/builders/HashCommitmentGenerator.d.ts.map +1 -0
- package/build/generators/builders/HashCommitmentGenerator.js +193 -27
- package/build/generators/builders/HashCommitmentGenerator.js.map +1 -0
- package/build/generators/builders/LegacyCalldataGenerator.d.ts +27 -5
- package/build/generators/builders/LegacyCalldataGenerator.d.ts.map +1 -0
- package/build/generators/builders/LegacyCalldataGenerator.js +35 -5
- package/build/generators/builders/LegacyCalldataGenerator.js.map +1 -0
- package/build/generators/builders/MultiSignGenerator.d.ts +6 -1
- package/build/generators/builders/MultiSignGenerator.d.ts.map +1 -0
- package/build/generators/builders/MultiSignGenerator.js +20 -10
- package/build/generators/builders/MultiSignGenerator.js.map +1 -0
- package/build/generators/builders/P2WDAGenerator.d.ts +44 -6
- package/build/generators/builders/P2WDAGenerator.d.ts.map +1 -0
- package/build/generators/builders/P2WDAGenerator.js +41 -2
- package/build/generators/builders/P2WDAGenerator.js.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +1 -0
- package/build/index.js.map +1 -0
- package/build/keypair/Address.d.ts +284 -14
- package/build/keypair/Address.d.ts.map +1 -0
- package/build/keypair/Address.js +447 -129
- package/build/keypair/Address.js.map +1 -0
- package/build/keypair/AddressVerificator.d.ts +7 -6
- package/build/keypair/AddressVerificator.d.ts.map +1 -0
- package/build/keypair/AddressVerificator.js +6 -5
- package/build/keypair/AddressVerificator.js.map +1 -0
- package/build/keypair/EcKeyPair.d.ts +185 -23
- package/build/keypair/EcKeyPair.d.ts.map +1 -0
- package/build/keypair/EcKeyPair.js +223 -54
- package/build/keypair/EcKeyPair.js.map +1 -0
- package/build/keypair/MessageSigner.d.ts +18 -17
- package/build/keypair/MessageSigner.d.ts.map +1 -0
- package/build/keypair/MessageSigner.js +34 -25
- package/build/keypair/MessageSigner.js.map +1 -0
- package/build/keypair/Secp256k1PointDeriver.d.ts +55 -0
- package/build/keypair/Secp256k1PointDeriver.d.ts.map +1 -0
- package/build/keypair/Secp256k1PointDeriver.js +66 -0
- package/build/keypair/Secp256k1PointDeriver.js.map +1 -0
- package/build/keypair/Wallet.d.ts +29 -15
- package/build/keypair/Wallet.d.ts.map +1 -0
- package/build/keypair/Wallet.js +48 -14
- package/build/keypair/Wallet.js.map +1 -0
- package/build/keypair/interfaces/IWallet.d.ts +19 -0
- package/build/keypair/interfaces/IWallet.d.ts.map +1 -0
- package/build/keypair/interfaces/IWallet.js +1 -0
- package/build/keypair/interfaces/IWallet.js.map +1 -0
- package/build/metadata/ContractBaseMetadata.d.ts +10 -2
- package/build/metadata/ContractBaseMetadata.d.ts.map +1 -0
- package/build/metadata/ContractBaseMetadata.js +10 -1
- package/build/metadata/ContractBaseMetadata.js.map +1 -0
- package/build/mnemonic/BIPStandard.d.ts +59 -0
- package/build/mnemonic/BIPStandard.d.ts.map +1 -0
- package/build/mnemonic/BIPStandard.js +59 -0
- package/build/mnemonic/BIPStandard.js.map +1 -0
- package/build/mnemonic/Mnemonic.d.ts +16 -4
- package/build/mnemonic/Mnemonic.d.ts.map +1 -0
- package/build/mnemonic/Mnemonic.js +36 -8
- package/build/mnemonic/Mnemonic.js.map +1 -0
- package/build/mnemonic/MnemonicStrength.d.ts +6 -0
- package/build/mnemonic/MnemonicStrength.d.ts.map +1 -0
- package/build/mnemonic/MnemonicStrength.js +6 -0
- package/build/mnemonic/MnemonicStrength.js.map +1 -0
- package/build/network/ChainId.d.ts +1 -0
- package/build/network/ChainId.d.ts.map +1 -0
- package/build/network/ChainId.js +1 -0
- package/build/network/ChainId.js.map +1 -0
- package/build/opnet.d.ts +26 -3
- package/build/opnet.d.ts.map +1 -0
- package/build/opnet.js +23 -0
- package/build/opnet.js.map +1 -0
- package/build/p2wda/P2WDADetector.d.ts +38 -11
- package/build/p2wda/P2WDADetector.d.ts.map +1 -0
- package/build/p2wda/P2WDADetector.js +43 -10
- package/build/p2wda/P2WDADetector.js.map +1 -0
- package/build/polyfill/disposable.d.ts +16 -0
- package/build/polyfill/disposable.d.ts.map +1 -0
- package/build/polyfill/disposable.js +23 -0
- package/build/polyfill/disposable.js.map +1 -0
- package/build/signer/AddressRotation.d.ts +37 -1
- package/build/signer/AddressRotation.d.ts.map +1 -0
- package/build/signer/AddressRotation.js +16 -0
- package/build/signer/AddressRotation.js.map +1 -0
- package/build/signer/IRotationSigner.d.ts +27 -3
- package/build/signer/IRotationSigner.d.ts.map +1 -0
- package/build/signer/IRotationSigner.js +2 -1
- package/build/signer/IRotationSigner.js.map +1 -0
- package/build/signer/ParallelSignerAdapter.d.ts +14 -0
- package/build/signer/ParallelSignerAdapter.d.ts.map +1 -0
- package/build/signer/ParallelSignerAdapter.js +51 -0
- package/build/signer/ParallelSignerAdapter.js.map +1 -0
- package/build/signer/SignerUtils.d.ts +11 -4
- package/build/signer/SignerUtils.d.ts.map +1 -0
- package/build/signer/SignerUtils.js +16 -0
- package/build/signer/SignerUtils.js.map +1 -0
- package/build/signer/TweakedSigner.d.ts +28 -4
- package/build/signer/TweakedSigner.d.ts.map +1 -0
- package/build/signer/TweakedSigner.js +24 -6
- package/build/signer/TweakedSigner.js.map +1 -0
- package/build/transaction/ContractAddress.d.ts +2 -2
- package/build/transaction/ContractAddress.d.ts.map +1 -0
- package/build/transaction/ContractAddress.js +4 -8
- package/build/transaction/ContractAddress.js.map +1 -0
- package/build/transaction/TransactionFactory.d.ts +147 -9
- package/build/transaction/TransactionFactory.d.ts.map +1 -0
- package/build/transaction/TransactionFactory.js +145 -26
- package/build/transaction/TransactionFactory.js.map +1 -0
- package/build/transaction/browser/BrowserSignerBase.d.ts +12 -6
- package/build/transaction/browser/BrowserSignerBase.d.ts.map +1 -0
- package/build/transaction/browser/BrowserSignerBase.js +7 -0
- package/build/transaction/browser/BrowserSignerBase.js.map +1 -0
- package/build/transaction/browser/WalletNetworks.d.ts +1 -0
- package/build/transaction/browser/WalletNetworks.d.ts.map +1 -0
- package/build/transaction/browser/WalletNetworks.js +1 -0
- package/build/transaction/browser/WalletNetworks.js.map +1 -0
- package/build/transaction/browser/Web3Provider.d.ts +30 -3
- package/build/transaction/browser/Web3Provider.d.ts.map +1 -0
- package/build/transaction/browser/Web3Provider.js +1 -0
- package/build/transaction/browser/Web3Provider.js.map +1 -0
- package/build/transaction/browser/extensions/UnisatSigner.d.ts +11 -9
- package/build/transaction/browser/extensions/UnisatSigner.d.ts.map +1 -0
- package/build/transaction/browser/extensions/UnisatSigner.js +27 -17
- package/build/transaction/browser/extensions/UnisatSigner.js.map +1 -0
- package/build/transaction/browser/extensions/XverseSigner.d.ts +10 -8
- package/build/transaction/browser/extensions/XverseSigner.d.ts.map +1 -0
- package/build/transaction/browser/extensions/XverseSigner.js +25 -15
- package/build/transaction/browser/extensions/XverseSigner.js.map +1 -0
- package/build/transaction/browser/types/OPWallet.d.ts +12 -2
- package/build/transaction/browser/types/OPWallet.d.ts.map +1 -0
- package/build/transaction/browser/types/OPWallet.js +4 -0
- package/build/transaction/browser/types/OPWallet.js.map +1 -0
- package/build/transaction/browser/types/Unisat.d.ts +2 -1
- package/build/transaction/browser/types/Unisat.d.ts.map +1 -0
- package/build/transaction/browser/types/Unisat.js +2 -0
- package/build/transaction/browser/types/Unisat.js.map +1 -0
- package/build/transaction/browser/types/Xverse.d.ts +1 -0
- package/build/transaction/browser/types/Xverse.d.ts.map +1 -0
- package/build/transaction/browser/types/Xverse.js +1 -0
- package/build/transaction/browser/types/Xverse.js.map +1 -0
- package/build/transaction/builders/CancelTransaction.d.ts +31 -6
- package/build/transaction/builders/CancelTransaction.d.ts.map +1 -0
- package/build/transaction/builders/CancelTransaction.js +116 -33
- package/build/transaction/builders/CancelTransaction.js.map +1 -0
- package/build/transaction/builders/ChallengeSolutionTransaction.d.ts +1 -0
- package/build/transaction/builders/ChallengeSolutionTransaction.d.ts.map +1 -0
- package/build/transaction/builders/ChallengeSolutionTransaction.js +88 -0
- package/build/transaction/builders/ChallengeSolutionTransaction.js.map +1 -0
- package/build/transaction/builders/ConsolidatedInteractionTransaction.d.ts +140 -13
- package/build/transaction/builders/ConsolidatedInteractionTransaction.d.ts.map +1 -0
- package/build/transaction/builders/ConsolidatedInteractionTransaction.js +197 -20
- package/build/transaction/builders/ConsolidatedInteractionTransaction.js.map +1 -0
- package/build/transaction/builders/CustomScriptTransaction.d.ts +108 -8
- package/build/transaction/builders/CustomScriptTransaction.d.ts.map +1 -0
- package/build/transaction/builders/CustomScriptTransaction.js +176 -39
- package/build/transaction/builders/CustomScriptTransaction.js.map +1 -0
- package/build/transaction/builders/DeploymentTransaction.d.ts +120 -9
- package/build/transaction/builders/DeploymentTransaction.d.ts.map +1 -0
- package/build/transaction/builders/DeploymentTransaction.js +194 -51
- package/build/transaction/builders/DeploymentTransaction.js.map +1 -0
- package/build/transaction/builders/FundingTransaction.d.ts +5 -4
- package/build/transaction/builders/FundingTransaction.d.ts.map +1 -0
- package/build/transaction/builders/FundingTransaction.js +15 -8
- package/build/transaction/builders/FundingTransaction.js.map +1 -0
- package/build/transaction/builders/InteractionTransaction.d.ts +14 -5
- package/build/transaction/builders/InteractionTransaction.d.ts.map +1 -0
- package/build/transaction/builders/InteractionTransaction.js +18 -5
- package/build/transaction/builders/InteractionTransaction.js.map +1 -0
- package/build/transaction/builders/InteractionTransactionP2WDA.d.ts +58 -7
- package/build/transaction/builders/InteractionTransactionP2WDA.d.ts.map +1 -0
- package/build/transaction/builders/InteractionTransactionP2WDA.js +95 -18
- package/build/transaction/builders/InteractionTransactionP2WDA.js.map +1 -0
- package/build/transaction/builders/MultiSignTransaction.d.ts +126 -17
- package/build/transaction/builders/MultiSignTransaction.d.ts.map +1 -0
- package/build/transaction/builders/MultiSignTransaction.js +201 -76
- package/build/transaction/builders/MultiSignTransaction.js.map +1 -0
- package/build/transaction/builders/SharedInteractionTransaction.d.ts +106 -18
- package/build/transaction/builders/SharedInteractionTransaction.d.ts.map +1 -0
- package/build/transaction/builders/SharedInteractionTransaction.js +158 -40
- package/build/transaction/builders/SharedInteractionTransaction.js.map +1 -0
- package/build/transaction/builders/TransactionBuilder.d.ts +249 -19
- package/build/transaction/builders/TransactionBuilder.d.ts.map +1 -0
- package/build/transaction/builders/TransactionBuilder.js +377 -60
- package/build/transaction/builders/TransactionBuilder.js.map +1 -0
- package/build/transaction/enums/TransactionType.d.ts +1 -0
- package/build/transaction/enums/TransactionType.d.ts.map +1 -0
- package/build/transaction/enums/TransactionType.js +1 -0
- package/build/transaction/enums/TransactionType.js.map +1 -0
- package/build/transaction/interfaces/ICancelTransactionParameters.d.ts +3 -2
- package/build/transaction/interfaces/ICancelTransactionParameters.d.ts.map +1 -0
- package/build/transaction/interfaces/ICancelTransactionParameters.js +1 -0
- package/build/transaction/interfaces/ICancelTransactionParameters.js.map +1 -0
- package/build/transaction/interfaces/IConsolidatedTransactionParameters.d.ts +48 -5
- package/build/transaction/interfaces/IConsolidatedTransactionParameters.d.ts.map +1 -0
- package/build/transaction/interfaces/IConsolidatedTransactionParameters.js +1 -0
- package/build/transaction/interfaces/IConsolidatedTransactionParameters.js.map +1 -0
- package/build/transaction/interfaces/ICustomTransactionParameters.d.ts +7 -5
- package/build/transaction/interfaces/ICustomTransactionParameters.d.ts.map +1 -0
- package/build/transaction/interfaces/ICustomTransactionParameters.js +1 -0
- package/build/transaction/interfaces/ICustomTransactionParameters.js.map +1 -0
- package/build/transaction/interfaces/ITransactionParameters.d.ts +27 -15
- package/build/transaction/interfaces/ITransactionParameters.d.ts.map +1 -0
- package/build/transaction/interfaces/ITransactionParameters.js +1 -0
- package/build/transaction/interfaces/ITransactionParameters.js.map +1 -0
- package/build/transaction/interfaces/ITransactionResponses.d.ts +3 -2
- package/build/transaction/interfaces/ITransactionResponses.d.ts.map +1 -0
- package/build/transaction/interfaces/ITransactionResponses.js +1 -0
- package/build/transaction/interfaces/ITransactionResponses.js.map +1 -0
- package/build/transaction/interfaces/ITweakedTransactionData.d.ts +21 -8
- package/build/transaction/interfaces/ITweakedTransactionData.d.ts.map +1 -0
- package/build/transaction/interfaces/ITweakedTransactionData.js +1 -0
- package/build/transaction/interfaces/ITweakedTransactionData.js.map +1 -0
- package/build/transaction/interfaces/IWeb3ProviderTypes.d.ts +29 -3
- package/build/transaction/interfaces/IWeb3ProviderTypes.d.ts.map +1 -0
- package/build/transaction/interfaces/IWeb3ProviderTypes.js +2 -1
- package/build/transaction/interfaces/IWeb3ProviderTypes.js.map +1 -0
- package/build/transaction/interfaces/Tap.d.ts +4 -3
- package/build/transaction/interfaces/Tap.d.ts.map +1 -0
- package/build/transaction/interfaces/Tap.js +1 -0
- package/build/transaction/interfaces/Tap.js.map +1 -0
- package/build/transaction/mineable/IP2WSHAddress.d.ts +2 -1
- package/build/transaction/mineable/IP2WSHAddress.d.ts.map +1 -0
- package/build/transaction/mineable/IP2WSHAddress.js +1 -0
- package/build/transaction/mineable/IP2WSHAddress.js.map +1 -0
- package/build/transaction/mineable/TimelockGenerator.d.ts +13 -4
- package/build/transaction/mineable/TimelockGenerator.d.ts.map +1 -0
- package/build/transaction/mineable/TimelockGenerator.js +12 -3
- package/build/transaction/mineable/TimelockGenerator.js.map +1 -0
- package/build/transaction/offline/OfflineTransactionManager.d.ts +193 -12
- package/build/transaction/offline/OfflineTransactionManager.d.ts.map +1 -0
- package/build/transaction/offline/OfflineTransactionManager.js +192 -8
- package/build/transaction/offline/OfflineTransactionManager.js.map +1 -0
- package/build/transaction/offline/TransactionReconstructor.d.ts +56 -6
- package/build/transaction/offline/TransactionReconstructor.d.ts.map +1 -0
- package/build/transaction/offline/TransactionReconstructor.js +111 -75
- package/build/transaction/offline/TransactionReconstructor.js.map +1 -0
- package/build/transaction/offline/TransactionSerializer.d.ts +54 -3
- package/build/transaction/offline/TransactionSerializer.d.ts.map +1 -0
- package/build/transaction/offline/TransactionSerializer.js +206 -95
- package/build/transaction/offline/TransactionSerializer.js.map +1 -0
- package/build/transaction/offline/TransactionStateCapture.d.ts +66 -7
- package/build/transaction/offline/TransactionStateCapture.d.ts.map +1 -0
- package/build/transaction/offline/TransactionStateCapture.js +124 -60
- package/build/transaction/offline/TransactionStateCapture.js.map +1 -0
- package/build/transaction/offline/interfaces/ISerializableState.d.ts +72 -1
- package/build/transaction/offline/interfaces/ISerializableState.d.ts.map +1 -0
- package/build/transaction/offline/interfaces/ISerializableState.js +10 -1
- package/build/transaction/offline/interfaces/ISerializableState.js.map +1 -0
- package/build/transaction/offline/interfaces/ITypeSpecificData.d.ts +77 -1
- package/build/transaction/offline/interfaces/ITypeSpecificData.d.ts.map +1 -0
- package/build/transaction/offline/interfaces/ITypeSpecificData.js +19 -0
- package/build/transaction/offline/interfaces/ITypeSpecificData.js.map +1 -0
- package/build/transaction/psbt/PSBTTypes.d.ts +1 -0
- package/build/transaction/psbt/PSBTTypes.d.ts.map +1 -0
- package/build/transaction/psbt/PSBTTypes.js +1 -0
- package/build/transaction/psbt/PSBTTypes.js.map +1 -0
- package/build/transaction/shared/P2TR_MS.d.ts +11 -2
- package/build/transaction/shared/P2TR_MS.d.ts.map +1 -0
- package/build/transaction/shared/P2TR_MS.js +10 -0
- package/build/transaction/shared/P2TR_MS.js.map +1 -0
- package/build/transaction/shared/TweakedTransaction.d.ts +281 -38
- package/build/transaction/shared/TweakedTransaction.d.ts.map +1 -0
- package/build/transaction/shared/TweakedTransaction.js +576 -114
- package/build/transaction/shared/TweakedTransaction.js.map +1 -0
- package/build/transaction/utils/WitnessUtils.d.ts +7 -1
- package/build/transaction/utils/WitnessUtils.d.ts.map +1 -0
- package/build/transaction/utils/WitnessUtils.js +17 -3
- package/build/transaction/utils/WitnessUtils.js.map +1 -0
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/build/utils/BitcoinUtils.d.ts +19 -0
- package/build/utils/BitcoinUtils.d.ts.map +1 -0
- package/build/utils/BitcoinUtils.js +19 -0
- package/build/utils/BitcoinUtils.js.map +1 -0
- package/build/utils/BufferHelper.d.ts +2 -1
- package/build/utils/BufferHelper.d.ts.map +1 -0
- package/build/utils/BufferHelper.js +38 -32
- package/build/utils/BufferHelper.js.map +1 -0
- package/build/utils/StringToBuffer.d.ts +1 -0
- package/build/utils/StringToBuffer.d.ts.map +1 -0
- package/build/utils/StringToBuffer.js +1 -0
- package/build/utils/StringToBuffer.js.map +1 -0
- package/build/utils/lengths.d.ts +1 -0
- package/build/utils/lengths.d.ts.map +1 -0
- package/build/utils/lengths.js +1 -0
- package/build/utils/lengths.js.map +1 -0
- package/build/utils/types.d.ts +1 -0
- package/build/utils/types.d.ts.map +1 -0
- package/build/utils/types.js +2 -1
- package/build/utils/types.js.map +1 -0
- package/build/utxo/OPNetLimitedProvider.d.ts +39 -3
- package/build/utxo/OPNetLimitedProvider.d.ts.map +1 -0
- package/build/utxo/OPNetLimitedProvider.js +41 -3
- package/build/utxo/OPNetLimitedProvider.js.map +1 -0
- package/build/utxo/interfaces/BroadcastResponse.d.ts +1 -0
- package/build/utxo/interfaces/BroadcastResponse.d.ts.map +1 -0
- package/build/utxo/interfaces/BroadcastResponse.js +1 -0
- package/build/utxo/interfaces/BroadcastResponse.js.map +1 -0
- package/build/utxo/interfaces/IUTXO.d.ts +13 -7
- package/build/utxo/interfaces/IUTXO.d.ts.map +1 -0
- package/build/utxo/interfaces/IUTXO.js +1 -0
- package/build/utxo/interfaces/IUTXO.js.map +1 -0
- package/build/verification/TapscriptVerificator.d.ts +12 -10
- package/build/verification/TapscriptVerificator.d.ts.map +1 -0
- package/build/verification/TapscriptVerificator.js +28 -38
- package/build/verification/TapscriptVerificator.js.map +1 -0
- package/eslint.config.js +0 -1
- package/package.json +16 -39
- package/src/abi/ABICoder.ts +0 -13
- package/src/branded/Branded.ts +5 -0
- package/src/buffer/BinaryReader.ts +7 -7
- package/src/buffer/BinaryWriter.ts +29 -24
- package/src/bytecode/Compressor.ts +1 -1
- package/src/chain/ChainData.ts +34 -27
- package/src/consensus/ConsensusConfig.ts +1 -1
- package/src/consensus/IConsensusConfig.ts +0 -17
- package/src/consensus/metadata/RoswellConsensus.ts +1 -17
- package/src/crypto/crypto-browser.js +3 -4
- package/src/deterministic/AddressMap.ts +5 -1
- package/src/deterministic/AddressSet.ts +5 -1
- package/src/deterministic/CustomMap.ts +6 -2
- package/src/deterministic/DeterministicMap.ts +8 -4
- package/src/deterministic/DeterministicSet.ts +6 -2
- package/src/deterministic/ExtendedAddressMap.ts +9 -4
- package/src/deterministic/FastMap.ts +9 -5
- package/src/ecc/backend.ts +17 -0
- package/src/epoch/ChallengeSolution.ts +3 -3
- package/src/epoch/interfaces/IChallengeSolution.ts +13 -13
- package/src/epoch/validator/EpochValidator.ts +24 -43
- package/src/generators/AddressGenerator.ts +6 -6
- package/src/generators/Features.ts +3 -3
- package/src/generators/Generator.ts +42 -26
- package/src/generators/builders/CalldataGenerator.ts +26 -24
- package/src/generators/builders/CustomGenerator.ts +4 -4
- package/src/generators/builders/DeploymentGenerator.ts +25 -23
- package/src/generators/builders/HashCommitmentGenerator.ts +31 -31
- package/src/generators/builders/LegacyCalldataGenerator.ts +26 -24
- package/src/generators/builders/MultiSignGenerator.ts +12 -12
- package/src/generators/builders/P2WDAGenerator.ts +10 -10
- package/src/keypair/Address.ts +115 -72
- package/src/keypair/AddressVerificator.ts +16 -147
- package/src/keypair/EcKeyPair.ts +109 -118
- package/src/keypair/MessageSigner.ts +70 -150
- package/src/keypair/Wallet.ts +59 -240
- package/src/metadata/ContractBaseMetadata.ts +2 -2
- package/src/mnemonic/Mnemonic.ts +32 -221
- package/src/opnet.ts +12 -6
- package/src/p2wda/P2WDADetector.ts +23 -72
- package/src/polyfill/disposable.ts +29 -0
- package/src/signer/AddressRotation.ts +1 -1
- package/src/signer/IRotationSigner.ts +3 -3
- package/src/signer/ParallelSignerAdapter.ts +59 -0
- package/src/signer/SignerUtils.ts +4 -4
- package/src/signer/TweakedSigner.ts +28 -13
- package/src/transaction/ContractAddress.ts +3 -7
- package/src/transaction/TransactionFactory.ts +28 -50
- package/src/transaction/browser/BrowserSignerBase.ts +12 -6
- package/src/transaction/browser/Web3Provider.ts +3 -3
- package/src/transaction/browser/extensions/UnisatSigner.ts +52 -48
- package/src/transaction/browser/extensions/XverseSigner.ts +55 -38
- package/src/transaction/browser/types/OPWallet.ts +2 -2
- package/src/transaction/browser/types/Unisat.ts +1 -1
- package/src/transaction/builders/CancelTransaction.ts +59 -24
- package/src/transaction/builders/ChallengeSolutionTransaction.ts +3 -3
- package/src/transaction/builders/ConsolidatedInteractionTransaction.ts +39 -34
- package/src/transaction/builders/CustomScriptTransaction.ts +79 -56
- package/src/transaction/builders/DeploymentTransaction.ts +82 -63
- package/src/transaction/builders/FundingTransaction.ts +11 -11
- package/src/transaction/builders/InteractionTransaction.ts +10 -10
- package/src/transaction/builders/InteractionTransactionP2WDA.ts +38 -40
- package/src/transaction/builders/MultiSignTransaction.ts +68 -61
- package/src/transaction/builders/SharedInteractionTransaction.ts +81 -57
- package/src/transaction/builders/TransactionBuilder.ts +101 -79
- package/src/transaction/interfaces/ICancelTransactionParameters.ts +2 -2
- package/src/transaction/interfaces/IConsolidatedTransactionParameters.ts +5 -5
- package/src/transaction/interfaces/ICustomTransactionParameters.ts +5 -5
- package/src/transaction/interfaces/ITransactionParameters.ts +15 -15
- package/src/transaction/interfaces/ITransactionResponses.ts +2 -2
- package/src/transaction/interfaces/ITweakedTransactionData.ts +17 -8
- package/src/transaction/interfaces/IWeb3ProviderTypes.ts +3 -3
- package/src/transaction/interfaces/Tap.ts +3 -3
- package/src/transaction/mineable/IP2WSHAddress.ts +1 -1
- package/src/transaction/mineable/TimelockGenerator.ts +19 -12
- package/src/transaction/offline/OfflineTransactionManager.ts +22 -23
- package/src/transaction/offline/TransactionReconstructor.ts +83 -91
- package/src/transaction/offline/TransactionSerializer.ts +151 -101
- package/src/transaction/offline/TransactionStateCapture.ts +83 -79
- package/src/transaction/offline/interfaces/ISerializableState.ts +1 -1
- package/src/transaction/offline/interfaces/ITypeSpecificData.ts +1 -1
- package/src/transaction/shared/P2TR_MS.ts +4 -4
- package/src/transaction/shared/TweakedTransaction.ts +326 -124
- package/src/transaction/utils/WitnessUtils.ts +18 -9
- package/src/utils/BufferHelper.ts +39 -37
- package/src/utxo/OPNetLimitedProvider.ts +7 -7
- package/src/utxo/interfaces/IUTXO.ts +7 -7
- package/src/verification/TapscriptVerificator.ts +73 -86
- package/test/address-rotation.test.ts +24 -24
- package/test/address.test.ts +12 -12
- package/test/addressmap.test.ts +30 -30
- package/test/binary-reader-writer.test.ts +8 -8
- package/test/browser/offline-transaction.test.ts +2206 -0
- package/test/browser/parallel-signing.test.ts +316 -0
- package/test/browser/setup.ts +11 -0
- package/test/browser/transaction-signing.test.ts +416 -0
- package/test/buffer-helper.test.ts +287 -0
- package/test/derivePath.test.ts +4 -3
- package/test/disposable.test.ts +279 -0
- package/test/fastmap-setall.test.ts +1 -1
- package/test/fastmap.test.ts +3 -3
- package/test/messagesigner-mldsa.test.ts +3 -3
- package/test/messagesigner-schnorr.test.ts +9 -9
- package/test/offline-transaction.test.ts +461 -288
- package/test/old/FastBigIntMap.ts +3 -3
- package/test/oldfastmap.test.ts +6 -6
- package/test/transaction-builders.test.ts +321 -0
- package/tsconfig.base.json +34 -18
- package/tsconfig.browser.json +15 -0
- package/tsconfig.json +3 -8
- package/vite.config.browser.ts +4 -5
- package/vitest.config.browser.ts +68 -0
- package/vitest.config.ts +1 -1
- package/browser/valibot.js +0 -4948
- package/tsconfig.webpack.json +0 -18
package/browser/noble-hashes.js
CHANGED
|
@@ -1,187 +1,487 @@
|
|
|
1
|
-
|
|
2
|
-
function Ae(t) {
|
|
1
|
+
function t0(t) {
|
|
3
2
|
return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
|
|
4
3
|
}
|
|
5
|
-
function
|
|
6
|
-
if (!
|
|
7
|
-
throw new Error("positive integer expected, got " + t);
|
|
8
|
-
}
|
|
9
|
-
function ht(t, ...e) {
|
|
10
|
-
if (!Ae(t))
|
|
4
|
+
function Zt(t, ...e) {
|
|
5
|
+
if (!t0(t))
|
|
11
6
|
throw new Error("Uint8Array expected");
|
|
12
7
|
if (e.length > 0 && !e.includes(t.length))
|
|
13
8
|
throw new Error("Uint8Array expected of length " + e + ", got length=" + t.length);
|
|
14
9
|
}
|
|
15
|
-
function
|
|
10
|
+
function ee(t, e = !0) {
|
|
11
|
+
if (t.destroyed)
|
|
12
|
+
throw new Error("Hash instance has been destroyed");
|
|
13
|
+
if (e && t.finished)
|
|
14
|
+
throw new Error("Hash#digest() has already been called");
|
|
15
|
+
}
|
|
16
|
+
function e0(t, e) {
|
|
17
|
+
Zt(t);
|
|
18
|
+
const s = e.outputLen;
|
|
19
|
+
if (t.length < s)
|
|
20
|
+
throw new Error("digestInto() expects output buffer of length at least " + s);
|
|
21
|
+
}
|
|
22
|
+
function Yt(...t) {
|
|
23
|
+
for (let e = 0; e < t.length; e++)
|
|
24
|
+
t[e].fill(0);
|
|
25
|
+
}
|
|
26
|
+
function qt(t) {
|
|
27
|
+
return new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
28
|
+
}
|
|
29
|
+
function rt(t, e) {
|
|
30
|
+
return t << 32 - e | t >>> e;
|
|
31
|
+
}
|
|
32
|
+
function s0(t) {
|
|
33
|
+
if (typeof t != "string")
|
|
34
|
+
throw new Error("string expected");
|
|
35
|
+
return new Uint8Array(new TextEncoder().encode(t));
|
|
36
|
+
}
|
|
37
|
+
function Ie(t) {
|
|
38
|
+
return typeof t == "string" && (t = s0(t)), Zt(t), t;
|
|
39
|
+
}
|
|
40
|
+
class n0 {
|
|
41
|
+
}
|
|
42
|
+
function r0(t) {
|
|
43
|
+
const e = (o) => t().update(Ie(o)).digest(), s = t();
|
|
44
|
+
return e.outputLen = s.outputLen, e.blockLen = s.blockLen, e.create = () => t(), e;
|
|
45
|
+
}
|
|
46
|
+
function i0(t, e, s, o) {
|
|
47
|
+
if (typeof t.setBigUint64 == "function")
|
|
48
|
+
return t.setBigUint64(e, s, o);
|
|
49
|
+
const i = BigInt(32), c = BigInt(4294967295), r = Number(s >> i & c), a = Number(s & c), d = o ? 4 : 0, x = o ? 0 : 4;
|
|
50
|
+
t.setUint32(e + d, r, o), t.setUint32(e + x, a, o);
|
|
51
|
+
}
|
|
52
|
+
function c0(t, e, s) {
|
|
53
|
+
return t & e ^ ~t & s;
|
|
54
|
+
}
|
|
55
|
+
function o0(t, e, s) {
|
|
56
|
+
return t & e ^ t & s ^ e & s;
|
|
57
|
+
}
|
|
58
|
+
let a0 = class extends n0 {
|
|
59
|
+
constructor(e, s, o, i) {
|
|
60
|
+
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = e, this.outputLen = s, this.padOffset = o, this.isLE = i, this.buffer = new Uint8Array(e), this.view = qt(this.buffer);
|
|
61
|
+
}
|
|
62
|
+
update(e) {
|
|
63
|
+
ee(this), e = Ie(e), Zt(e);
|
|
64
|
+
const { view: s, buffer: o, blockLen: i } = this, c = e.length;
|
|
65
|
+
for (let r = 0; r < c; ) {
|
|
66
|
+
const a = Math.min(i - this.pos, c - r);
|
|
67
|
+
if (a === i) {
|
|
68
|
+
const d = qt(e);
|
|
69
|
+
for (; i <= c - r; r += i)
|
|
70
|
+
this.process(d, r);
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
o.set(e.subarray(r, r + a), this.pos), this.pos += a, r += a, this.pos === i && (this.process(s, 0), this.pos = 0);
|
|
74
|
+
}
|
|
75
|
+
return this.length += e.length, this.roundClean(), this;
|
|
76
|
+
}
|
|
77
|
+
digestInto(e) {
|
|
78
|
+
ee(this), e0(e, this), this.finished = !0;
|
|
79
|
+
const { buffer: s, view: o, blockLen: i, isLE: c } = this;
|
|
80
|
+
let { pos: r } = this;
|
|
81
|
+
s[r++] = 128, Yt(this.buffer.subarray(r)), this.padOffset > i - r && (this.process(o, 0), r = 0);
|
|
82
|
+
for (let f = r; f < i; f++)
|
|
83
|
+
s[f] = 0;
|
|
84
|
+
i0(o, i - 8, BigInt(this.length * 8), c), this.process(o, 0);
|
|
85
|
+
const a = qt(e), d = this.outputLen;
|
|
86
|
+
if (d % 4)
|
|
87
|
+
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
88
|
+
const x = d / 4, H = this.get();
|
|
89
|
+
if (x > H.length)
|
|
90
|
+
throw new Error("_sha2: outputLen bigger than state");
|
|
91
|
+
for (let f = 0; f < x; f++)
|
|
92
|
+
a.setUint32(4 * f, H[f], c);
|
|
93
|
+
}
|
|
94
|
+
digest() {
|
|
95
|
+
const { buffer: e, outputLen: s } = this;
|
|
96
|
+
this.digestInto(e);
|
|
97
|
+
const o = e.slice(0, s);
|
|
98
|
+
return this.destroy(), o;
|
|
99
|
+
}
|
|
100
|
+
_cloneInto(e) {
|
|
101
|
+
e || (e = new this.constructor()), e.set(...this.get());
|
|
102
|
+
const { blockLen: s, buffer: o, length: i, finished: c, destroyed: r, pos: a } = this;
|
|
103
|
+
return e.destroyed = r, e.finished = c, e.length = i, e.pos = a, i % s && e.buffer.set(o), e;
|
|
104
|
+
}
|
|
105
|
+
clone() {
|
|
106
|
+
return this._cloneInto();
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
const dt = /* @__PURE__ */ Uint32Array.from([
|
|
110
|
+
1779033703,
|
|
111
|
+
3144134277,
|
|
112
|
+
1013904242,
|
|
113
|
+
2773480762,
|
|
114
|
+
1359893119,
|
|
115
|
+
2600822924,
|
|
116
|
+
528734635,
|
|
117
|
+
1541459225
|
|
118
|
+
]), h0 = /* @__PURE__ */ Uint32Array.from([
|
|
119
|
+
1116352408,
|
|
120
|
+
1899447441,
|
|
121
|
+
3049323471,
|
|
122
|
+
3921009573,
|
|
123
|
+
961987163,
|
|
124
|
+
1508970993,
|
|
125
|
+
2453635748,
|
|
126
|
+
2870763221,
|
|
127
|
+
3624381080,
|
|
128
|
+
310598401,
|
|
129
|
+
607225278,
|
|
130
|
+
1426881987,
|
|
131
|
+
1925078388,
|
|
132
|
+
2162078206,
|
|
133
|
+
2614888103,
|
|
134
|
+
3248222580,
|
|
135
|
+
3835390401,
|
|
136
|
+
4022224774,
|
|
137
|
+
264347078,
|
|
138
|
+
604807628,
|
|
139
|
+
770255983,
|
|
140
|
+
1249150122,
|
|
141
|
+
1555081692,
|
|
142
|
+
1996064986,
|
|
143
|
+
2554220882,
|
|
144
|
+
2821834349,
|
|
145
|
+
2952996808,
|
|
146
|
+
3210313671,
|
|
147
|
+
3336571891,
|
|
148
|
+
3584528711,
|
|
149
|
+
113926993,
|
|
150
|
+
338241895,
|
|
151
|
+
666307205,
|
|
152
|
+
773529912,
|
|
153
|
+
1294757372,
|
|
154
|
+
1396182291,
|
|
155
|
+
1695183700,
|
|
156
|
+
1986661051,
|
|
157
|
+
2177026350,
|
|
158
|
+
2456956037,
|
|
159
|
+
2730485921,
|
|
160
|
+
2820302411,
|
|
161
|
+
3259730800,
|
|
162
|
+
3345764771,
|
|
163
|
+
3516065817,
|
|
164
|
+
3600352804,
|
|
165
|
+
4094571909,
|
|
166
|
+
275423344,
|
|
167
|
+
430227734,
|
|
168
|
+
506948616,
|
|
169
|
+
659060556,
|
|
170
|
+
883997877,
|
|
171
|
+
958139571,
|
|
172
|
+
1322822218,
|
|
173
|
+
1537002063,
|
|
174
|
+
1747873779,
|
|
175
|
+
1955562222,
|
|
176
|
+
2024104815,
|
|
177
|
+
2227730452,
|
|
178
|
+
2361852424,
|
|
179
|
+
2428436474,
|
|
180
|
+
2756734187,
|
|
181
|
+
3204031479,
|
|
182
|
+
3329325298
|
|
183
|
+
]), ut = /* @__PURE__ */ new Uint32Array(64);
|
|
184
|
+
class f0 extends a0 {
|
|
185
|
+
constructor(e = 32) {
|
|
186
|
+
super(64, e, 8, !1), this.A = dt[0] | 0, this.B = dt[1] | 0, this.C = dt[2] | 0, this.D = dt[3] | 0, this.E = dt[4] | 0, this.F = dt[5] | 0, this.G = dt[6] | 0, this.H = dt[7] | 0;
|
|
187
|
+
}
|
|
188
|
+
get() {
|
|
189
|
+
const { A: e, B: s, C: o, D: i, E: c, F: r, G: a, H: d } = this;
|
|
190
|
+
return [e, s, o, i, c, r, a, d];
|
|
191
|
+
}
|
|
192
|
+
// prettier-ignore
|
|
193
|
+
set(e, s, o, i, c, r, a, d) {
|
|
194
|
+
this.A = e | 0, this.B = s | 0, this.C = o | 0, this.D = i | 0, this.E = c | 0, this.F = r | 0, this.G = a | 0, this.H = d | 0;
|
|
195
|
+
}
|
|
196
|
+
process(e, s) {
|
|
197
|
+
for (let f = 0; f < 16; f++, s += 4)
|
|
198
|
+
ut[f] = e.getUint32(s, !1);
|
|
199
|
+
for (let f = 16; f < 64; f++) {
|
|
200
|
+
const g = ut[f - 15], w = ut[f - 2], S = rt(g, 7) ^ rt(g, 18) ^ g >>> 3, I = rt(w, 17) ^ rt(w, 19) ^ w >>> 10;
|
|
201
|
+
ut[f] = I + ut[f - 7] + S + ut[f - 16] | 0;
|
|
202
|
+
}
|
|
203
|
+
let { A: o, B: i, C: c, D: r, E: a, F: d, G: x, H } = this;
|
|
204
|
+
for (let f = 0; f < 64; f++) {
|
|
205
|
+
const g = rt(a, 6) ^ rt(a, 11) ^ rt(a, 25), w = H + g + c0(a, d, x) + h0[f] + ut[f] | 0, I = (rt(o, 2) ^ rt(o, 13) ^ rt(o, 22)) + o0(o, i, c) | 0;
|
|
206
|
+
H = x, x = d, d = a, a = r + w | 0, r = c, c = i, i = o, o = w + I | 0;
|
|
207
|
+
}
|
|
208
|
+
o = o + this.A | 0, i = i + this.B | 0, c = c + this.C | 0, r = r + this.D | 0, a = a + this.E | 0, d = d + this.F | 0, x = x + this.G | 0, H = H + this.H | 0, this.set(o, i, c, r, a, d, x, H);
|
|
209
|
+
}
|
|
210
|
+
roundClean() {
|
|
211
|
+
Yt(ut);
|
|
212
|
+
}
|
|
213
|
+
destroy() {
|
|
214
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0), Yt(this.buffer);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
const d0 = /* @__PURE__ */ r0(() => new f0()), Hs = d0;
|
|
218
|
+
function As(t) {
|
|
219
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
220
|
+
}
|
|
221
|
+
function zt(t) {
|
|
222
|
+
if (Object.prototype.hasOwnProperty.call(t, "__esModule")) return t;
|
|
223
|
+
var e = t.default;
|
|
224
|
+
if (typeof e == "function") {
|
|
225
|
+
var s = function o() {
|
|
226
|
+
var i = !1;
|
|
227
|
+
try {
|
|
228
|
+
i = this instanceof o;
|
|
229
|
+
} catch {
|
|
230
|
+
}
|
|
231
|
+
return i ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
|
|
232
|
+
};
|
|
233
|
+
s.prototype = e.prototype;
|
|
234
|
+
} else s = {};
|
|
235
|
+
return Object.defineProperty(s, "__esModule", { value: !0 }), Object.keys(t).forEach(function(o) {
|
|
236
|
+
var i = Object.getOwnPropertyDescriptor(t, o);
|
|
237
|
+
Object.defineProperty(s, o, i.get ? i : {
|
|
238
|
+
enumerable: !0,
|
|
239
|
+
get: function() {
|
|
240
|
+
return t[o];
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
}), s;
|
|
244
|
+
}
|
|
245
|
+
function u0(t) {
|
|
246
|
+
return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
|
|
247
|
+
}
|
|
248
|
+
function Gt(t, e = "") {
|
|
249
|
+
if (!Number.isSafeInteger(t) || t < 0) {
|
|
250
|
+
const s = e && `"${e}" `;
|
|
251
|
+
throw new Error(`${s}expected integer >= 0, got ${t}`);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
function _t(t, e, s = "") {
|
|
255
|
+
const o = u0(t), i = t?.length, c = e !== void 0;
|
|
256
|
+
if (!o || c && i !== e) {
|
|
257
|
+
const r = s && `"${s}" `, a = c ? ` of length ${e}` : "", d = o ? `length=${i}` : `type=${typeof t}`;
|
|
258
|
+
throw new Error(r + "expected Uint8Array" + a + ", got " + d);
|
|
259
|
+
}
|
|
260
|
+
return t;
|
|
261
|
+
}
|
|
262
|
+
function l0(t) {
|
|
16
263
|
if (typeof t != "function" || typeof t.create != "function")
|
|
17
|
-
throw new Error("Hash
|
|
18
|
-
|
|
264
|
+
throw new Error("Hash must wrapped by utils.createHasher");
|
|
265
|
+
Gt(t.outputLen), Gt(t.blockLen);
|
|
19
266
|
}
|
|
20
|
-
function
|
|
267
|
+
function mt(t, e = !0) {
|
|
21
268
|
if (t.destroyed)
|
|
22
269
|
throw new Error("Hash instance has been destroyed");
|
|
23
270
|
if (e && t.finished)
|
|
24
271
|
throw new Error("Hash#digest() has already been called");
|
|
25
272
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
273
|
+
function Le(t, e) {
|
|
274
|
+
_t(t, void 0, "digestInto() output");
|
|
28
275
|
const s = e.outputLen;
|
|
29
276
|
if (t.length < s)
|
|
30
|
-
throw new Error("digestInto()
|
|
277
|
+
throw new Error('"digestInto() output" expected to be of length >=' + s);
|
|
278
|
+
}
|
|
279
|
+
function b0(t) {
|
|
280
|
+
return new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
|
|
31
281
|
}
|
|
32
|
-
function
|
|
282
|
+
function tt(...t) {
|
|
33
283
|
for (let e = 0; e < t.length; e++)
|
|
34
284
|
t[e].fill(0);
|
|
35
285
|
}
|
|
36
|
-
function
|
|
286
|
+
function Kt(t) {
|
|
37
287
|
return new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
38
288
|
}
|
|
39
|
-
function
|
|
289
|
+
function it(t, e) {
|
|
40
290
|
return t << 32 - e | t >>> e;
|
|
41
291
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
292
|
+
function yt(t, e) {
|
|
293
|
+
return t << e | t >>> 32 - e >>> 0;
|
|
294
|
+
}
|
|
295
|
+
const x0 = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
296
|
+
function H0(t) {
|
|
297
|
+
return t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
|
|
298
|
+
}
|
|
299
|
+
function A0(t) {
|
|
300
|
+
for (let e = 0; e < t.length; e++)
|
|
301
|
+
t[e] = H0(t[e]);
|
|
302
|
+
return t;
|
|
303
|
+
}
|
|
304
|
+
const se = x0 ? (t) => t : A0, me = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", p0 = /* @__PURE__ */ Array.from({ length: 256 }, (t, e) => e.toString(16).padStart(2, "0"));
|
|
305
|
+
function ps(t) {
|
|
306
|
+
if (_t(t), me)
|
|
45
307
|
return t.toHex();
|
|
46
308
|
let e = "";
|
|
47
309
|
for (let s = 0; s < t.length; s++)
|
|
48
|
-
e +=
|
|
310
|
+
e += p0[t[s]];
|
|
49
311
|
return e;
|
|
50
312
|
}
|
|
51
|
-
const
|
|
52
|
-
function
|
|
53
|
-
if (t >=
|
|
54
|
-
return t -
|
|
55
|
-
if (t >=
|
|
56
|
-
return t - (
|
|
57
|
-
if (t >=
|
|
58
|
-
return t - (
|
|
313
|
+
const ht = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
|
|
314
|
+
function ne(t) {
|
|
315
|
+
if (t >= ht._0 && t <= ht._9)
|
|
316
|
+
return t - ht._0;
|
|
317
|
+
if (t >= ht.A && t <= ht.F)
|
|
318
|
+
return t - (ht.A - 10);
|
|
319
|
+
if (t >= ht.a && t <= ht.f)
|
|
320
|
+
return t - (ht.a - 10);
|
|
59
321
|
}
|
|
60
|
-
function
|
|
322
|
+
function ys(t) {
|
|
61
323
|
if (typeof t != "string")
|
|
62
324
|
throw new Error("hex string expected, got " + typeof t);
|
|
63
|
-
if (
|
|
325
|
+
if (me)
|
|
64
326
|
return Uint8Array.fromHex(t);
|
|
65
327
|
const e = t.length, s = e / 2;
|
|
66
328
|
if (e % 2)
|
|
67
329
|
throw new Error("hex string expected, got unpadded hex of length " + e);
|
|
68
|
-
const
|
|
69
|
-
for (let
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
72
|
-
const
|
|
73
|
-
throw new Error('hex string expected, got non-hex character "' +
|
|
330
|
+
const o = new Uint8Array(s);
|
|
331
|
+
for (let i = 0, c = 0; i < s; i++, c += 2) {
|
|
332
|
+
const r = ne(t.charCodeAt(c)), a = ne(t.charCodeAt(c + 1));
|
|
333
|
+
if (r === void 0 || a === void 0) {
|
|
334
|
+
const d = t[c] + t[c + 1];
|
|
335
|
+
throw new Error('hex string expected, got non-hex character "' + d + '" at index ' + c);
|
|
74
336
|
}
|
|
75
|
-
i
|
|
337
|
+
o[i] = r * 16 + a;
|
|
76
338
|
}
|
|
77
|
-
return
|
|
78
|
-
}
|
|
79
|
-
function ee(t) {
|
|
80
|
-
if (typeof t != "string")
|
|
81
|
-
throw new Error("string expected");
|
|
82
|
-
return new Uint8Array(new TextEncoder().encode(t));
|
|
83
|
-
}
|
|
84
|
-
function Ut(t) {
|
|
85
|
-
return typeof t == "string" && (t = ee(t)), ht(t), t;
|
|
339
|
+
return o;
|
|
86
340
|
}
|
|
87
|
-
function
|
|
88
|
-
return typeof t == "string" && (t = ee(t)), ht(t), t;
|
|
89
|
-
}
|
|
90
|
-
function xs(...t) {
|
|
341
|
+
function _s(...t) {
|
|
91
342
|
let e = 0;
|
|
92
|
-
for (let
|
|
93
|
-
const
|
|
94
|
-
|
|
343
|
+
for (let o = 0; o < t.length; o++) {
|
|
344
|
+
const i = t[o];
|
|
345
|
+
_t(i), e += i.length;
|
|
95
346
|
}
|
|
96
347
|
const s = new Uint8Array(e);
|
|
97
|
-
for (let
|
|
98
|
-
const
|
|
99
|
-
s.set(
|
|
348
|
+
for (let o = 0, i = 0; o < t.length; o++) {
|
|
349
|
+
const c = t[o];
|
|
350
|
+
s.set(c, i), i += c.length;
|
|
100
351
|
}
|
|
101
352
|
return s;
|
|
102
353
|
}
|
|
103
|
-
function
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
return Object.assign(t, e);
|
|
107
|
-
}
|
|
108
|
-
class se {
|
|
109
|
-
}
|
|
110
|
-
function ne(t) {
|
|
111
|
-
const e = (i) => t().update(Ut(i)).digest(), s = t();
|
|
112
|
-
return e.outputLen = s.outputLen, e.blockLen = s.blockLen, e.create = () => t(), e;
|
|
354
|
+
function ct(t, e = {}) {
|
|
355
|
+
const s = (i, c) => t(c).update(i).digest(), o = t(void 0);
|
|
356
|
+
return s.outputLen = o.outputLen, s.blockLen = o.blockLen, s.create = (i) => t(i), Object.assign(s, e), Object.freeze(s);
|
|
113
357
|
}
|
|
114
|
-
function
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
throw new Error("crypto.getRandomValues must be defined");
|
|
358
|
+
function gs(t = 32) {
|
|
359
|
+
const e = typeof globalThis == "object" ? globalThis.crypto : null;
|
|
360
|
+
if (typeof e?.getRandomValues != "function")
|
|
361
|
+
throw new Error("crypto.getRandomValues must be defined");
|
|
362
|
+
return e.getRandomValues(new Uint8Array(t));
|
|
120
363
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
364
|
+
const gt = (t) => ({
|
|
365
|
+
oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, t])
|
|
366
|
+
});
|
|
367
|
+
class $t {
|
|
368
|
+
oHash;
|
|
369
|
+
iHash;
|
|
370
|
+
blockLen;
|
|
371
|
+
outputLen;
|
|
372
|
+
finished = !1;
|
|
373
|
+
destroyed = !1;
|
|
374
|
+
constructor(e, s) {
|
|
375
|
+
if (l0(e), _t(s, void 0, "key"), this.iHash = e.create(), typeof this.iHash.update != "function")
|
|
376
|
+
throw new Error("Expected instance of class which extends utils.Hash");
|
|
377
|
+
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
|
|
378
|
+
const o = this.blockLen, i = new Uint8Array(o);
|
|
379
|
+
i.set(s.length > o ? e.create().update(s).digest() : s);
|
|
380
|
+
for (let c = 0; c < i.length; c++)
|
|
381
|
+
i[c] ^= 54;
|
|
382
|
+
this.iHash.update(i), this.oHash = e.create();
|
|
383
|
+
for (let c = 0; c < i.length; c++)
|
|
384
|
+
i[c] ^= 106;
|
|
385
|
+
this.oHash.update(i), tt(i);
|
|
386
|
+
}
|
|
387
|
+
update(e) {
|
|
388
|
+
return mt(this), this.iHash.update(e), this;
|
|
389
|
+
}
|
|
390
|
+
digestInto(e) {
|
|
391
|
+
mt(this), _t(e, this.outputLen, "output"), this.finished = !0, this.iHash.digestInto(e), this.oHash.update(e), this.oHash.digestInto(e), this.destroy();
|
|
392
|
+
}
|
|
393
|
+
digest() {
|
|
394
|
+
const e = new Uint8Array(this.oHash.outputLen);
|
|
395
|
+
return this.digestInto(e), e;
|
|
396
|
+
}
|
|
397
|
+
_cloneInto(e) {
|
|
398
|
+
e ||= Object.create(Object.getPrototypeOf(this), {});
|
|
399
|
+
const { oHash: s, iHash: o, finished: i, destroyed: c, blockLen: r, outputLen: a } = this;
|
|
400
|
+
return e = e, e.finished = i, e.destroyed = c, e.blockLen = r, e.outputLen = a, e.oHash = s._cloneInto(e.oHash), e.iHash = o._cloneInto(e.iHash), e;
|
|
401
|
+
}
|
|
402
|
+
clone() {
|
|
403
|
+
return this._cloneInto();
|
|
404
|
+
}
|
|
405
|
+
destroy() {
|
|
406
|
+
this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
|
|
407
|
+
}
|
|
126
408
|
}
|
|
127
|
-
|
|
409
|
+
const Ue = (t, e, s) => new $t(t, e).update(s).digest();
|
|
410
|
+
Ue.create = (t, e) => new $t(t, e);
|
|
411
|
+
const y0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
412
|
+
__proto__: null,
|
|
413
|
+
_HMAC: $t,
|
|
414
|
+
hmac: Ue
|
|
415
|
+
}, Symbol.toStringTag, { value: "Module" })), Ss = /* @__PURE__ */ zt(y0);
|
|
416
|
+
function jt(t, e, s) {
|
|
128
417
|
return t & e ^ ~t & s;
|
|
129
418
|
}
|
|
130
|
-
function
|
|
419
|
+
function Ee(t, e, s) {
|
|
131
420
|
return t & e ^ t & s ^ e & s;
|
|
132
421
|
}
|
|
133
|
-
class
|
|
134
|
-
|
|
135
|
-
|
|
422
|
+
class kt {
|
|
423
|
+
blockLen;
|
|
424
|
+
outputLen;
|
|
425
|
+
padOffset;
|
|
426
|
+
isLE;
|
|
427
|
+
// For partial updates less than block size
|
|
428
|
+
buffer;
|
|
429
|
+
view;
|
|
430
|
+
finished = !1;
|
|
431
|
+
length = 0;
|
|
432
|
+
pos = 0;
|
|
433
|
+
destroyed = !1;
|
|
434
|
+
constructor(e, s, o, i) {
|
|
435
|
+
this.blockLen = e, this.outputLen = s, this.padOffset = o, this.isLE = i, this.buffer = new Uint8Array(e), this.view = Kt(this.buffer);
|
|
136
436
|
}
|
|
137
437
|
update(e) {
|
|
138
|
-
|
|
139
|
-
const { view: s, buffer:
|
|
140
|
-
for (let
|
|
141
|
-
const
|
|
142
|
-
if (
|
|
143
|
-
const
|
|
144
|
-
for (;
|
|
145
|
-
this.process(
|
|
438
|
+
mt(this), _t(e);
|
|
439
|
+
const { view: s, buffer: o, blockLen: i } = this, c = e.length;
|
|
440
|
+
for (let r = 0; r < c; ) {
|
|
441
|
+
const a = Math.min(i - this.pos, c - r);
|
|
442
|
+
if (a === i) {
|
|
443
|
+
const d = Kt(e);
|
|
444
|
+
for (; i <= c - r; r += i)
|
|
445
|
+
this.process(d, r);
|
|
146
446
|
continue;
|
|
147
447
|
}
|
|
148
|
-
|
|
448
|
+
o.set(e.subarray(r, r + a), this.pos), this.pos += a, r += a, this.pos === i && (this.process(s, 0), this.pos = 0);
|
|
149
449
|
}
|
|
150
450
|
return this.length += e.length, this.roundClean(), this;
|
|
151
451
|
}
|
|
152
452
|
digestInto(e) {
|
|
153
|
-
|
|
154
|
-
const { buffer: s, view:
|
|
155
|
-
let { pos:
|
|
156
|
-
s[
|
|
157
|
-
for (let
|
|
158
|
-
s[
|
|
159
|
-
|
|
160
|
-
const
|
|
161
|
-
if (
|
|
162
|
-
throw new Error("_sha2: outputLen
|
|
163
|
-
const x =
|
|
453
|
+
mt(this), Le(e, this), this.finished = !0;
|
|
454
|
+
const { buffer: s, view: o, blockLen: i, isLE: c } = this;
|
|
455
|
+
let { pos: r } = this;
|
|
456
|
+
s[r++] = 128, tt(this.buffer.subarray(r)), this.padOffset > i - r && (this.process(o, 0), r = 0);
|
|
457
|
+
for (let f = r; f < i; f++)
|
|
458
|
+
s[f] = 0;
|
|
459
|
+
o.setBigUint64(i - 8, BigInt(this.length * 8), c), this.process(o, 0);
|
|
460
|
+
const a = Kt(e), d = this.outputLen;
|
|
461
|
+
if (d % 4)
|
|
462
|
+
throw new Error("_sha2: outputLen must be aligned to 32bit");
|
|
463
|
+
const x = d / 4, H = this.get();
|
|
164
464
|
if (x > H.length)
|
|
165
465
|
throw new Error("_sha2: outputLen bigger than state");
|
|
166
|
-
for (let
|
|
167
|
-
|
|
466
|
+
for (let f = 0; f < x; f++)
|
|
467
|
+
a.setUint32(4 * f, H[f], c);
|
|
168
468
|
}
|
|
169
469
|
digest() {
|
|
170
470
|
const { buffer: e, outputLen: s } = this;
|
|
171
471
|
this.digestInto(e);
|
|
172
|
-
const
|
|
173
|
-
return this.destroy(),
|
|
472
|
+
const o = e.slice(0, s);
|
|
473
|
+
return this.destroy(), o;
|
|
174
474
|
}
|
|
175
475
|
_cloneInto(e) {
|
|
176
|
-
e
|
|
177
|
-
const { blockLen: s, buffer:
|
|
178
|
-
return e.destroyed =
|
|
476
|
+
e ||= new this.constructor(), e.set(...this.get());
|
|
477
|
+
const { blockLen: s, buffer: o, length: i, finished: c, destroyed: r, pos: a } = this;
|
|
478
|
+
return e.destroyed = r, e.finished = c, e.length = i, e.pos = a, i % s && e.buffer.set(o), e;
|
|
179
479
|
}
|
|
180
480
|
clone() {
|
|
181
481
|
return this._cloneInto();
|
|
182
482
|
}
|
|
183
483
|
}
|
|
184
|
-
const
|
|
484
|
+
const lt = /* @__PURE__ */ Uint32Array.from([
|
|
185
485
|
1779033703,
|
|
186
486
|
3144134277,
|
|
187
487
|
1013904242,
|
|
@@ -190,7 +490,33 @@ const st = /* @__PURE__ */ Uint32Array.from([
|
|
|
190
490
|
2600822924,
|
|
191
491
|
528734635,
|
|
192
492
|
1541459225
|
|
193
|
-
]),
|
|
493
|
+
]), bt = /* @__PURE__ */ Uint32Array.from([
|
|
494
|
+
3238371032,
|
|
495
|
+
914150663,
|
|
496
|
+
812702999,
|
|
497
|
+
4144912697,
|
|
498
|
+
4290775857,
|
|
499
|
+
1750603025,
|
|
500
|
+
1694076839,
|
|
501
|
+
3204075428
|
|
502
|
+
]), J = /* @__PURE__ */ Uint32Array.from([
|
|
503
|
+
3418070365,
|
|
504
|
+
3238371032,
|
|
505
|
+
1654270250,
|
|
506
|
+
914150663,
|
|
507
|
+
2438529370,
|
|
508
|
+
812702999,
|
|
509
|
+
355462360,
|
|
510
|
+
4144912697,
|
|
511
|
+
1731405415,
|
|
512
|
+
4290775857,
|
|
513
|
+
2394180231,
|
|
514
|
+
1750603025,
|
|
515
|
+
3675008525,
|
|
516
|
+
1694076839,
|
|
517
|
+
1203062813,
|
|
518
|
+
3204075428
|
|
519
|
+
]), Q = /* @__PURE__ */ Uint32Array.from([
|
|
194
520
|
1779033703,
|
|
195
521
|
4089235720,
|
|
196
522
|
3144134277,
|
|
@@ -207,25 +533,196 @@ const st = /* @__PURE__ */ Uint32Array.from([
|
|
|
207
533
|
4215389547,
|
|
208
534
|
1541459225,
|
|
209
535
|
327033209
|
|
210
|
-
]),
|
|
211
|
-
|
|
212
|
-
|
|
536
|
+
]), Lt = /* @__PURE__ */ Uint32Array.from([
|
|
537
|
+
1732584193,
|
|
538
|
+
4023233417,
|
|
539
|
+
2562383102,
|
|
540
|
+
271733878,
|
|
541
|
+
3285377520
|
|
542
|
+
]), xt = /* @__PURE__ */ new Uint32Array(80);
|
|
543
|
+
class Ve extends kt {
|
|
544
|
+
A = Lt[0] | 0;
|
|
545
|
+
B = Lt[1] | 0;
|
|
546
|
+
C = Lt[2] | 0;
|
|
547
|
+
D = Lt[3] | 0;
|
|
548
|
+
E = Lt[4] | 0;
|
|
549
|
+
constructor() {
|
|
550
|
+
super(64, 20, 8, !1);
|
|
551
|
+
}
|
|
552
|
+
get() {
|
|
553
|
+
const { A: e, B: s, C: o, D: i, E: c } = this;
|
|
554
|
+
return [e, s, o, i, c];
|
|
555
|
+
}
|
|
556
|
+
set(e, s, o, i, c) {
|
|
557
|
+
this.A = e | 0, this.B = s | 0, this.C = o | 0, this.D = i | 0, this.E = c | 0;
|
|
558
|
+
}
|
|
559
|
+
process(e, s) {
|
|
560
|
+
for (let d = 0; d < 16; d++, s += 4)
|
|
561
|
+
xt[d] = e.getUint32(s, !1);
|
|
562
|
+
for (let d = 16; d < 80; d++)
|
|
563
|
+
xt[d] = yt(xt[d - 3] ^ xt[d - 8] ^ xt[d - 14] ^ xt[d - 16], 1);
|
|
564
|
+
let { A: o, B: i, C: c, D: r, E: a } = this;
|
|
565
|
+
for (let d = 0; d < 80; d++) {
|
|
566
|
+
let x, H;
|
|
567
|
+
d < 20 ? (x = jt(i, c, r), H = 1518500249) : d < 40 ? (x = i ^ c ^ r, H = 1859775393) : d < 60 ? (x = Ee(i, c, r), H = 2400959708) : (x = i ^ c ^ r, H = 3395469782);
|
|
568
|
+
const f = yt(o, 5) + x + a + H + xt[d] | 0;
|
|
569
|
+
a = r, r = c, c = yt(i, 30), i = o, o = f;
|
|
570
|
+
}
|
|
571
|
+
o = o + this.A | 0, i = i + this.B | 0, c = c + this.C | 0, r = r + this.D | 0, a = a + this.E | 0, this.set(o, i, c, r, a);
|
|
572
|
+
}
|
|
573
|
+
roundClean() {
|
|
574
|
+
tt(xt);
|
|
575
|
+
}
|
|
576
|
+
destroy() {
|
|
577
|
+
this.set(0, 0, 0, 0, 0), tt(this.buffer);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
const _0 = /* @__PURE__ */ ct(() => new Ve()), g0 = /* @__PURE__ */ Math.pow(2, 32), S0 = /* @__PURE__ */ Array.from({ length: 64 }, (t, e) => Math.floor(g0 * Math.abs(Math.sin(e + 1)))), Ft = /* @__PURE__ */ Lt.slice(0, 4), Nt = /* @__PURE__ */ new Uint32Array(16);
|
|
581
|
+
class Ce extends kt {
|
|
582
|
+
A = Ft[0] | 0;
|
|
583
|
+
B = Ft[1] | 0;
|
|
584
|
+
C = Ft[2] | 0;
|
|
585
|
+
D = Ft[3] | 0;
|
|
586
|
+
constructor() {
|
|
587
|
+
super(64, 16, 8, !0);
|
|
588
|
+
}
|
|
589
|
+
get() {
|
|
590
|
+
const { A: e, B: s, C: o, D: i } = this;
|
|
591
|
+
return [e, s, o, i];
|
|
592
|
+
}
|
|
593
|
+
set(e, s, o, i) {
|
|
594
|
+
this.A = e | 0, this.B = s | 0, this.C = o | 0, this.D = i | 0;
|
|
595
|
+
}
|
|
596
|
+
process(e, s) {
|
|
597
|
+
for (let a = 0; a < 16; a++, s += 4)
|
|
598
|
+
Nt[a] = e.getUint32(s, !0);
|
|
599
|
+
let { A: o, B: i, C: c, D: r } = this;
|
|
600
|
+
for (let a = 0; a < 64; a++) {
|
|
601
|
+
let d, x, H;
|
|
602
|
+
a < 16 ? (d = jt(i, c, r), x = a, H = [7, 12, 17, 22]) : a < 32 ? (d = jt(r, i, c), x = (5 * a + 1) % 16, H = [5, 9, 14, 20]) : a < 48 ? (d = i ^ c ^ r, x = (3 * a + 5) % 16, H = [4, 11, 16, 23]) : (d = c ^ (i | ~r), x = 7 * a % 16, H = [6, 10, 15, 21]), d = d + o + S0[a] + Nt[x], o = r, r = c, c = i, i = i + yt(d, H[a % 4]);
|
|
603
|
+
}
|
|
604
|
+
o = o + this.A | 0, i = i + this.B | 0, c = c + this.C | 0, r = r + this.D | 0, this.set(o, i, c, r);
|
|
605
|
+
}
|
|
606
|
+
roundClean() {
|
|
607
|
+
tt(Nt);
|
|
608
|
+
}
|
|
609
|
+
destroy() {
|
|
610
|
+
this.set(0, 0, 0, 0), tt(this.buffer);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
const w0 = /* @__PURE__ */ ct(() => new Ce()), B0 = /* @__PURE__ */ Uint8Array.from([
|
|
614
|
+
7,
|
|
615
|
+
4,
|
|
616
|
+
13,
|
|
617
|
+
1,
|
|
618
|
+
10,
|
|
619
|
+
6,
|
|
620
|
+
15,
|
|
621
|
+
3,
|
|
622
|
+
12,
|
|
623
|
+
0,
|
|
624
|
+
9,
|
|
625
|
+
5,
|
|
626
|
+
2,
|
|
627
|
+
14,
|
|
628
|
+
11,
|
|
629
|
+
8
|
|
630
|
+
]), De = Uint8Array.from(new Array(16).fill(0).map((t, e) => e)), I0 = De.map((t) => (9 * t + 5) % 16), ke = /* @__PURE__ */ (() => {
|
|
631
|
+
const s = [[De], [I0]];
|
|
632
|
+
for (let o = 0; o < 4; o++)
|
|
633
|
+
for (let i of s)
|
|
634
|
+
i.push(i[o].map((c) => B0[c]));
|
|
635
|
+
return s;
|
|
636
|
+
})(), Fe = ke[0], Oe = ke[1], Te = /* @__PURE__ */ [
|
|
637
|
+
[11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],
|
|
638
|
+
[12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],
|
|
639
|
+
[13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],
|
|
640
|
+
[14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],
|
|
641
|
+
[15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5]
|
|
642
|
+
].map((t) => Uint8Array.from(t)), L0 = /* @__PURE__ */ Fe.map((t, e) => t.map((s) => Te[e][s])), m0 = /* @__PURE__ */ Oe.map((t, e) => t.map((s) => Te[e][s])), U0 = /* @__PURE__ */ Uint32Array.from([
|
|
643
|
+
0,
|
|
644
|
+
1518500249,
|
|
645
|
+
1859775393,
|
|
646
|
+
2400959708,
|
|
647
|
+
2840853838
|
|
648
|
+
]), E0 = /* @__PURE__ */ Uint32Array.from([
|
|
649
|
+
1352829926,
|
|
650
|
+
1548603684,
|
|
651
|
+
1836072691,
|
|
652
|
+
2053994217,
|
|
653
|
+
0
|
|
654
|
+
]);
|
|
655
|
+
function re(t, e, s, o) {
|
|
656
|
+
return t === 0 ? e ^ s ^ o : t === 1 ? e & s | ~e & o : t === 2 ? (e | ~s) ^ o : t === 3 ? e & o | s & ~o : e ^ (s | ~o);
|
|
657
|
+
}
|
|
658
|
+
const Ot = /* @__PURE__ */ new Uint32Array(16);
|
|
659
|
+
class ve extends kt {
|
|
660
|
+
h0 = 1732584193;
|
|
661
|
+
h1 = -271733879;
|
|
662
|
+
h2 = -1732584194;
|
|
663
|
+
h3 = 271733878;
|
|
664
|
+
h4 = -1009589776;
|
|
665
|
+
constructor() {
|
|
666
|
+
super(64, 20, 8, !0);
|
|
667
|
+
}
|
|
668
|
+
get() {
|
|
669
|
+
const { h0: e, h1: s, h2: o, h3: i, h4: c } = this;
|
|
670
|
+
return [e, s, o, i, c];
|
|
671
|
+
}
|
|
672
|
+
set(e, s, o, i, c) {
|
|
673
|
+
this.h0 = e | 0, this.h1 = s | 0, this.h2 = o | 0, this.h3 = i | 0, this.h4 = c | 0;
|
|
674
|
+
}
|
|
675
|
+
process(e, s) {
|
|
676
|
+
for (let w = 0; w < 16; w++, s += 4)
|
|
677
|
+
Ot[w] = e.getUint32(s, !0);
|
|
678
|
+
let o = this.h0 | 0, i = o, c = this.h1 | 0, r = c, a = this.h2 | 0, d = a, x = this.h3 | 0, H = x, f = this.h4 | 0, g = f;
|
|
679
|
+
for (let w = 0; w < 5; w++) {
|
|
680
|
+
const S = 4 - w, I = U0[w], D = E0[w], W = Fe[w], v = Oe[w], _ = L0[w], C = m0[w];
|
|
681
|
+
for (let A = 0; A < 16; A++) {
|
|
682
|
+
const B = yt(o + re(w, c, a, x) + Ot[W[A]] + I, _[A]) + f | 0;
|
|
683
|
+
o = f, f = x, x = yt(a, 10) | 0, a = c, c = B;
|
|
684
|
+
}
|
|
685
|
+
for (let A = 0; A < 16; A++) {
|
|
686
|
+
const B = yt(i + re(S, r, d, H) + Ot[v[A]] + D, C[A]) + g | 0;
|
|
687
|
+
i = g, g = H, H = yt(d, 10) | 0, d = r, r = B;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
this.set(this.h1 + a + H | 0, this.h2 + x + g | 0, this.h3 + f + i | 0, this.h4 + o + r | 0, this.h0 + c + d | 0);
|
|
691
|
+
}
|
|
692
|
+
roundClean() {
|
|
693
|
+
tt(Ot);
|
|
694
|
+
}
|
|
695
|
+
destroy() {
|
|
696
|
+
this.destroyed = !0, tt(this.buffer), this.set(0, 0, 0, 0, 0);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
const V0 = /* @__PURE__ */ ct(() => new ve()), C0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
700
|
+
__proto__: null,
|
|
701
|
+
_MD5: Ce,
|
|
702
|
+
_RIPEMD160: ve,
|
|
703
|
+
_SHA1: Ve,
|
|
704
|
+
md5: w0,
|
|
705
|
+
ripemd160: V0,
|
|
706
|
+
sha1: _0
|
|
707
|
+
}, Symbol.toStringTag, { value: "Module" })), ws = /* @__PURE__ */ zt(C0), Tt = /* @__PURE__ */ BigInt(2 ** 32 - 1), ie = /* @__PURE__ */ BigInt(32);
|
|
708
|
+
function D0(t, e = !1) {
|
|
709
|
+
return e ? { h: Number(t & Tt), l: Number(t >> ie & Tt) } : { h: Number(t >> ie & Tt) | 0, l: Number(t & Tt) | 0 };
|
|
213
710
|
}
|
|
214
|
-
function
|
|
711
|
+
function Me(t, e = !1) {
|
|
215
712
|
const s = t.length;
|
|
216
|
-
let
|
|
217
|
-
for (let
|
|
218
|
-
const { h:
|
|
219
|
-
[
|
|
713
|
+
let o = new Uint32Array(s), i = new Uint32Array(s);
|
|
714
|
+
for (let c = 0; c < s; c++) {
|
|
715
|
+
const { h: r, l: a } = D0(t[c], e);
|
|
716
|
+
[o[c], i[c]] = [r, a];
|
|
220
717
|
}
|
|
221
|
-
return [
|
|
718
|
+
return [o, i];
|
|
222
719
|
}
|
|
223
|
-
const
|
|
224
|
-
function
|
|
225
|
-
const
|
|
226
|
-
return { h: t + s + (
|
|
720
|
+
const ce = (t, e, s) => t >>> s, oe = (t, e, s) => t << 32 - s | e >>> s, Bt = (t, e, s) => t >>> s | e << 32 - s, It = (t, e, s) => t << 32 - s | e >>> s, vt = (t, e, s) => t << 64 - s | e >>> s - 32, Mt = (t, e, s) => t >>> s - 32 | e << 64 - s, k0 = (t, e, s) => t << s | e >>> 32 - s, F0 = (t, e, s) => e << s | t >>> 32 - s, O0 = (t, e, s) => e << s - 32 | t >>> 64 - s, T0 = (t, e, s) => t << s - 32 | e >>> 64 - s;
|
|
721
|
+
function ft(t, e, s, o) {
|
|
722
|
+
const i = (e >>> 0) + (o >>> 0);
|
|
723
|
+
return { h: t + s + (i / 2 ** 32 | 0) | 0, l: i | 0 };
|
|
227
724
|
}
|
|
228
|
-
const
|
|
725
|
+
const v0 = (t, e, s) => (t >>> 0) + (e >>> 0) + (s >>> 0), M0 = (t, e, s, o) => e + s + o + (t / 2 ** 32 | 0) | 0, G0 = (t, e, s, o) => (t >>> 0) + (e >>> 0) + (s >>> 0) + (o >>> 0), j0 = (t, e, s, o, i) => e + s + o + i + (t / 2 ** 32 | 0) | 0, W0 = (t, e, s, o, i) => (t >>> 0) + (e >>> 0) + (s >>> 0) + (o >>> 0) + (i >>> 0), R0 = (t, e, s, o, i, c) => e + s + o + i + c + (t / 2 ** 32 | 0) | 0, P0 = /* @__PURE__ */ Uint32Array.from([
|
|
229
726
|
1116352408,
|
|
230
727
|
1899447441,
|
|
231
728
|
3049323471,
|
|
@@ -290,42 +787,70 @@ const me = (t, e, s) => (t >>> 0) + (e >>> 0) + (s >>> 0), Ue = (t, e, s, i) =>
|
|
|
290
787
|
2756734187,
|
|
291
788
|
3204031479,
|
|
292
789
|
3329325298
|
|
293
|
-
]),
|
|
294
|
-
class
|
|
295
|
-
constructor(e
|
|
296
|
-
super(64, e, 8, !1)
|
|
790
|
+
]), Ht = /* @__PURE__ */ new Uint32Array(64);
|
|
791
|
+
class Ge extends kt {
|
|
792
|
+
constructor(e) {
|
|
793
|
+
super(64, e, 8, !1);
|
|
297
794
|
}
|
|
298
795
|
get() {
|
|
299
|
-
const { A: e, B: s, C:
|
|
300
|
-
return [e, s, i,
|
|
796
|
+
const { A: e, B: s, C: o, D: i, E: c, F: r, G: a, H: d } = this;
|
|
797
|
+
return [e, s, o, i, c, r, a, d];
|
|
301
798
|
}
|
|
302
799
|
// prettier-ignore
|
|
303
|
-
set(e, s, i,
|
|
304
|
-
this.A = e | 0, this.B = s | 0, this.C =
|
|
800
|
+
set(e, s, o, i, c, r, a, d) {
|
|
801
|
+
this.A = e | 0, this.B = s | 0, this.C = o | 0, this.D = i | 0, this.E = c | 0, this.F = r | 0, this.G = a | 0, this.H = d | 0;
|
|
305
802
|
}
|
|
306
803
|
process(e, s) {
|
|
307
|
-
for (let
|
|
308
|
-
|
|
309
|
-
for (let
|
|
310
|
-
const
|
|
311
|
-
|
|
804
|
+
for (let f = 0; f < 16; f++, s += 4)
|
|
805
|
+
Ht[f] = e.getUint32(s, !1);
|
|
806
|
+
for (let f = 16; f < 64; f++) {
|
|
807
|
+
const g = Ht[f - 15], w = Ht[f - 2], S = it(g, 7) ^ it(g, 18) ^ g >>> 3, I = it(w, 17) ^ it(w, 19) ^ w >>> 10;
|
|
808
|
+
Ht[f] = I + Ht[f - 7] + S + Ht[f - 16] | 0;
|
|
312
809
|
}
|
|
313
|
-
let { A:
|
|
314
|
-
for (let
|
|
315
|
-
const
|
|
316
|
-
H = x, x =
|
|
810
|
+
let { A: o, B: i, C: c, D: r, E: a, F: d, G: x, H } = this;
|
|
811
|
+
for (let f = 0; f < 64; f++) {
|
|
812
|
+
const g = it(a, 6) ^ it(a, 11) ^ it(a, 25), w = H + g + jt(a, d, x) + P0[f] + Ht[f] | 0, I = (it(o, 2) ^ it(o, 13) ^ it(o, 22)) + Ee(o, i, c) | 0;
|
|
813
|
+
H = x, x = d, d = a, a = r + w | 0, r = c, c = i, i = o, o = w + I | 0;
|
|
317
814
|
}
|
|
318
|
-
|
|
815
|
+
o = o + this.A | 0, i = i + this.B | 0, c = c + this.C | 0, r = r + this.D | 0, a = a + this.E | 0, d = d + this.F | 0, x = x + this.G | 0, H = H + this.H | 0, this.set(o, i, c, r, a, d, x, H);
|
|
319
816
|
}
|
|
320
817
|
roundClean() {
|
|
321
|
-
|
|
818
|
+
tt(Ht);
|
|
322
819
|
}
|
|
323
820
|
destroy() {
|
|
324
|
-
this.set(0, 0, 0, 0, 0, 0, 0, 0),
|
|
821
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0), tt(this.buffer);
|
|
325
822
|
}
|
|
326
823
|
}
|
|
327
|
-
|
|
328
|
-
|
|
824
|
+
class je extends Ge {
|
|
825
|
+
// We cannot use array here since array allows indexing by variable
|
|
826
|
+
// which means optimizer/compiler cannot use registers.
|
|
827
|
+
A = lt[0] | 0;
|
|
828
|
+
B = lt[1] | 0;
|
|
829
|
+
C = lt[2] | 0;
|
|
830
|
+
D = lt[3] | 0;
|
|
831
|
+
E = lt[4] | 0;
|
|
832
|
+
F = lt[5] | 0;
|
|
833
|
+
G = lt[6] | 0;
|
|
834
|
+
H = lt[7] | 0;
|
|
835
|
+
constructor() {
|
|
836
|
+
super(32);
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
class We extends Ge {
|
|
840
|
+
A = bt[0] | 0;
|
|
841
|
+
B = bt[1] | 0;
|
|
842
|
+
C = bt[2] | 0;
|
|
843
|
+
D = bt[3] | 0;
|
|
844
|
+
E = bt[4] | 0;
|
|
845
|
+
F = bt[5] | 0;
|
|
846
|
+
G = bt[6] | 0;
|
|
847
|
+
H = bt[7] | 0;
|
|
848
|
+
constructor() {
|
|
849
|
+
super(28);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
const Re = Me([
|
|
853
|
+
"0x428a2f98d728ae22",
|
|
329
854
|
"0x7137449123ef65cd",
|
|
330
855
|
"0xb5c0fbcfec4d3b2f",
|
|
331
856
|
"0xe9b5dba58189dbbc",
|
|
@@ -405,287 +930,1220 @@ const ie = Be([
|
|
|
405
930
|
"0x597f299cfc657e2a",
|
|
406
931
|
"0x5fcb6fab3ad6faec",
|
|
407
932
|
"0x6c44198c4a475817"
|
|
408
|
-
].map((t) => BigInt(t))),
|
|
409
|
-
class
|
|
410
|
-
constructor(e
|
|
411
|
-
super(128, e, 16, !1)
|
|
933
|
+
].map((t) => BigInt(t))), q0 = Re[0], K0 = Re[1], At = /* @__PURE__ */ new Uint32Array(80), pt = /* @__PURE__ */ new Uint32Array(80);
|
|
934
|
+
class Wt extends kt {
|
|
935
|
+
constructor(e) {
|
|
936
|
+
super(128, e, 16, !1);
|
|
937
|
+
}
|
|
938
|
+
// prettier-ignore
|
|
939
|
+
get() {
|
|
940
|
+
const { Ah: e, Al: s, Bh: o, Bl: i, Ch: c, Cl: r, Dh: a, Dl: d, Eh: x, El: H, Fh: f, Fl: g, Gh: w, Gl: S, Hh: I, Hl: D } = this;
|
|
941
|
+
return [e, s, o, i, c, r, a, d, x, H, f, g, w, S, I, D];
|
|
942
|
+
}
|
|
943
|
+
// prettier-ignore
|
|
944
|
+
set(e, s, o, i, c, r, a, d, x, H, f, g, w, S, I, D) {
|
|
945
|
+
this.Ah = e | 0, this.Al = s | 0, this.Bh = o | 0, this.Bl = i | 0, this.Ch = c | 0, this.Cl = r | 0, this.Dh = a | 0, this.Dl = d | 0, this.Eh = x | 0, this.El = H | 0, this.Fh = f | 0, this.Fl = g | 0, this.Gh = w | 0, this.Gl = S | 0, this.Hh = I | 0, this.Hl = D | 0;
|
|
946
|
+
}
|
|
947
|
+
process(e, s) {
|
|
948
|
+
for (let _ = 0; _ < 16; _++, s += 4)
|
|
949
|
+
At[_] = e.getUint32(s), pt[_] = e.getUint32(s += 4);
|
|
950
|
+
for (let _ = 16; _ < 80; _++) {
|
|
951
|
+
const C = At[_ - 15] | 0, A = pt[_ - 15] | 0, B = Bt(C, A, 1) ^ Bt(C, A, 8) ^ ce(C, A, 7), m = It(C, A, 1) ^ It(C, A, 8) ^ oe(C, A, 7), E = At[_ - 2] | 0, h = pt[_ - 2] | 0, u = Bt(E, h, 19) ^ vt(E, h, 61) ^ ce(E, h, 6), l = It(E, h, 19) ^ Mt(E, h, 61) ^ oe(E, h, 6), L = G0(m, l, pt[_ - 7], pt[_ - 16]), p = j0(L, B, u, At[_ - 7], At[_ - 16]);
|
|
952
|
+
At[_] = p | 0, pt[_] = L | 0;
|
|
953
|
+
}
|
|
954
|
+
let { Ah: o, Al: i, Bh: c, Bl: r, Ch: a, Cl: d, Dh: x, Dl: H, Eh: f, El: g, Fh: w, Fl: S, Gh: I, Gl: D, Hh: W, Hl: v } = this;
|
|
955
|
+
for (let _ = 0; _ < 80; _++) {
|
|
956
|
+
const C = Bt(f, g, 14) ^ Bt(f, g, 18) ^ vt(f, g, 41), A = It(f, g, 14) ^ It(f, g, 18) ^ Mt(f, g, 41), B = f & w ^ ~f & I, m = g & S ^ ~g & D, E = W0(v, A, m, K0[_], pt[_]), h = R0(E, W, C, B, q0[_], At[_]), u = E | 0, l = Bt(o, i, 28) ^ vt(o, i, 34) ^ vt(o, i, 39), L = It(o, i, 28) ^ Mt(o, i, 34) ^ Mt(o, i, 39), p = o & c ^ o & a ^ c & a, U = i & r ^ i & d ^ r & d;
|
|
957
|
+
W = I | 0, v = D | 0, I = w | 0, D = S | 0, w = f | 0, S = g | 0, { h: f, l: g } = ft(x | 0, H | 0, h | 0, u | 0), x = a | 0, H = d | 0, a = c | 0, d = r | 0, c = o | 0, r = i | 0;
|
|
958
|
+
const F = v0(u, L, U);
|
|
959
|
+
o = M0(F, h, l, p), i = F | 0;
|
|
960
|
+
}
|
|
961
|
+
({ h: o, l: i } = ft(this.Ah | 0, this.Al | 0, o | 0, i | 0)), { h: c, l: r } = ft(this.Bh | 0, this.Bl | 0, c | 0, r | 0), { h: a, l: d } = ft(this.Ch | 0, this.Cl | 0, a | 0, d | 0), { h: x, l: H } = ft(this.Dh | 0, this.Dl | 0, x | 0, H | 0), { h: f, l: g } = ft(this.Eh | 0, this.El | 0, f | 0, g | 0), { h: w, l: S } = ft(this.Fh | 0, this.Fl | 0, w | 0, S | 0), { h: I, l: D } = ft(this.Gh | 0, this.Gl | 0, I | 0, D | 0), { h: W, l: v } = ft(this.Hh | 0, this.Hl | 0, W | 0, v | 0), this.set(o, i, c, r, a, d, x, H, f, g, w, S, I, D, W, v);
|
|
962
|
+
}
|
|
963
|
+
roundClean() {
|
|
964
|
+
tt(At, pt);
|
|
965
|
+
}
|
|
966
|
+
destroy() {
|
|
967
|
+
tt(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
class Pe extends Wt {
|
|
971
|
+
Ah = Q[0] | 0;
|
|
972
|
+
Al = Q[1] | 0;
|
|
973
|
+
Bh = Q[2] | 0;
|
|
974
|
+
Bl = Q[3] | 0;
|
|
975
|
+
Ch = Q[4] | 0;
|
|
976
|
+
Cl = Q[5] | 0;
|
|
977
|
+
Dh = Q[6] | 0;
|
|
978
|
+
Dl = Q[7] | 0;
|
|
979
|
+
Eh = Q[8] | 0;
|
|
980
|
+
El = Q[9] | 0;
|
|
981
|
+
Fh = Q[10] | 0;
|
|
982
|
+
Fl = Q[11] | 0;
|
|
983
|
+
Gh = Q[12] | 0;
|
|
984
|
+
Gl = Q[13] | 0;
|
|
985
|
+
Hh = Q[14] | 0;
|
|
986
|
+
Hl = Q[15] | 0;
|
|
987
|
+
constructor() {
|
|
988
|
+
super(64);
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
class qe extends Wt {
|
|
992
|
+
Ah = J[0] | 0;
|
|
993
|
+
Al = J[1] | 0;
|
|
994
|
+
Bh = J[2] | 0;
|
|
995
|
+
Bl = J[3] | 0;
|
|
996
|
+
Ch = J[4] | 0;
|
|
997
|
+
Cl = J[5] | 0;
|
|
998
|
+
Dh = J[6] | 0;
|
|
999
|
+
Dl = J[7] | 0;
|
|
1000
|
+
Eh = J[8] | 0;
|
|
1001
|
+
El = J[9] | 0;
|
|
1002
|
+
Fh = J[10] | 0;
|
|
1003
|
+
Fl = J[11] | 0;
|
|
1004
|
+
Gh = J[12] | 0;
|
|
1005
|
+
Gl = J[13] | 0;
|
|
1006
|
+
Hh = J[14] | 0;
|
|
1007
|
+
Hl = J[15] | 0;
|
|
1008
|
+
constructor() {
|
|
1009
|
+
super(48);
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
const Y = /* @__PURE__ */ Uint32Array.from([
|
|
1013
|
+
2352822216,
|
|
1014
|
+
424955298,
|
|
1015
|
+
1944164710,
|
|
1016
|
+
2312950998,
|
|
1017
|
+
502970286,
|
|
1018
|
+
855612546,
|
|
1019
|
+
1738396948,
|
|
1020
|
+
1479516111,
|
|
1021
|
+
258812777,
|
|
1022
|
+
2077511080,
|
|
1023
|
+
2011393907,
|
|
1024
|
+
79989058,
|
|
1025
|
+
1067287976,
|
|
1026
|
+
1780299464,
|
|
1027
|
+
286451373,
|
|
1028
|
+
2446758561
|
|
1029
|
+
]), Z = /* @__PURE__ */ Uint32Array.from([
|
|
1030
|
+
573645204,
|
|
1031
|
+
4230739756,
|
|
1032
|
+
2673172387,
|
|
1033
|
+
3360449730,
|
|
1034
|
+
596883563,
|
|
1035
|
+
1867755857,
|
|
1036
|
+
2520282905,
|
|
1037
|
+
1497426621,
|
|
1038
|
+
2519219938,
|
|
1039
|
+
2827943907,
|
|
1040
|
+
3193839141,
|
|
1041
|
+
1401305490,
|
|
1042
|
+
721525244,
|
|
1043
|
+
746961066,
|
|
1044
|
+
246885852,
|
|
1045
|
+
2177182882
|
|
1046
|
+
]);
|
|
1047
|
+
class Ke extends Wt {
|
|
1048
|
+
Ah = Y[0] | 0;
|
|
1049
|
+
Al = Y[1] | 0;
|
|
1050
|
+
Bh = Y[2] | 0;
|
|
1051
|
+
Bl = Y[3] | 0;
|
|
1052
|
+
Ch = Y[4] | 0;
|
|
1053
|
+
Cl = Y[5] | 0;
|
|
1054
|
+
Dh = Y[6] | 0;
|
|
1055
|
+
Dl = Y[7] | 0;
|
|
1056
|
+
Eh = Y[8] | 0;
|
|
1057
|
+
El = Y[9] | 0;
|
|
1058
|
+
Fh = Y[10] | 0;
|
|
1059
|
+
Fl = Y[11] | 0;
|
|
1060
|
+
Gh = Y[12] | 0;
|
|
1061
|
+
Gl = Y[13] | 0;
|
|
1062
|
+
Hh = Y[14] | 0;
|
|
1063
|
+
Hl = Y[15] | 0;
|
|
1064
|
+
constructor() {
|
|
1065
|
+
super(28);
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
class Ne extends Wt {
|
|
1069
|
+
Ah = Z[0] | 0;
|
|
1070
|
+
Al = Z[1] | 0;
|
|
1071
|
+
Bh = Z[2] | 0;
|
|
1072
|
+
Bl = Z[3] | 0;
|
|
1073
|
+
Ch = Z[4] | 0;
|
|
1074
|
+
Cl = Z[5] | 0;
|
|
1075
|
+
Dh = Z[6] | 0;
|
|
1076
|
+
Dl = Z[7] | 0;
|
|
1077
|
+
Eh = Z[8] | 0;
|
|
1078
|
+
El = Z[9] | 0;
|
|
1079
|
+
Fh = Z[10] | 0;
|
|
1080
|
+
Fl = Z[11] | 0;
|
|
1081
|
+
Gh = Z[12] | 0;
|
|
1082
|
+
Gl = Z[13] | 0;
|
|
1083
|
+
Hh = Z[14] | 0;
|
|
1084
|
+
Hl = Z[15] | 0;
|
|
1085
|
+
constructor() {
|
|
1086
|
+
super(32);
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
const N0 = /* @__PURE__ */ ct(
|
|
1090
|
+
() => new je(),
|
|
1091
|
+
/* @__PURE__ */ gt(1)
|
|
1092
|
+
), X0 = /* @__PURE__ */ ct(
|
|
1093
|
+
() => new We(),
|
|
1094
|
+
/* @__PURE__ */ gt(4)
|
|
1095
|
+
), J0 = /* @__PURE__ */ ct(
|
|
1096
|
+
() => new Pe(),
|
|
1097
|
+
/* @__PURE__ */ gt(3)
|
|
1098
|
+
), Q0 = /* @__PURE__ */ ct(
|
|
1099
|
+
() => new qe(),
|
|
1100
|
+
/* @__PURE__ */ gt(2)
|
|
1101
|
+
), Y0 = /* @__PURE__ */ ct(
|
|
1102
|
+
() => new Ne(),
|
|
1103
|
+
/* @__PURE__ */ gt(6)
|
|
1104
|
+
), Z0 = /* @__PURE__ */ ct(
|
|
1105
|
+
() => new Ke(),
|
|
1106
|
+
/* @__PURE__ */ gt(5)
|
|
1107
|
+
), z0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1108
|
+
__proto__: null,
|
|
1109
|
+
_SHA224: We,
|
|
1110
|
+
_SHA256: je,
|
|
1111
|
+
_SHA384: qe,
|
|
1112
|
+
_SHA512: Pe,
|
|
1113
|
+
_SHA512_224: Ke,
|
|
1114
|
+
_SHA512_256: Ne,
|
|
1115
|
+
sha224: X0,
|
|
1116
|
+
sha256: N0,
|
|
1117
|
+
sha384: Q0,
|
|
1118
|
+
sha512: J0,
|
|
1119
|
+
sha512_224: Z0,
|
|
1120
|
+
sha512_256: Y0
|
|
1121
|
+
}, Symbol.toStringTag, { value: "Module" })), Bs = /* @__PURE__ */ zt(z0);
|
|
1122
|
+
var st = {}, R = {}, z = {}, Xt = {}, Et = {}, ae;
|
|
1123
|
+
function $0() {
|
|
1124
|
+
return ae || (ae = 1, Object.defineProperty(Et, "__esModule", { value: !0 }), Et.crypto = void 0, Et.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0), Et;
|
|
1125
|
+
}
|
|
1126
|
+
var he;
|
|
1127
|
+
function Xe() {
|
|
1128
|
+
return he || (he = 1, (function(t) {
|
|
1129
|
+
Object.defineProperty(t, "__esModule", { value: !0 }), t.wrapXOFConstructorWithOpts = t.wrapConstructorWithOpts = t.wrapConstructor = t.Hash = t.nextTick = t.swap32IfBE = t.byteSwapIfBE = t.swap8IfBE = t.isLE = void 0, t.isBytes = s, t.anumber = o, t.abytes = i, t.ahash = c, t.aexists = r, t.aoutput = a, t.u8 = d, t.u32 = x, t.clean = H, t.createView = f, t.rotr = g, t.rotl = w, t.byteSwap = S, t.byteSwap32 = I, t.bytesToHex = v, t.hexToBytes = A, t.asyncLoop = m, t.utf8ToBytes = E, t.bytesToUtf8 = h, t.toBytes = u, t.kdfInputToBytes = l, t.concatBytes = L, t.checkOpts = p, t.createHasher = F, t.createOptHasher = M, t.createXOFer = G, t.randomBytes = q;
|
|
1130
|
+
const e = /* @__PURE__ */ $0();
|
|
1131
|
+
function s(n) {
|
|
1132
|
+
return n instanceof Uint8Array || ArrayBuffer.isView(n) && n.constructor.name === "Uint8Array";
|
|
1133
|
+
}
|
|
1134
|
+
function o(n) {
|
|
1135
|
+
if (!Number.isSafeInteger(n) || n < 0)
|
|
1136
|
+
throw new Error("positive integer expected, got " + n);
|
|
1137
|
+
}
|
|
1138
|
+
function i(n, ...b) {
|
|
1139
|
+
if (!s(n))
|
|
1140
|
+
throw new Error("Uint8Array expected");
|
|
1141
|
+
if (b.length > 0 && !b.includes(n.length))
|
|
1142
|
+
throw new Error("Uint8Array expected of length " + b + ", got length=" + n.length);
|
|
1143
|
+
}
|
|
1144
|
+
function c(n) {
|
|
1145
|
+
if (typeof n != "function" || typeof n.create != "function")
|
|
1146
|
+
throw new Error("Hash should be wrapped by utils.createHasher");
|
|
1147
|
+
o(n.outputLen), o(n.blockLen);
|
|
1148
|
+
}
|
|
1149
|
+
function r(n, b = !0) {
|
|
1150
|
+
if (n.destroyed)
|
|
1151
|
+
throw new Error("Hash instance has been destroyed");
|
|
1152
|
+
if (b && n.finished)
|
|
1153
|
+
throw new Error("Hash#digest() has already been called");
|
|
1154
|
+
}
|
|
1155
|
+
function a(n, b) {
|
|
1156
|
+
i(n);
|
|
1157
|
+
const y = b.outputLen;
|
|
1158
|
+
if (n.length < y)
|
|
1159
|
+
throw new Error("digestInto() expects output buffer of length at least " + y);
|
|
1160
|
+
}
|
|
1161
|
+
function d(n) {
|
|
1162
|
+
return new Uint8Array(n.buffer, n.byteOffset, n.byteLength);
|
|
1163
|
+
}
|
|
1164
|
+
function x(n) {
|
|
1165
|
+
return new Uint32Array(n.buffer, n.byteOffset, Math.floor(n.byteLength / 4));
|
|
1166
|
+
}
|
|
1167
|
+
function H(...n) {
|
|
1168
|
+
for (let b = 0; b < n.length; b++)
|
|
1169
|
+
n[b].fill(0);
|
|
1170
|
+
}
|
|
1171
|
+
function f(n) {
|
|
1172
|
+
return new DataView(n.buffer, n.byteOffset, n.byteLength);
|
|
1173
|
+
}
|
|
1174
|
+
function g(n, b) {
|
|
1175
|
+
return n << 32 - b | n >>> b;
|
|
1176
|
+
}
|
|
1177
|
+
function w(n, b) {
|
|
1178
|
+
return n << b | n >>> 32 - b >>> 0;
|
|
1179
|
+
}
|
|
1180
|
+
t.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
1181
|
+
function S(n) {
|
|
1182
|
+
return n << 24 & 4278190080 | n << 8 & 16711680 | n >>> 8 & 65280 | n >>> 24 & 255;
|
|
1183
|
+
}
|
|
1184
|
+
t.swap8IfBE = t.isLE ? (n) => n : (n) => S(n), t.byteSwapIfBE = t.swap8IfBE;
|
|
1185
|
+
function I(n) {
|
|
1186
|
+
for (let b = 0; b < n.length; b++)
|
|
1187
|
+
n[b] = S(n[b]);
|
|
1188
|
+
return n;
|
|
1189
|
+
}
|
|
1190
|
+
t.swap32IfBE = t.isLE ? (n) => n : I;
|
|
1191
|
+
const D = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", W = /* @__PURE__ */ Array.from({ length: 256 }, (n, b) => b.toString(16).padStart(2, "0"));
|
|
1192
|
+
function v(n) {
|
|
1193
|
+
if (i(n), D)
|
|
1194
|
+
return n.toHex();
|
|
1195
|
+
let b = "";
|
|
1196
|
+
for (let y = 0; y < n.length; y++)
|
|
1197
|
+
b += W[n[y]];
|
|
1198
|
+
return b;
|
|
1199
|
+
}
|
|
1200
|
+
const _ = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
|
|
1201
|
+
function C(n) {
|
|
1202
|
+
if (n >= _._0 && n <= _._9)
|
|
1203
|
+
return n - _._0;
|
|
1204
|
+
if (n >= _.A && n <= _.F)
|
|
1205
|
+
return n - (_.A - 10);
|
|
1206
|
+
if (n >= _.a && n <= _.f)
|
|
1207
|
+
return n - (_.a - 10);
|
|
1208
|
+
}
|
|
1209
|
+
function A(n) {
|
|
1210
|
+
if (typeof n != "string")
|
|
1211
|
+
throw new Error("hex string expected, got " + typeof n);
|
|
1212
|
+
if (D)
|
|
1213
|
+
return Uint8Array.fromHex(n);
|
|
1214
|
+
const b = n.length, y = b / 2;
|
|
1215
|
+
if (b % 2)
|
|
1216
|
+
throw new Error("hex string expected, got unpadded hex of length " + b);
|
|
1217
|
+
const V = new Uint8Array(y);
|
|
1218
|
+
for (let k = 0, j = 0; k < y; k++, j += 2) {
|
|
1219
|
+
const et = C(n.charCodeAt(j)), K = C(n.charCodeAt(j + 1));
|
|
1220
|
+
if (et === void 0 || K === void 0) {
|
|
1221
|
+
const N = n[j] + n[j + 1];
|
|
1222
|
+
throw new Error('hex string expected, got non-hex character "' + N + '" at index ' + j);
|
|
1223
|
+
}
|
|
1224
|
+
V[k] = et * 16 + K;
|
|
1225
|
+
}
|
|
1226
|
+
return V;
|
|
1227
|
+
}
|
|
1228
|
+
const B = async () => {
|
|
1229
|
+
};
|
|
1230
|
+
t.nextTick = B;
|
|
1231
|
+
async function m(n, b, y) {
|
|
1232
|
+
let V = Date.now();
|
|
1233
|
+
for (let k = 0; k < n; k++) {
|
|
1234
|
+
y(k);
|
|
1235
|
+
const j = Date.now() - V;
|
|
1236
|
+
j >= 0 && j < b || (await (0, t.nextTick)(), V += j);
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
function E(n) {
|
|
1240
|
+
if (typeof n != "string")
|
|
1241
|
+
throw new Error("string expected");
|
|
1242
|
+
return new Uint8Array(new TextEncoder().encode(n));
|
|
1243
|
+
}
|
|
1244
|
+
function h(n) {
|
|
1245
|
+
return new TextDecoder().decode(n);
|
|
1246
|
+
}
|
|
1247
|
+
function u(n) {
|
|
1248
|
+
return typeof n == "string" && (n = E(n)), i(n), n;
|
|
1249
|
+
}
|
|
1250
|
+
function l(n) {
|
|
1251
|
+
return typeof n == "string" && (n = E(n)), i(n), n;
|
|
1252
|
+
}
|
|
1253
|
+
function L(...n) {
|
|
1254
|
+
let b = 0;
|
|
1255
|
+
for (let V = 0; V < n.length; V++) {
|
|
1256
|
+
const k = n[V];
|
|
1257
|
+
i(k), b += k.length;
|
|
1258
|
+
}
|
|
1259
|
+
const y = new Uint8Array(b);
|
|
1260
|
+
for (let V = 0, k = 0; V < n.length; V++) {
|
|
1261
|
+
const j = n[V];
|
|
1262
|
+
y.set(j, k), k += j.length;
|
|
1263
|
+
}
|
|
1264
|
+
return y;
|
|
1265
|
+
}
|
|
1266
|
+
function p(n, b) {
|
|
1267
|
+
if (b !== void 0 && {}.toString.call(b) !== "[object Object]")
|
|
1268
|
+
throw new Error("options should be object or undefined");
|
|
1269
|
+
return Object.assign(n, b);
|
|
1270
|
+
}
|
|
1271
|
+
class U {
|
|
1272
|
+
}
|
|
1273
|
+
t.Hash = U;
|
|
1274
|
+
function F(n) {
|
|
1275
|
+
const b = (V) => n().update(u(V)).digest(), y = n();
|
|
1276
|
+
return b.outputLen = y.outputLen, b.blockLen = y.blockLen, b.create = () => n(), b;
|
|
1277
|
+
}
|
|
1278
|
+
function M(n) {
|
|
1279
|
+
const b = (V, k) => n(k).update(u(V)).digest(), y = n({});
|
|
1280
|
+
return b.outputLen = y.outputLen, b.blockLen = y.blockLen, b.create = (V) => n(V), b;
|
|
1281
|
+
}
|
|
1282
|
+
function G(n) {
|
|
1283
|
+
const b = (V, k) => n(k).update(u(V)).digest(), y = n({});
|
|
1284
|
+
return b.outputLen = y.outputLen, b.blockLen = y.blockLen, b.create = (V) => n(V), b;
|
|
1285
|
+
}
|
|
1286
|
+
t.wrapConstructor = F, t.wrapConstructorWithOpts = M, t.wrapXOFConstructorWithOpts = G;
|
|
1287
|
+
function q(n = 32) {
|
|
1288
|
+
if (e.crypto && typeof e.crypto.getRandomValues == "function")
|
|
1289
|
+
return e.crypto.getRandomValues(new Uint8Array(n));
|
|
1290
|
+
if (e.crypto && typeof e.crypto.randomBytes == "function")
|
|
1291
|
+
return Uint8Array.from(e.crypto.randomBytes(n));
|
|
1292
|
+
throw new Error("crypto.getRandomValues must be defined");
|
|
1293
|
+
}
|
|
1294
|
+
})(Xt)), Xt;
|
|
1295
|
+
}
|
|
1296
|
+
var fe;
|
|
1297
|
+
function ts() {
|
|
1298
|
+
if (fe) return z;
|
|
1299
|
+
fe = 1, Object.defineProperty(z, "__esModule", { value: !0 }), z.SHA512_IV = z.SHA384_IV = z.SHA224_IV = z.SHA256_IV = z.HashMD = void 0, z.setBigUint64 = e, z.Chi = s, z.Maj = o;
|
|
1300
|
+
const t = /* @__PURE__ */ Xe();
|
|
1301
|
+
function e(c, r, a, d) {
|
|
1302
|
+
if (typeof c.setBigUint64 == "function")
|
|
1303
|
+
return c.setBigUint64(r, a, d);
|
|
1304
|
+
const x = BigInt(32), H = BigInt(4294967295), f = Number(a >> x & H), g = Number(a & H), w = d ? 4 : 0, S = d ? 0 : 4;
|
|
1305
|
+
c.setUint32(r + w, f, d), c.setUint32(r + S, g, d);
|
|
1306
|
+
}
|
|
1307
|
+
function s(c, r, a) {
|
|
1308
|
+
return c & r ^ ~c & a;
|
|
1309
|
+
}
|
|
1310
|
+
function o(c, r, a) {
|
|
1311
|
+
return c & r ^ c & a ^ r & a;
|
|
1312
|
+
}
|
|
1313
|
+
class i extends t.Hash {
|
|
1314
|
+
constructor(r, a, d, x) {
|
|
1315
|
+
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = r, this.outputLen = a, this.padOffset = d, this.isLE = x, this.buffer = new Uint8Array(r), this.view = (0, t.createView)(this.buffer);
|
|
1316
|
+
}
|
|
1317
|
+
update(r) {
|
|
1318
|
+
(0, t.aexists)(this), r = (0, t.toBytes)(r), (0, t.abytes)(r);
|
|
1319
|
+
const { view: a, buffer: d, blockLen: x } = this, H = r.length;
|
|
1320
|
+
for (let f = 0; f < H; ) {
|
|
1321
|
+
const g = Math.min(x - this.pos, H - f);
|
|
1322
|
+
if (g === x) {
|
|
1323
|
+
const w = (0, t.createView)(r);
|
|
1324
|
+
for (; x <= H - f; f += x)
|
|
1325
|
+
this.process(w, f);
|
|
1326
|
+
continue;
|
|
1327
|
+
}
|
|
1328
|
+
d.set(r.subarray(f, f + g), this.pos), this.pos += g, f += g, this.pos === x && (this.process(a, 0), this.pos = 0);
|
|
1329
|
+
}
|
|
1330
|
+
return this.length += r.length, this.roundClean(), this;
|
|
1331
|
+
}
|
|
1332
|
+
digestInto(r) {
|
|
1333
|
+
(0, t.aexists)(this), (0, t.aoutput)(r, this), this.finished = !0;
|
|
1334
|
+
const { buffer: a, view: d, blockLen: x, isLE: H } = this;
|
|
1335
|
+
let { pos: f } = this;
|
|
1336
|
+
a[f++] = 128, (0, t.clean)(this.buffer.subarray(f)), this.padOffset > x - f && (this.process(d, 0), f = 0);
|
|
1337
|
+
for (let D = f; D < x; D++)
|
|
1338
|
+
a[D] = 0;
|
|
1339
|
+
e(d, x - 8, BigInt(this.length * 8), H), this.process(d, 0);
|
|
1340
|
+
const g = (0, t.createView)(r), w = this.outputLen;
|
|
1341
|
+
if (w % 4)
|
|
1342
|
+
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
1343
|
+
const S = w / 4, I = this.get();
|
|
1344
|
+
if (S > I.length)
|
|
1345
|
+
throw new Error("_sha2: outputLen bigger than state");
|
|
1346
|
+
for (let D = 0; D < S; D++)
|
|
1347
|
+
g.setUint32(4 * D, I[D], H);
|
|
1348
|
+
}
|
|
1349
|
+
digest() {
|
|
1350
|
+
const { buffer: r, outputLen: a } = this;
|
|
1351
|
+
this.digestInto(r);
|
|
1352
|
+
const d = r.slice(0, a);
|
|
1353
|
+
return this.destroy(), d;
|
|
1354
|
+
}
|
|
1355
|
+
_cloneInto(r) {
|
|
1356
|
+
r || (r = new this.constructor()), r.set(...this.get());
|
|
1357
|
+
const { blockLen: a, buffer: d, length: x, finished: H, destroyed: f, pos: g } = this;
|
|
1358
|
+
return r.destroyed = f, r.finished = H, r.length = x, r.pos = g, x % a && r.buffer.set(d), r;
|
|
1359
|
+
}
|
|
1360
|
+
clone() {
|
|
1361
|
+
return this._cloneInto();
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
return z.HashMD = i, z.SHA256_IV = Uint32Array.from([
|
|
1365
|
+
1779033703,
|
|
1366
|
+
3144134277,
|
|
1367
|
+
1013904242,
|
|
1368
|
+
2773480762,
|
|
1369
|
+
1359893119,
|
|
1370
|
+
2600822924,
|
|
1371
|
+
528734635,
|
|
1372
|
+
1541459225
|
|
1373
|
+
]), z.SHA224_IV = Uint32Array.from([
|
|
1374
|
+
3238371032,
|
|
1375
|
+
914150663,
|
|
1376
|
+
812702999,
|
|
1377
|
+
4144912697,
|
|
1378
|
+
4290775857,
|
|
1379
|
+
1750603025,
|
|
1380
|
+
1694076839,
|
|
1381
|
+
3204075428
|
|
1382
|
+
]), z.SHA384_IV = Uint32Array.from([
|
|
1383
|
+
3418070365,
|
|
1384
|
+
3238371032,
|
|
1385
|
+
1654270250,
|
|
1386
|
+
914150663,
|
|
1387
|
+
2438529370,
|
|
1388
|
+
812702999,
|
|
1389
|
+
355462360,
|
|
1390
|
+
4144912697,
|
|
1391
|
+
1731405415,
|
|
1392
|
+
4290775857,
|
|
1393
|
+
2394180231,
|
|
1394
|
+
1750603025,
|
|
1395
|
+
3675008525,
|
|
1396
|
+
1694076839,
|
|
1397
|
+
1203062813,
|
|
1398
|
+
3204075428
|
|
1399
|
+
]), z.SHA512_IV = Uint32Array.from([
|
|
1400
|
+
1779033703,
|
|
1401
|
+
4089235720,
|
|
1402
|
+
3144134277,
|
|
1403
|
+
2227873595,
|
|
1404
|
+
1013904242,
|
|
1405
|
+
4271175723,
|
|
1406
|
+
2773480762,
|
|
1407
|
+
1595750129,
|
|
1408
|
+
1359893119,
|
|
1409
|
+
2917565137,
|
|
1410
|
+
2600822924,
|
|
1411
|
+
725511199,
|
|
1412
|
+
528734635,
|
|
1413
|
+
4215389547,
|
|
1414
|
+
1541459225,
|
|
1415
|
+
327033209
|
|
1416
|
+
]), z;
|
|
1417
|
+
}
|
|
1418
|
+
var O = {}, de;
|
|
1419
|
+
function es() {
|
|
1420
|
+
if (de) return O;
|
|
1421
|
+
de = 1, Object.defineProperty(O, "__esModule", { value: !0 }), O.toBig = O.shrSL = O.shrSH = O.rotrSL = O.rotrSH = O.rotrBL = O.rotrBH = O.rotr32L = O.rotr32H = O.rotlSL = O.rotlSH = O.rotlBL = O.rotlBH = O.add5L = O.add5H = O.add4L = O.add4H = O.add3L = O.add3H = void 0, O.add = W, O.fromBig = s, O.split = o;
|
|
1422
|
+
const t = /* @__PURE__ */ BigInt(2 ** 32 - 1), e = /* @__PURE__ */ BigInt(32);
|
|
1423
|
+
function s(h, u = !1) {
|
|
1424
|
+
return u ? { h: Number(h & t), l: Number(h >> e & t) } : { h: Number(h >> e & t) | 0, l: Number(h & t) | 0 };
|
|
1425
|
+
}
|
|
1426
|
+
function o(h, u = !1) {
|
|
1427
|
+
const l = h.length;
|
|
1428
|
+
let L = new Uint32Array(l), p = new Uint32Array(l);
|
|
1429
|
+
for (let U = 0; U < l; U++) {
|
|
1430
|
+
const { h: F, l: M } = s(h[U], u);
|
|
1431
|
+
[L[U], p[U]] = [F, M];
|
|
1432
|
+
}
|
|
1433
|
+
return [L, p];
|
|
1434
|
+
}
|
|
1435
|
+
const i = (h, u) => BigInt(h >>> 0) << e | BigInt(u >>> 0);
|
|
1436
|
+
O.toBig = i;
|
|
1437
|
+
const c = (h, u, l) => h >>> l;
|
|
1438
|
+
O.shrSH = c;
|
|
1439
|
+
const r = (h, u, l) => h << 32 - l | u >>> l;
|
|
1440
|
+
O.shrSL = r;
|
|
1441
|
+
const a = (h, u, l) => h >>> l | u << 32 - l;
|
|
1442
|
+
O.rotrSH = a;
|
|
1443
|
+
const d = (h, u, l) => h << 32 - l | u >>> l;
|
|
1444
|
+
O.rotrSL = d;
|
|
1445
|
+
const x = (h, u, l) => h << 64 - l | u >>> l - 32;
|
|
1446
|
+
O.rotrBH = x;
|
|
1447
|
+
const H = (h, u, l) => h >>> l - 32 | u << 64 - l;
|
|
1448
|
+
O.rotrBL = H;
|
|
1449
|
+
const f = (h, u) => u;
|
|
1450
|
+
O.rotr32H = f;
|
|
1451
|
+
const g = (h, u) => h;
|
|
1452
|
+
O.rotr32L = g;
|
|
1453
|
+
const w = (h, u, l) => h << l | u >>> 32 - l;
|
|
1454
|
+
O.rotlSH = w;
|
|
1455
|
+
const S = (h, u, l) => u << l | h >>> 32 - l;
|
|
1456
|
+
O.rotlSL = S;
|
|
1457
|
+
const I = (h, u, l) => u << l - 32 | h >>> 64 - l;
|
|
1458
|
+
O.rotlBH = I;
|
|
1459
|
+
const D = (h, u, l) => h << l - 32 | u >>> 64 - l;
|
|
1460
|
+
O.rotlBL = D;
|
|
1461
|
+
function W(h, u, l, L) {
|
|
1462
|
+
const p = (u >>> 0) + (L >>> 0);
|
|
1463
|
+
return { h: h + l + (p / 2 ** 32 | 0) | 0, l: p | 0 };
|
|
1464
|
+
}
|
|
1465
|
+
const v = (h, u, l) => (h >>> 0) + (u >>> 0) + (l >>> 0);
|
|
1466
|
+
O.add3L = v;
|
|
1467
|
+
const _ = (h, u, l, L) => u + l + L + (h / 2 ** 32 | 0) | 0;
|
|
1468
|
+
O.add3H = _;
|
|
1469
|
+
const C = (h, u, l, L) => (h >>> 0) + (u >>> 0) + (l >>> 0) + (L >>> 0);
|
|
1470
|
+
O.add4L = C;
|
|
1471
|
+
const A = (h, u, l, L, p) => u + l + L + p + (h / 2 ** 32 | 0) | 0;
|
|
1472
|
+
O.add4H = A;
|
|
1473
|
+
const B = (h, u, l, L, p) => (h >>> 0) + (u >>> 0) + (l >>> 0) + (L >>> 0) + (p >>> 0);
|
|
1474
|
+
O.add5L = B;
|
|
1475
|
+
const m = (h, u, l, L, p, U) => u + l + L + p + U + (h / 2 ** 32 | 0) | 0;
|
|
1476
|
+
O.add5H = m;
|
|
1477
|
+
const E = {
|
|
1478
|
+
fromBig: s,
|
|
1479
|
+
split: o,
|
|
1480
|
+
toBig: i,
|
|
1481
|
+
shrSH: c,
|
|
1482
|
+
shrSL: r,
|
|
1483
|
+
rotrSH: a,
|
|
1484
|
+
rotrSL: d,
|
|
1485
|
+
rotrBH: x,
|
|
1486
|
+
rotrBL: H,
|
|
1487
|
+
rotr32H: f,
|
|
1488
|
+
rotr32L: g,
|
|
1489
|
+
rotlSH: w,
|
|
1490
|
+
rotlSL: S,
|
|
1491
|
+
rotlBH: I,
|
|
1492
|
+
rotlBL: D,
|
|
1493
|
+
add: W,
|
|
1494
|
+
add3L: v,
|
|
1495
|
+
add3H: _,
|
|
1496
|
+
add4L: C,
|
|
1497
|
+
add4H: A,
|
|
1498
|
+
add5H: m,
|
|
1499
|
+
add5L: B
|
|
1500
|
+
};
|
|
1501
|
+
return O.default = E, O;
|
|
1502
|
+
}
|
|
1503
|
+
var ue;
|
|
1504
|
+
function ss() {
|
|
1505
|
+
if (ue) return R;
|
|
1506
|
+
ue = 1, Object.defineProperty(R, "__esModule", { value: !0 }), R.sha512_224 = R.sha512_256 = R.sha384 = R.sha512 = R.sha224 = R.sha256 = R.SHA512_256 = R.SHA512_224 = R.SHA384 = R.SHA512 = R.SHA224 = R.SHA256 = void 0;
|
|
1507
|
+
const t = /* @__PURE__ */ ts(), e = /* @__PURE__ */ es(), s = /* @__PURE__ */ Xe(), o = /* @__PURE__ */ Uint32Array.from([
|
|
1508
|
+
1116352408,
|
|
1509
|
+
1899447441,
|
|
1510
|
+
3049323471,
|
|
1511
|
+
3921009573,
|
|
1512
|
+
961987163,
|
|
1513
|
+
1508970993,
|
|
1514
|
+
2453635748,
|
|
1515
|
+
2870763221,
|
|
1516
|
+
3624381080,
|
|
1517
|
+
310598401,
|
|
1518
|
+
607225278,
|
|
1519
|
+
1426881987,
|
|
1520
|
+
1925078388,
|
|
1521
|
+
2162078206,
|
|
1522
|
+
2614888103,
|
|
1523
|
+
3248222580,
|
|
1524
|
+
3835390401,
|
|
1525
|
+
4022224774,
|
|
1526
|
+
264347078,
|
|
1527
|
+
604807628,
|
|
1528
|
+
770255983,
|
|
1529
|
+
1249150122,
|
|
1530
|
+
1555081692,
|
|
1531
|
+
1996064986,
|
|
1532
|
+
2554220882,
|
|
1533
|
+
2821834349,
|
|
1534
|
+
2952996808,
|
|
1535
|
+
3210313671,
|
|
1536
|
+
3336571891,
|
|
1537
|
+
3584528711,
|
|
1538
|
+
113926993,
|
|
1539
|
+
338241895,
|
|
1540
|
+
666307205,
|
|
1541
|
+
773529912,
|
|
1542
|
+
1294757372,
|
|
1543
|
+
1396182291,
|
|
1544
|
+
1695183700,
|
|
1545
|
+
1986661051,
|
|
1546
|
+
2177026350,
|
|
1547
|
+
2456956037,
|
|
1548
|
+
2730485921,
|
|
1549
|
+
2820302411,
|
|
1550
|
+
3259730800,
|
|
1551
|
+
3345764771,
|
|
1552
|
+
3516065817,
|
|
1553
|
+
3600352804,
|
|
1554
|
+
4094571909,
|
|
1555
|
+
275423344,
|
|
1556
|
+
430227734,
|
|
1557
|
+
506948616,
|
|
1558
|
+
659060556,
|
|
1559
|
+
883997877,
|
|
1560
|
+
958139571,
|
|
1561
|
+
1322822218,
|
|
1562
|
+
1537002063,
|
|
1563
|
+
1747873779,
|
|
1564
|
+
1955562222,
|
|
1565
|
+
2024104815,
|
|
1566
|
+
2227730452,
|
|
1567
|
+
2361852424,
|
|
1568
|
+
2428436474,
|
|
1569
|
+
2756734187,
|
|
1570
|
+
3204031479,
|
|
1571
|
+
3329325298
|
|
1572
|
+
]), i = /* @__PURE__ */ new Uint32Array(64);
|
|
1573
|
+
class c extends t.HashMD {
|
|
1574
|
+
constructor(_ = 32) {
|
|
1575
|
+
super(64, _, 8, !1), this.A = t.SHA256_IV[0] | 0, this.B = t.SHA256_IV[1] | 0, this.C = t.SHA256_IV[2] | 0, this.D = t.SHA256_IV[3] | 0, this.E = t.SHA256_IV[4] | 0, this.F = t.SHA256_IV[5] | 0, this.G = t.SHA256_IV[6] | 0, this.H = t.SHA256_IV[7] | 0;
|
|
1576
|
+
}
|
|
1577
|
+
get() {
|
|
1578
|
+
const { A: _, B: C, C: A, D: B, E: m, F: E, G: h, H: u } = this;
|
|
1579
|
+
return [_, C, A, B, m, E, h, u];
|
|
1580
|
+
}
|
|
1581
|
+
// prettier-ignore
|
|
1582
|
+
set(_, C, A, B, m, E, h, u) {
|
|
1583
|
+
this.A = _ | 0, this.B = C | 0, this.C = A | 0, this.D = B | 0, this.E = m | 0, this.F = E | 0, this.G = h | 0, this.H = u | 0;
|
|
1584
|
+
}
|
|
1585
|
+
process(_, C) {
|
|
1586
|
+
for (let p = 0; p < 16; p++, C += 4)
|
|
1587
|
+
i[p] = _.getUint32(C, !1);
|
|
1588
|
+
for (let p = 16; p < 64; p++) {
|
|
1589
|
+
const U = i[p - 15], F = i[p - 2], M = (0, s.rotr)(U, 7) ^ (0, s.rotr)(U, 18) ^ U >>> 3, G = (0, s.rotr)(F, 17) ^ (0, s.rotr)(F, 19) ^ F >>> 10;
|
|
1590
|
+
i[p] = G + i[p - 7] + M + i[p - 16] | 0;
|
|
1591
|
+
}
|
|
1592
|
+
let { A, B, C: m, D: E, E: h, F: u, G: l, H: L } = this;
|
|
1593
|
+
for (let p = 0; p < 64; p++) {
|
|
1594
|
+
const U = (0, s.rotr)(h, 6) ^ (0, s.rotr)(h, 11) ^ (0, s.rotr)(h, 25), F = L + U + (0, t.Chi)(h, u, l) + o[p] + i[p] | 0, G = ((0, s.rotr)(A, 2) ^ (0, s.rotr)(A, 13) ^ (0, s.rotr)(A, 22)) + (0, t.Maj)(A, B, m) | 0;
|
|
1595
|
+
L = l, l = u, u = h, h = E + F | 0, E = m, m = B, B = A, A = F + G | 0;
|
|
1596
|
+
}
|
|
1597
|
+
A = A + this.A | 0, B = B + this.B | 0, m = m + this.C | 0, E = E + this.D | 0, h = h + this.E | 0, u = u + this.F | 0, l = l + this.G | 0, L = L + this.H | 0, this.set(A, B, m, E, h, u, l, L);
|
|
1598
|
+
}
|
|
1599
|
+
roundClean() {
|
|
1600
|
+
(0, s.clean)(i);
|
|
1601
|
+
}
|
|
1602
|
+
destroy() {
|
|
1603
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0), (0, s.clean)(this.buffer);
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
R.SHA256 = c;
|
|
1607
|
+
class r extends c {
|
|
1608
|
+
constructor() {
|
|
1609
|
+
super(28), this.A = t.SHA224_IV[0] | 0, this.B = t.SHA224_IV[1] | 0, this.C = t.SHA224_IV[2] | 0, this.D = t.SHA224_IV[3] | 0, this.E = t.SHA224_IV[4] | 0, this.F = t.SHA224_IV[5] | 0, this.G = t.SHA224_IV[6] | 0, this.H = t.SHA224_IV[7] | 0;
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
R.SHA224 = r;
|
|
1613
|
+
const a = e.split([
|
|
1614
|
+
"0x428a2f98d728ae22",
|
|
1615
|
+
"0x7137449123ef65cd",
|
|
1616
|
+
"0xb5c0fbcfec4d3b2f",
|
|
1617
|
+
"0xe9b5dba58189dbbc",
|
|
1618
|
+
"0x3956c25bf348b538",
|
|
1619
|
+
"0x59f111f1b605d019",
|
|
1620
|
+
"0x923f82a4af194f9b",
|
|
1621
|
+
"0xab1c5ed5da6d8118",
|
|
1622
|
+
"0xd807aa98a3030242",
|
|
1623
|
+
"0x12835b0145706fbe",
|
|
1624
|
+
"0x243185be4ee4b28c",
|
|
1625
|
+
"0x550c7dc3d5ffb4e2",
|
|
1626
|
+
"0x72be5d74f27b896f",
|
|
1627
|
+
"0x80deb1fe3b1696b1",
|
|
1628
|
+
"0x9bdc06a725c71235",
|
|
1629
|
+
"0xc19bf174cf692694",
|
|
1630
|
+
"0xe49b69c19ef14ad2",
|
|
1631
|
+
"0xefbe4786384f25e3",
|
|
1632
|
+
"0x0fc19dc68b8cd5b5",
|
|
1633
|
+
"0x240ca1cc77ac9c65",
|
|
1634
|
+
"0x2de92c6f592b0275",
|
|
1635
|
+
"0x4a7484aa6ea6e483",
|
|
1636
|
+
"0x5cb0a9dcbd41fbd4",
|
|
1637
|
+
"0x76f988da831153b5",
|
|
1638
|
+
"0x983e5152ee66dfab",
|
|
1639
|
+
"0xa831c66d2db43210",
|
|
1640
|
+
"0xb00327c898fb213f",
|
|
1641
|
+
"0xbf597fc7beef0ee4",
|
|
1642
|
+
"0xc6e00bf33da88fc2",
|
|
1643
|
+
"0xd5a79147930aa725",
|
|
1644
|
+
"0x06ca6351e003826f",
|
|
1645
|
+
"0x142929670a0e6e70",
|
|
1646
|
+
"0x27b70a8546d22ffc",
|
|
1647
|
+
"0x2e1b21385c26c926",
|
|
1648
|
+
"0x4d2c6dfc5ac42aed",
|
|
1649
|
+
"0x53380d139d95b3df",
|
|
1650
|
+
"0x650a73548baf63de",
|
|
1651
|
+
"0x766a0abb3c77b2a8",
|
|
1652
|
+
"0x81c2c92e47edaee6",
|
|
1653
|
+
"0x92722c851482353b",
|
|
1654
|
+
"0xa2bfe8a14cf10364",
|
|
1655
|
+
"0xa81a664bbc423001",
|
|
1656
|
+
"0xc24b8b70d0f89791",
|
|
1657
|
+
"0xc76c51a30654be30",
|
|
1658
|
+
"0xd192e819d6ef5218",
|
|
1659
|
+
"0xd69906245565a910",
|
|
1660
|
+
"0xf40e35855771202a",
|
|
1661
|
+
"0x106aa07032bbd1b8",
|
|
1662
|
+
"0x19a4c116b8d2d0c8",
|
|
1663
|
+
"0x1e376c085141ab53",
|
|
1664
|
+
"0x2748774cdf8eeb99",
|
|
1665
|
+
"0x34b0bcb5e19b48a8",
|
|
1666
|
+
"0x391c0cb3c5c95a63",
|
|
1667
|
+
"0x4ed8aa4ae3418acb",
|
|
1668
|
+
"0x5b9cca4f7763e373",
|
|
1669
|
+
"0x682e6ff3d6b2b8a3",
|
|
1670
|
+
"0x748f82ee5defb2fc",
|
|
1671
|
+
"0x78a5636f43172f60",
|
|
1672
|
+
"0x84c87814a1f0ab72",
|
|
1673
|
+
"0x8cc702081a6439ec",
|
|
1674
|
+
"0x90befffa23631e28",
|
|
1675
|
+
"0xa4506cebde82bde9",
|
|
1676
|
+
"0xbef9a3f7b2c67915",
|
|
1677
|
+
"0xc67178f2e372532b",
|
|
1678
|
+
"0xca273eceea26619c",
|
|
1679
|
+
"0xd186b8c721c0c207",
|
|
1680
|
+
"0xeada7dd6cde0eb1e",
|
|
1681
|
+
"0xf57d4f7fee6ed178",
|
|
1682
|
+
"0x06f067aa72176fba",
|
|
1683
|
+
"0x0a637dc5a2c898a6",
|
|
1684
|
+
"0x113f9804bef90dae",
|
|
1685
|
+
"0x1b710b35131c471b",
|
|
1686
|
+
"0x28db77f523047d84",
|
|
1687
|
+
"0x32caab7b40c72493",
|
|
1688
|
+
"0x3c9ebe0a15c9bebc",
|
|
1689
|
+
"0x431d67c49c100d4c",
|
|
1690
|
+
"0x4cc5d4becb3e42b6",
|
|
1691
|
+
"0x597f299cfc657e2a",
|
|
1692
|
+
"0x5fcb6fab3ad6faec",
|
|
1693
|
+
"0x6c44198c4a475817"
|
|
1694
|
+
].map((v) => BigInt(v))), d = a[0], x = a[1], H = /* @__PURE__ */ new Uint32Array(80), f = /* @__PURE__ */ new Uint32Array(80);
|
|
1695
|
+
class g extends t.HashMD {
|
|
1696
|
+
constructor(_ = 64) {
|
|
1697
|
+
super(128, _, 16, !1), this.Ah = t.SHA512_IV[0] | 0, this.Al = t.SHA512_IV[1] | 0, this.Bh = t.SHA512_IV[2] | 0, this.Bl = t.SHA512_IV[3] | 0, this.Ch = t.SHA512_IV[4] | 0, this.Cl = t.SHA512_IV[5] | 0, this.Dh = t.SHA512_IV[6] | 0, this.Dl = t.SHA512_IV[7] | 0, this.Eh = t.SHA512_IV[8] | 0, this.El = t.SHA512_IV[9] | 0, this.Fh = t.SHA512_IV[10] | 0, this.Fl = t.SHA512_IV[11] | 0, this.Gh = t.SHA512_IV[12] | 0, this.Gl = t.SHA512_IV[13] | 0, this.Hh = t.SHA512_IV[14] | 0, this.Hl = t.SHA512_IV[15] | 0;
|
|
1698
|
+
}
|
|
1699
|
+
// prettier-ignore
|
|
1700
|
+
get() {
|
|
1701
|
+
const { Ah: _, Al: C, Bh: A, Bl: B, Ch: m, Cl: E, Dh: h, Dl: u, Eh: l, El: L, Fh: p, Fl: U, Gh: F, Gl: M, Hh: G, Hl: q } = this;
|
|
1702
|
+
return [_, C, A, B, m, E, h, u, l, L, p, U, F, M, G, q];
|
|
1703
|
+
}
|
|
1704
|
+
// prettier-ignore
|
|
1705
|
+
set(_, C, A, B, m, E, h, u, l, L, p, U, F, M, G, q) {
|
|
1706
|
+
this.Ah = _ | 0, this.Al = C | 0, this.Bh = A | 0, this.Bl = B | 0, this.Ch = m | 0, this.Cl = E | 0, this.Dh = h | 0, this.Dl = u | 0, this.Eh = l | 0, this.El = L | 0, this.Fh = p | 0, this.Fl = U | 0, this.Gh = F | 0, this.Gl = M | 0, this.Hh = G | 0, this.Hl = q | 0;
|
|
1707
|
+
}
|
|
1708
|
+
process(_, C) {
|
|
1709
|
+
for (let y = 0; y < 16; y++, C += 4)
|
|
1710
|
+
H[y] = _.getUint32(C), f[y] = _.getUint32(C += 4);
|
|
1711
|
+
for (let y = 16; y < 80; y++) {
|
|
1712
|
+
const V = H[y - 15] | 0, k = f[y - 15] | 0, j = e.rotrSH(V, k, 1) ^ e.rotrSH(V, k, 8) ^ e.shrSH(V, k, 7), et = e.rotrSL(V, k, 1) ^ e.rotrSL(V, k, 8) ^ e.shrSL(V, k, 7), K = H[y - 2] | 0, N = f[y - 2] | 0, ot = e.rotrSH(K, N, 19) ^ e.rotrBH(K, N, 61) ^ e.shrSH(K, N, 6), St = e.rotrSL(K, N, 19) ^ e.rotrBL(K, N, 61) ^ e.shrSL(K, N, 6), at = e.add4L(et, St, f[y - 7], f[y - 16]), wt = e.add4H(at, j, ot, H[y - 7], H[y - 16]);
|
|
1713
|
+
H[y] = wt | 0, f[y] = at | 0;
|
|
1714
|
+
}
|
|
1715
|
+
let { Ah: A, Al: B, Bh: m, Bl: E, Ch: h, Cl: u, Dh: l, Dl: L, Eh: p, El: U, Fh: F, Fl: M, Gh: G, Gl: q, Hh: n, Hl: b } = this;
|
|
1716
|
+
for (let y = 0; y < 80; y++) {
|
|
1717
|
+
const V = e.rotrSH(p, U, 14) ^ e.rotrSH(p, U, 18) ^ e.rotrBH(p, U, 41), k = e.rotrSL(p, U, 14) ^ e.rotrSL(p, U, 18) ^ e.rotrBL(p, U, 41), j = p & F ^ ~p & G, et = U & M ^ ~U & q, K = e.add5L(b, k, et, x[y], f[y]), N = e.add5H(K, n, V, j, d[y], H[y]), ot = K | 0, St = e.rotrSH(A, B, 28) ^ e.rotrBH(A, B, 34) ^ e.rotrBH(A, B, 39), at = e.rotrSL(A, B, 28) ^ e.rotrBL(A, B, 34) ^ e.rotrBL(A, B, 39), wt = A & m ^ A & h ^ m & h, Pt = B & E ^ B & u ^ E & u;
|
|
1718
|
+
n = G | 0, b = q | 0, G = F | 0, q = M | 0, F = p | 0, M = U | 0, { h: p, l: U } = e.add(l | 0, L | 0, N | 0, ot | 0), l = h | 0, L = u | 0, h = m | 0, u = E | 0, m = A | 0, E = B | 0;
|
|
1719
|
+
const Ut = e.add3L(ot, at, Pt);
|
|
1720
|
+
A = e.add3H(Ut, N, St, wt), B = Ut | 0;
|
|
1721
|
+
}
|
|
1722
|
+
({ h: A, l: B } = e.add(this.Ah | 0, this.Al | 0, A | 0, B | 0)), { h: m, l: E } = e.add(this.Bh | 0, this.Bl | 0, m | 0, E | 0), { h, l: u } = e.add(this.Ch | 0, this.Cl | 0, h | 0, u | 0), { h: l, l: L } = e.add(this.Dh | 0, this.Dl | 0, l | 0, L | 0), { h: p, l: U } = e.add(this.Eh | 0, this.El | 0, p | 0, U | 0), { h: F, l: M } = e.add(this.Fh | 0, this.Fl | 0, F | 0, M | 0), { h: G, l: q } = e.add(this.Gh | 0, this.Gl | 0, G | 0, q | 0), { h: n, l: b } = e.add(this.Hh | 0, this.Hl | 0, n | 0, b | 0), this.set(A, B, m, E, h, u, l, L, p, U, F, M, G, q, n, b);
|
|
1723
|
+
}
|
|
1724
|
+
roundClean() {
|
|
1725
|
+
(0, s.clean)(H, f);
|
|
1726
|
+
}
|
|
1727
|
+
destroy() {
|
|
1728
|
+
(0, s.clean)(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
R.SHA512 = g;
|
|
1732
|
+
class w extends g {
|
|
1733
|
+
constructor() {
|
|
1734
|
+
super(48), this.Ah = t.SHA384_IV[0] | 0, this.Al = t.SHA384_IV[1] | 0, this.Bh = t.SHA384_IV[2] | 0, this.Bl = t.SHA384_IV[3] | 0, this.Ch = t.SHA384_IV[4] | 0, this.Cl = t.SHA384_IV[5] | 0, this.Dh = t.SHA384_IV[6] | 0, this.Dl = t.SHA384_IV[7] | 0, this.Eh = t.SHA384_IV[8] | 0, this.El = t.SHA384_IV[9] | 0, this.Fh = t.SHA384_IV[10] | 0, this.Fl = t.SHA384_IV[11] | 0, this.Gh = t.SHA384_IV[12] | 0, this.Gl = t.SHA384_IV[13] | 0, this.Hh = t.SHA384_IV[14] | 0, this.Hl = t.SHA384_IV[15] | 0;
|
|
1735
|
+
}
|
|
412
1736
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
1737
|
+
R.SHA384 = w;
|
|
1738
|
+
const S = /* @__PURE__ */ Uint32Array.from([
|
|
1739
|
+
2352822216,
|
|
1740
|
+
424955298,
|
|
1741
|
+
1944164710,
|
|
1742
|
+
2312950998,
|
|
1743
|
+
502970286,
|
|
1744
|
+
855612546,
|
|
1745
|
+
1738396948,
|
|
1746
|
+
1479516111,
|
|
1747
|
+
258812777,
|
|
1748
|
+
2077511080,
|
|
1749
|
+
2011393907,
|
|
1750
|
+
79989058,
|
|
1751
|
+
1067287976,
|
|
1752
|
+
1780299464,
|
|
1753
|
+
286451373,
|
|
1754
|
+
2446758561
|
|
1755
|
+
]), I = /* @__PURE__ */ Uint32Array.from([
|
|
1756
|
+
573645204,
|
|
1757
|
+
4230739756,
|
|
1758
|
+
2673172387,
|
|
1759
|
+
3360449730,
|
|
1760
|
+
596883563,
|
|
1761
|
+
1867755857,
|
|
1762
|
+
2520282905,
|
|
1763
|
+
1497426621,
|
|
1764
|
+
2519219938,
|
|
1765
|
+
2827943907,
|
|
1766
|
+
3193839141,
|
|
1767
|
+
1401305490,
|
|
1768
|
+
721525244,
|
|
1769
|
+
746961066,
|
|
1770
|
+
246885852,
|
|
1771
|
+
2177182882
|
|
1772
|
+
]);
|
|
1773
|
+
class D extends g {
|
|
1774
|
+
constructor() {
|
|
1775
|
+
super(28), this.Ah = S[0] | 0, this.Al = S[1] | 0, this.Bh = S[2] | 0, this.Bl = S[3] | 0, this.Ch = S[4] | 0, this.Cl = S[5] | 0, this.Dh = S[6] | 0, this.Dl = S[7] | 0, this.Eh = S[8] | 0, this.El = S[9] | 0, this.Fh = S[10] | 0, this.Fl = S[11] | 0, this.Gh = S[12] | 0, this.Gl = S[13] | 0, this.Hh = S[14] | 0, this.Hl = S[15] | 0;
|
|
1776
|
+
}
|
|
417
1777
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
1778
|
+
R.SHA512_224 = D;
|
|
1779
|
+
class W extends g {
|
|
1780
|
+
constructor() {
|
|
1781
|
+
super(32), this.Ah = I[0] | 0, this.Al = I[1] | 0, this.Bh = I[2] | 0, this.Bl = I[3] | 0, this.Ch = I[4] | 0, this.Cl = I[5] | 0, this.Dh = I[6] | 0, this.Dl = I[7] | 0, this.Eh = I[8] | 0, this.El = I[9] | 0, this.Fh = I[10] | 0, this.Fl = I[11] | 0, this.Gh = I[12] | 0, this.Gl = I[13] | 0, this.Hh = I[14] | 0, this.Hl = I[15] | 0;
|
|
1782
|
+
}
|
|
421
1783
|
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
1784
|
+
return R.SHA512_256 = W, R.sha256 = (0, s.createHasher)(() => new c()), R.sha224 = (0, s.createHasher)(() => new r()), R.sha512 = (0, s.createHasher)(() => new g()), R.sha384 = (0, s.createHasher)(() => new w()), R.sha512_256 = (0, s.createHasher)(() => new W()), R.sha512_224 = (0, s.createHasher)(() => new D()), R;
|
|
1785
|
+
}
|
|
1786
|
+
var le;
|
|
1787
|
+
function Is() {
|
|
1788
|
+
if (le) return st;
|
|
1789
|
+
le = 1, Object.defineProperty(st, "__esModule", { value: !0 }), st.sha224 = st.SHA224 = st.sha256 = st.SHA256 = void 0;
|
|
1790
|
+
const t = /* @__PURE__ */ ss();
|
|
1791
|
+
return st.SHA256 = t.SHA256, st.sha256 = t.sha256, st.SHA224 = t.SHA224, st.sha224 = t.sha224, st;
|
|
1792
|
+
}
|
|
1793
|
+
const ns = BigInt(0), Vt = BigInt(1), rs = BigInt(2), is = BigInt(7), cs = BigInt(256), os = BigInt(113), Je = [], Qe = [], Ye = [];
|
|
1794
|
+
for (let t = 0, e = Vt, s = 1, o = 0; t < 24; t++) {
|
|
1795
|
+
[s, o] = [o, (2 * s + 3 * o) % 5], Je.push(2 * (5 * o + s)), Qe.push((t + 1) * (t + 2) / 2 % 64);
|
|
1796
|
+
let i = ns;
|
|
1797
|
+
for (let c = 0; c < 7; c++)
|
|
1798
|
+
e = (e << Vt ^ (e >> is) * os) % cs, e & rs && (i ^= Vt << (Vt << BigInt(c)) - Vt);
|
|
1799
|
+
Ye.push(i);
|
|
1800
|
+
}
|
|
1801
|
+
const Ze = Me(Ye, !0), as = Ze[0], hs = Ze[1], be = (t, e, s) => s > 32 ? O0(t, e, s) : k0(t, e, s), xe = (t, e, s) => s > 32 ? T0(t, e, s) : F0(t, e, s);
|
|
1802
|
+
function fs(t, e = 24) {
|
|
1803
|
+
const s = new Uint32Array(10);
|
|
1804
|
+
for (let o = 24 - e; o < 24; o++) {
|
|
1805
|
+
for (let r = 0; r < 10; r++)
|
|
1806
|
+
s[r] = t[r] ^ t[r + 10] ^ t[r + 20] ^ t[r + 30] ^ t[r + 40];
|
|
1807
|
+
for (let r = 0; r < 10; r += 2) {
|
|
1808
|
+
const a = (r + 8) % 10, d = (r + 2) % 10, x = s[d], H = s[d + 1], f = be(x, H, 1) ^ s[a], g = xe(x, H, 1) ^ s[a + 1];
|
|
1809
|
+
for (let w = 0; w < 50; w += 10)
|
|
1810
|
+
t[r + w] ^= f, t[r + w + 1] ^= g;
|
|
1811
|
+
}
|
|
1812
|
+
let i = t[2], c = t[3];
|
|
1813
|
+
for (let r = 0; r < 24; r++) {
|
|
1814
|
+
const a = Qe[r], d = be(i, c, a), x = xe(i, c, a), H = Je[r];
|
|
1815
|
+
i = t[H], c = t[H + 1], t[H] = d, t[H + 1] = x;
|
|
1816
|
+
}
|
|
1817
|
+
for (let r = 0; r < 50; r += 10) {
|
|
1818
|
+
for (let a = 0; a < 10; a++)
|
|
1819
|
+
s[a] = t[r + a];
|
|
1820
|
+
for (let a = 0; a < 10; a++)
|
|
1821
|
+
t[r + a] ^= ~s[(a + 2) % 10] & s[(a + 4) % 10];
|
|
1822
|
+
}
|
|
1823
|
+
t[0] ^= as[o], t[1] ^= hs[o];
|
|
1824
|
+
}
|
|
1825
|
+
tt(s);
|
|
1826
|
+
}
|
|
1827
|
+
class te {
|
|
1828
|
+
state;
|
|
1829
|
+
pos = 0;
|
|
1830
|
+
posOut = 0;
|
|
1831
|
+
finished = !1;
|
|
1832
|
+
state32;
|
|
1833
|
+
destroyed = !1;
|
|
1834
|
+
blockLen;
|
|
1835
|
+
suffix;
|
|
1836
|
+
outputLen;
|
|
1837
|
+
enableXOF = !1;
|
|
1838
|
+
rounds;
|
|
1839
|
+
// NOTE: we accept arguments in bytes instead of bits here.
|
|
1840
|
+
constructor(e, s, o, i = !1, c = 24) {
|
|
1841
|
+
if (this.blockLen = e, this.suffix = s, this.outputLen = o, this.enableXOF = i, this.rounds = c, Gt(o, "outputLen"), !(0 < e && e < 200))
|
|
1842
|
+
throw new Error("only keccak-f1600 function is supported");
|
|
1843
|
+
this.state = new Uint8Array(200), this.state32 = b0(this.state);
|
|
1844
|
+
}
|
|
1845
|
+
clone() {
|
|
1846
|
+
return this._cloneInto();
|
|
1847
|
+
}
|
|
1848
|
+
keccak() {
|
|
1849
|
+
se(this.state32), fs(this.state32, this.rounds), se(this.state32), this.posOut = 0, this.pos = 0;
|
|
1850
|
+
}
|
|
1851
|
+
update(e) {
|
|
1852
|
+
mt(this), _t(e);
|
|
1853
|
+
const { blockLen: s, state: o } = this, i = e.length;
|
|
1854
|
+
for (let c = 0; c < i; ) {
|
|
1855
|
+
const r = Math.min(s - this.pos, i - c);
|
|
1856
|
+
for (let a = 0; a < r; a++)
|
|
1857
|
+
o[this.pos++] ^= e[c++];
|
|
1858
|
+
this.pos === s && this.keccak();
|
|
428
1859
|
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
1860
|
+
return this;
|
|
1861
|
+
}
|
|
1862
|
+
finish() {
|
|
1863
|
+
if (this.finished)
|
|
1864
|
+
return;
|
|
1865
|
+
this.finished = !0;
|
|
1866
|
+
const { state: e, suffix: s, pos: o, blockLen: i } = this;
|
|
1867
|
+
e[o] ^= s, (s & 128) !== 0 && o === i - 1 && this.keccak(), e[i - 1] ^= 128, this.keccak();
|
|
1868
|
+
}
|
|
1869
|
+
writeInto(e) {
|
|
1870
|
+
mt(this, !1), _t(e), this.finish();
|
|
1871
|
+
const s = this.state, { blockLen: o } = this;
|
|
1872
|
+
for (let i = 0, c = e.length; i < c; ) {
|
|
1873
|
+
this.posOut >= o && this.keccak();
|
|
1874
|
+
const r = Math.min(o - this.posOut, c - i);
|
|
1875
|
+
e.set(s.subarray(this.posOut, this.posOut + r), i), this.posOut += r, i += r;
|
|
435
1876
|
}
|
|
436
|
-
|
|
1877
|
+
return e;
|
|
437
1878
|
}
|
|
438
|
-
|
|
439
|
-
|
|
1879
|
+
xofInto(e) {
|
|
1880
|
+
if (!this.enableXOF)
|
|
1881
|
+
throw new Error("XOF is not possible for this instance");
|
|
1882
|
+
return this.writeInto(e);
|
|
1883
|
+
}
|
|
1884
|
+
xof(e) {
|
|
1885
|
+
return Gt(e), this.xofInto(new Uint8Array(e));
|
|
1886
|
+
}
|
|
1887
|
+
digestInto(e) {
|
|
1888
|
+
if (Le(e, this), this.finished)
|
|
1889
|
+
throw new Error("digest() was already called");
|
|
1890
|
+
return this.writeInto(e), this.destroy(), e;
|
|
1891
|
+
}
|
|
1892
|
+
digest() {
|
|
1893
|
+
return this.digestInto(new Uint8Array(this.outputLen));
|
|
440
1894
|
}
|
|
441
1895
|
destroy() {
|
|
442
|
-
|
|
1896
|
+
this.destroyed = !0, tt(this.state);
|
|
1897
|
+
}
|
|
1898
|
+
_cloneInto(e) {
|
|
1899
|
+
const { blockLen: s, suffix: o, outputLen: i, rounds: c, enableXOF: r } = this;
|
|
1900
|
+
return e ||= new te(s, o, i, r, c), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = c, e.suffix = o, e.outputLen = i, e.enableXOF = r, e.destroyed = this.destroyed, e;
|
|
443
1901
|
}
|
|
444
1902
|
}
|
|
445
|
-
const
|
|
446
|
-
var
|
|
447
|
-
function
|
|
448
|
-
return
|
|
1903
|
+
const ze = (t, e, s, o = {}) => ct((i = {}) => new te(e, t, i.dkLen === void 0 ? s : i.dkLen, !0), o), Ls = /* @__PURE__ */ ze(31, 168, 16, /* @__PURE__ */ gt(11)), ms = /* @__PURE__ */ ze(31, 136, 32, /* @__PURE__ */ gt(12));
|
|
1904
|
+
var nt = {}, P = {}, $ = {}, Jt = {}, Ct = {}, He;
|
|
1905
|
+
function ds() {
|
|
1906
|
+
return He || (He = 1, Object.defineProperty(Ct, "__esModule", { value: !0 }), Ct.crypto = void 0, Ct.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0), Ct;
|
|
449
1907
|
}
|
|
450
|
-
var
|
|
451
|
-
function
|
|
452
|
-
return
|
|
453
|
-
Object.defineProperty(t, "__esModule", { value: !0 }), t.wrapXOFConstructorWithOpts = t.wrapConstructorWithOpts = t.wrapConstructor = t.Hash = t.nextTick = t.swap32IfBE = t.byteSwapIfBE = t.swap8IfBE = t.isLE = void 0, t.isBytes = s, t.anumber =
|
|
454
|
-
const e = /* @__PURE__ */
|
|
455
|
-
function s(
|
|
456
|
-
return
|
|
457
|
-
}
|
|
458
|
-
function
|
|
459
|
-
if (!Number.isSafeInteger(
|
|
460
|
-
throw new Error("positive integer expected, got " +
|
|
461
|
-
}
|
|
462
|
-
function
|
|
463
|
-
if (!s(
|
|
1908
|
+
var Ae;
|
|
1909
|
+
function Rt() {
|
|
1910
|
+
return Ae || (Ae = 1, (function(t) {
|
|
1911
|
+
Object.defineProperty(t, "__esModule", { value: !0 }), t.wrapXOFConstructorWithOpts = t.wrapConstructorWithOpts = t.wrapConstructor = t.Hash = t.nextTick = t.swap32IfBE = t.byteSwapIfBE = t.swap8IfBE = t.isLE = void 0, t.isBytes = s, t.anumber = o, t.abytes = i, t.ahash = c, t.aexists = r, t.aoutput = a, t.u8 = d, t.u32 = x, t.clean = H, t.createView = f, t.rotr = g, t.rotl = w, t.byteSwap = S, t.byteSwap32 = I, t.bytesToHex = v, t.hexToBytes = A, t.asyncLoop = m, t.utf8ToBytes = E, t.bytesToUtf8 = h, t.toBytes = u, t.kdfInputToBytes = l, t.concatBytes = L, t.checkOpts = p, t.createHasher = F, t.createOptHasher = M, t.createXOFer = G, t.randomBytes = q;
|
|
1912
|
+
const e = /* @__PURE__ */ ds();
|
|
1913
|
+
function s(n) {
|
|
1914
|
+
return n instanceof Uint8Array || ArrayBuffer.isView(n) && n.constructor.name === "Uint8Array";
|
|
1915
|
+
}
|
|
1916
|
+
function o(n) {
|
|
1917
|
+
if (!Number.isSafeInteger(n) || n < 0)
|
|
1918
|
+
throw new Error("positive integer expected, got " + n);
|
|
1919
|
+
}
|
|
1920
|
+
function i(n, ...b) {
|
|
1921
|
+
if (!s(n))
|
|
464
1922
|
throw new Error("Uint8Array expected");
|
|
465
|
-
if (
|
|
466
|
-
throw new Error("Uint8Array expected of length " +
|
|
1923
|
+
if (b.length > 0 && !b.includes(n.length))
|
|
1924
|
+
throw new Error("Uint8Array expected of length " + b + ", got length=" + n.length);
|
|
467
1925
|
}
|
|
468
|
-
function
|
|
469
|
-
if (typeof
|
|
1926
|
+
function c(n) {
|
|
1927
|
+
if (typeof n != "function" || typeof n.create != "function")
|
|
470
1928
|
throw new Error("Hash should be wrapped by utils.createHasher");
|
|
471
|
-
|
|
1929
|
+
o(n.outputLen), o(n.blockLen);
|
|
472
1930
|
}
|
|
473
|
-
function n
|
|
474
|
-
if (
|
|
1931
|
+
function r(n, b = !0) {
|
|
1932
|
+
if (n.destroyed)
|
|
475
1933
|
throw new Error("Hash instance has been destroyed");
|
|
476
|
-
if (
|
|
1934
|
+
if (b && n.finished)
|
|
477
1935
|
throw new Error("Hash#digest() has already been called");
|
|
478
1936
|
}
|
|
479
|
-
function
|
|
480
|
-
|
|
481
|
-
const
|
|
482
|
-
if (
|
|
483
|
-
throw new Error("digestInto() expects output buffer of length at least " +
|
|
1937
|
+
function a(n, b) {
|
|
1938
|
+
i(n);
|
|
1939
|
+
const y = b.outputLen;
|
|
1940
|
+
if (n.length < y)
|
|
1941
|
+
throw new Error("digestInto() expects output buffer of length at least " + y);
|
|
484
1942
|
}
|
|
485
|
-
function
|
|
486
|
-
return new Uint8Array(
|
|
1943
|
+
function d(n) {
|
|
1944
|
+
return new Uint8Array(n.buffer, n.byteOffset, n.byteLength);
|
|
487
1945
|
}
|
|
488
|
-
function x(
|
|
489
|
-
return new Uint32Array(
|
|
1946
|
+
function x(n) {
|
|
1947
|
+
return new Uint32Array(n.buffer, n.byteOffset, Math.floor(n.byteLength / 4));
|
|
490
1948
|
}
|
|
491
|
-
function H(...
|
|
492
|
-
for (let
|
|
493
|
-
|
|
1949
|
+
function H(...n) {
|
|
1950
|
+
for (let b = 0; b < n.length; b++)
|
|
1951
|
+
n[b].fill(0);
|
|
494
1952
|
}
|
|
495
|
-
function
|
|
496
|
-
return new DataView(
|
|
1953
|
+
function f(n) {
|
|
1954
|
+
return new DataView(n.buffer, n.byteOffset, n.byteLength);
|
|
497
1955
|
}
|
|
498
|
-
function
|
|
499
|
-
return
|
|
1956
|
+
function g(n, b) {
|
|
1957
|
+
return n << 32 - b | n >>> b;
|
|
500
1958
|
}
|
|
501
|
-
function
|
|
502
|
-
return
|
|
1959
|
+
function w(n, b) {
|
|
1960
|
+
return n << b | n >>> 32 - b >>> 0;
|
|
503
1961
|
}
|
|
504
1962
|
t.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
505
|
-
function
|
|
506
|
-
return
|
|
507
|
-
}
|
|
508
|
-
t.swap8IfBE = t.isLE ? (
|
|
509
|
-
function I(
|
|
510
|
-
for (let
|
|
511
|
-
|
|
512
|
-
return
|
|
513
|
-
}
|
|
514
|
-
t.swap32IfBE = t.isLE ? (
|
|
515
|
-
const
|
|
516
|
-
function
|
|
517
|
-
if (
|
|
518
|
-
return
|
|
519
|
-
let
|
|
520
|
-
for (let
|
|
521
|
-
|
|
522
|
-
return
|
|
523
|
-
}
|
|
524
|
-
const
|
|
525
|
-
function
|
|
526
|
-
if (
|
|
527
|
-
return
|
|
528
|
-
if (
|
|
529
|
-
return
|
|
530
|
-
if (
|
|
531
|
-
return
|
|
532
|
-
}
|
|
533
|
-
function
|
|
534
|
-
if (typeof
|
|
535
|
-
throw new Error("hex string expected, got " + typeof
|
|
536
|
-
if (
|
|
537
|
-
return Uint8Array.fromHex(
|
|
538
|
-
const
|
|
539
|
-
if (
|
|
540
|
-
throw new Error("hex string expected, got unpadded hex of length " +
|
|
541
|
-
const
|
|
542
|
-
for (let
|
|
543
|
-
const
|
|
544
|
-
if (
|
|
545
|
-
const
|
|
546
|
-
throw new Error('hex string expected, got non-hex character "' +
|
|
1963
|
+
function S(n) {
|
|
1964
|
+
return n << 24 & 4278190080 | n << 8 & 16711680 | n >>> 8 & 65280 | n >>> 24 & 255;
|
|
1965
|
+
}
|
|
1966
|
+
t.swap8IfBE = t.isLE ? (n) => n : (n) => S(n), t.byteSwapIfBE = t.swap8IfBE;
|
|
1967
|
+
function I(n) {
|
|
1968
|
+
for (let b = 0; b < n.length; b++)
|
|
1969
|
+
n[b] = S(n[b]);
|
|
1970
|
+
return n;
|
|
1971
|
+
}
|
|
1972
|
+
t.swap32IfBE = t.isLE ? (n) => n : I;
|
|
1973
|
+
const D = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", W = /* @__PURE__ */ Array.from({ length: 256 }, (n, b) => b.toString(16).padStart(2, "0"));
|
|
1974
|
+
function v(n) {
|
|
1975
|
+
if (i(n), D)
|
|
1976
|
+
return n.toHex();
|
|
1977
|
+
let b = "";
|
|
1978
|
+
for (let y = 0; y < n.length; y++)
|
|
1979
|
+
b += W[n[y]];
|
|
1980
|
+
return b;
|
|
1981
|
+
}
|
|
1982
|
+
const _ = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
|
|
1983
|
+
function C(n) {
|
|
1984
|
+
if (n >= _._0 && n <= _._9)
|
|
1985
|
+
return n - _._0;
|
|
1986
|
+
if (n >= _.A && n <= _.F)
|
|
1987
|
+
return n - (_.A - 10);
|
|
1988
|
+
if (n >= _.a && n <= _.f)
|
|
1989
|
+
return n - (_.a - 10);
|
|
1990
|
+
}
|
|
1991
|
+
function A(n) {
|
|
1992
|
+
if (typeof n != "string")
|
|
1993
|
+
throw new Error("hex string expected, got " + typeof n);
|
|
1994
|
+
if (D)
|
|
1995
|
+
return Uint8Array.fromHex(n);
|
|
1996
|
+
const b = n.length, y = b / 2;
|
|
1997
|
+
if (b % 2)
|
|
1998
|
+
throw new Error("hex string expected, got unpadded hex of length " + b);
|
|
1999
|
+
const V = new Uint8Array(y);
|
|
2000
|
+
for (let k = 0, j = 0; k < y; k++, j += 2) {
|
|
2001
|
+
const et = C(n.charCodeAt(j)), K = C(n.charCodeAt(j + 1));
|
|
2002
|
+
if (et === void 0 || K === void 0) {
|
|
2003
|
+
const N = n[j] + n[j + 1];
|
|
2004
|
+
throw new Error('hex string expected, got non-hex character "' + N + '" at index ' + j);
|
|
547
2005
|
}
|
|
548
|
-
|
|
2006
|
+
V[k] = et * 16 + K;
|
|
549
2007
|
}
|
|
550
|
-
return
|
|
2008
|
+
return V;
|
|
551
2009
|
}
|
|
552
|
-
const
|
|
2010
|
+
const B = async () => {
|
|
553
2011
|
};
|
|
554
|
-
t.nextTick =
|
|
555
|
-
async function
|
|
556
|
-
let
|
|
557
|
-
for (let
|
|
558
|
-
|
|
559
|
-
const
|
|
560
|
-
|
|
2012
|
+
t.nextTick = B;
|
|
2013
|
+
async function m(n, b, y) {
|
|
2014
|
+
let V = Date.now();
|
|
2015
|
+
for (let k = 0; k < n; k++) {
|
|
2016
|
+
y(k);
|
|
2017
|
+
const j = Date.now() - V;
|
|
2018
|
+
j >= 0 && j < b || (await (0, t.nextTick)(), V += j);
|
|
561
2019
|
}
|
|
562
2020
|
}
|
|
563
|
-
function
|
|
564
|
-
if (typeof
|
|
2021
|
+
function E(n) {
|
|
2022
|
+
if (typeof n != "string")
|
|
565
2023
|
throw new Error("string expected");
|
|
566
|
-
return new Uint8Array(new TextEncoder().encode(
|
|
2024
|
+
return new Uint8Array(new TextEncoder().encode(n));
|
|
567
2025
|
}
|
|
568
|
-
function
|
|
569
|
-
return new TextDecoder().decode(
|
|
2026
|
+
function h(n) {
|
|
2027
|
+
return new TextDecoder().decode(n);
|
|
570
2028
|
}
|
|
571
|
-
function
|
|
572
|
-
return typeof
|
|
2029
|
+
function u(n) {
|
|
2030
|
+
return typeof n == "string" && (n = E(n)), i(n), n;
|
|
573
2031
|
}
|
|
574
|
-
function
|
|
575
|
-
return typeof
|
|
2032
|
+
function l(n) {
|
|
2033
|
+
return typeof n == "string" && (n = E(n)), i(n), n;
|
|
576
2034
|
}
|
|
577
|
-
function
|
|
578
|
-
let
|
|
579
|
-
for (let
|
|
580
|
-
const
|
|
581
|
-
|
|
2035
|
+
function L(...n) {
|
|
2036
|
+
let b = 0;
|
|
2037
|
+
for (let V = 0; V < n.length; V++) {
|
|
2038
|
+
const k = n[V];
|
|
2039
|
+
i(k), b += k.length;
|
|
582
2040
|
}
|
|
583
|
-
const
|
|
584
|
-
for (let
|
|
585
|
-
const
|
|
586
|
-
|
|
2041
|
+
const y = new Uint8Array(b);
|
|
2042
|
+
for (let V = 0, k = 0; V < n.length; V++) {
|
|
2043
|
+
const j = n[V];
|
|
2044
|
+
y.set(j, k), k += j.length;
|
|
587
2045
|
}
|
|
588
|
-
return
|
|
2046
|
+
return y;
|
|
589
2047
|
}
|
|
590
|
-
function
|
|
591
|
-
if (
|
|
2048
|
+
function p(n, b) {
|
|
2049
|
+
if (b !== void 0 && {}.toString.call(b) !== "[object Object]")
|
|
592
2050
|
throw new Error("options should be object or undefined");
|
|
593
|
-
return Object.assign(
|
|
2051
|
+
return Object.assign(n, b);
|
|
594
2052
|
}
|
|
595
|
-
class
|
|
2053
|
+
class U {
|
|
596
2054
|
}
|
|
597
|
-
t.Hash =
|
|
598
|
-
function
|
|
599
|
-
const
|
|
600
|
-
return
|
|
2055
|
+
t.Hash = U;
|
|
2056
|
+
function F(n) {
|
|
2057
|
+
const b = (V) => n().update(u(V)).digest(), y = n();
|
|
2058
|
+
return b.outputLen = y.outputLen, b.blockLen = y.blockLen, b.create = () => n(), b;
|
|
601
2059
|
}
|
|
602
|
-
function
|
|
603
|
-
const
|
|
604
|
-
return
|
|
2060
|
+
function M(n) {
|
|
2061
|
+
const b = (V, k) => n(k).update(u(V)).digest(), y = n({});
|
|
2062
|
+
return b.outputLen = y.outputLen, b.blockLen = y.blockLen, b.create = (V) => n(V), b;
|
|
605
2063
|
}
|
|
606
|
-
function
|
|
607
|
-
const
|
|
608
|
-
return
|
|
2064
|
+
function G(n) {
|
|
2065
|
+
const b = (V, k) => n(k).update(u(V)).digest(), y = n({});
|
|
2066
|
+
return b.outputLen = y.outputLen, b.blockLen = y.blockLen, b.create = (V) => n(V), b;
|
|
609
2067
|
}
|
|
610
|
-
t.wrapConstructor =
|
|
611
|
-
function
|
|
2068
|
+
t.wrapConstructor = F, t.wrapConstructorWithOpts = M, t.wrapXOFConstructorWithOpts = G;
|
|
2069
|
+
function q(n = 32) {
|
|
612
2070
|
if (e.crypto && typeof e.crypto.getRandomValues == "function")
|
|
613
|
-
return e.crypto.getRandomValues(new Uint8Array(
|
|
2071
|
+
return e.crypto.getRandomValues(new Uint8Array(n));
|
|
614
2072
|
if (e.crypto && typeof e.crypto.randomBytes == "function")
|
|
615
|
-
return Uint8Array.from(e.crypto.randomBytes(
|
|
2073
|
+
return Uint8Array.from(e.crypto.randomBytes(n));
|
|
616
2074
|
throw new Error("crypto.getRandomValues must be defined");
|
|
617
2075
|
}
|
|
618
|
-
})(
|
|
619
|
-
}
|
|
620
|
-
var
|
|
621
|
-
function
|
|
622
|
-
if (
|
|
623
|
-
|
|
624
|
-
const t = /* @__PURE__ */
|
|
625
|
-
function e(
|
|
626
|
-
if (typeof
|
|
627
|
-
return
|
|
628
|
-
const x = BigInt(32), H = BigInt(4294967295),
|
|
629
|
-
|
|
630
|
-
}
|
|
631
|
-
function s(
|
|
632
|
-
return
|
|
633
|
-
}
|
|
634
|
-
function
|
|
635
|
-
return
|
|
636
|
-
}
|
|
637
|
-
class
|
|
638
|
-
constructor(
|
|
639
|
-
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen =
|
|
640
|
-
}
|
|
641
|
-
update(
|
|
642
|
-
(0, t.aexists)(this),
|
|
643
|
-
const { view:
|
|
644
|
-
for (let
|
|
645
|
-
const
|
|
646
|
-
if (
|
|
647
|
-
const
|
|
648
|
-
for (; x <= H -
|
|
649
|
-
this.process(
|
|
2076
|
+
})(Jt)), Jt;
|
|
2077
|
+
}
|
|
2078
|
+
var pe;
|
|
2079
|
+
function us() {
|
|
2080
|
+
if (pe) return $;
|
|
2081
|
+
pe = 1, Object.defineProperty($, "__esModule", { value: !0 }), $.SHA512_IV = $.SHA384_IV = $.SHA224_IV = $.SHA256_IV = $.HashMD = void 0, $.setBigUint64 = e, $.Chi = s, $.Maj = o;
|
|
2082
|
+
const t = /* @__PURE__ */ Rt();
|
|
2083
|
+
function e(c, r, a, d) {
|
|
2084
|
+
if (typeof c.setBigUint64 == "function")
|
|
2085
|
+
return c.setBigUint64(r, a, d);
|
|
2086
|
+
const x = BigInt(32), H = BigInt(4294967295), f = Number(a >> x & H), g = Number(a & H), w = d ? 4 : 0, S = d ? 0 : 4;
|
|
2087
|
+
c.setUint32(r + w, f, d), c.setUint32(r + S, g, d);
|
|
2088
|
+
}
|
|
2089
|
+
function s(c, r, a) {
|
|
2090
|
+
return c & r ^ ~c & a;
|
|
2091
|
+
}
|
|
2092
|
+
function o(c, r, a) {
|
|
2093
|
+
return c & r ^ c & a ^ r & a;
|
|
2094
|
+
}
|
|
2095
|
+
class i extends t.Hash {
|
|
2096
|
+
constructor(r, a, d, x) {
|
|
2097
|
+
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = r, this.outputLen = a, this.padOffset = d, this.isLE = x, this.buffer = new Uint8Array(r), this.view = (0, t.createView)(this.buffer);
|
|
2098
|
+
}
|
|
2099
|
+
update(r) {
|
|
2100
|
+
(0, t.aexists)(this), r = (0, t.toBytes)(r), (0, t.abytes)(r);
|
|
2101
|
+
const { view: a, buffer: d, blockLen: x } = this, H = r.length;
|
|
2102
|
+
for (let f = 0; f < H; ) {
|
|
2103
|
+
const g = Math.min(x - this.pos, H - f);
|
|
2104
|
+
if (g === x) {
|
|
2105
|
+
const w = (0, t.createView)(r);
|
|
2106
|
+
for (; x <= H - f; f += x)
|
|
2107
|
+
this.process(w, f);
|
|
650
2108
|
continue;
|
|
651
2109
|
}
|
|
652
|
-
|
|
2110
|
+
d.set(r.subarray(f, f + g), this.pos), this.pos += g, f += g, this.pos === x && (this.process(a, 0), this.pos = 0);
|
|
653
2111
|
}
|
|
654
|
-
return this.length +=
|
|
655
|
-
}
|
|
656
|
-
digestInto(
|
|
657
|
-
(0, t.aexists)(this), (0, t.aoutput)(
|
|
658
|
-
const { buffer:
|
|
659
|
-
let { pos:
|
|
660
|
-
|
|
661
|
-
for (let
|
|
662
|
-
|
|
663
|
-
e(
|
|
664
|
-
const
|
|
665
|
-
if (
|
|
2112
|
+
return this.length += r.length, this.roundClean(), this;
|
|
2113
|
+
}
|
|
2114
|
+
digestInto(r) {
|
|
2115
|
+
(0, t.aexists)(this), (0, t.aoutput)(r, this), this.finished = !0;
|
|
2116
|
+
const { buffer: a, view: d, blockLen: x, isLE: H } = this;
|
|
2117
|
+
let { pos: f } = this;
|
|
2118
|
+
a[f++] = 128, (0, t.clean)(this.buffer.subarray(f)), this.padOffset > x - f && (this.process(d, 0), f = 0);
|
|
2119
|
+
for (let D = f; D < x; D++)
|
|
2120
|
+
a[D] = 0;
|
|
2121
|
+
e(d, x - 8, BigInt(this.length * 8), H), this.process(d, 0);
|
|
2122
|
+
const g = (0, t.createView)(r), w = this.outputLen;
|
|
2123
|
+
if (w % 4)
|
|
666
2124
|
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
|
667
|
-
const
|
|
668
|
-
if (
|
|
2125
|
+
const S = w / 4, I = this.get();
|
|
2126
|
+
if (S > I.length)
|
|
669
2127
|
throw new Error("_sha2: outputLen bigger than state");
|
|
670
|
-
for (let
|
|
671
|
-
|
|
2128
|
+
for (let D = 0; D < S; D++)
|
|
2129
|
+
g.setUint32(4 * D, I[D], H);
|
|
672
2130
|
}
|
|
673
2131
|
digest() {
|
|
674
|
-
const { buffer:
|
|
675
|
-
this.digestInto(
|
|
676
|
-
const
|
|
677
|
-
return this.destroy(),
|
|
2132
|
+
const { buffer: r, outputLen: a } = this;
|
|
2133
|
+
this.digestInto(r);
|
|
2134
|
+
const d = r.slice(0, a);
|
|
2135
|
+
return this.destroy(), d;
|
|
678
2136
|
}
|
|
679
|
-
_cloneInto(
|
|
680
|
-
|
|
681
|
-
const { blockLen:
|
|
682
|
-
return
|
|
2137
|
+
_cloneInto(r) {
|
|
2138
|
+
r || (r = new this.constructor()), r.set(...this.get());
|
|
2139
|
+
const { blockLen: a, buffer: d, length: x, finished: H, destroyed: f, pos: g } = this;
|
|
2140
|
+
return r.destroyed = f, r.finished = H, r.length = x, r.pos = g, x % a && r.buffer.set(d), r;
|
|
683
2141
|
}
|
|
684
2142
|
clone() {
|
|
685
2143
|
return this._cloneInto();
|
|
686
2144
|
}
|
|
687
2145
|
}
|
|
688
|
-
return
|
|
2146
|
+
return $.HashMD = i, $.SHA256_IV = Uint32Array.from([
|
|
689
2147
|
1779033703,
|
|
690
2148
|
3144134277,
|
|
691
2149
|
1013904242,
|
|
@@ -694,7 +2152,7 @@ function oe() {
|
|
|
694
2152
|
2600822924,
|
|
695
2153
|
528734635,
|
|
696
2154
|
1541459225
|
|
697
|
-
]),
|
|
2155
|
+
]), $.SHA224_IV = Uint32Array.from([
|
|
698
2156
|
3238371032,
|
|
699
2157
|
914150663,
|
|
700
2158
|
812702999,
|
|
@@ -703,7 +2161,7 @@ function oe() {
|
|
|
703
2161
|
1750603025,
|
|
704
2162
|
1694076839,
|
|
705
2163
|
3204075428
|
|
706
|
-
]),
|
|
2164
|
+
]), $.SHA384_IV = Uint32Array.from([
|
|
707
2165
|
3418070365,
|
|
708
2166
|
3238371032,
|
|
709
2167
|
1654270250,
|
|
@@ -720,7 +2178,7 @@ function oe() {
|
|
|
720
2178
|
1694076839,
|
|
721
2179
|
1203062813,
|
|
722
2180
|
3204075428
|
|
723
|
-
]),
|
|
2181
|
+
]), $.SHA512_IV = Uint32Array.from([
|
|
724
2182
|
1779033703,
|
|
725
2183
|
4089235720,
|
|
726
2184
|
3144134277,
|
|
@@ -737,98 +2195,98 @@ function oe() {
|
|
|
737
2195
|
4215389547,
|
|
738
2196
|
1541459225,
|
|
739
2197
|
327033209
|
|
740
|
-
]),
|
|
2198
|
+
]), $;
|
|
741
2199
|
}
|
|
742
|
-
var
|
|
743
|
-
function
|
|
744
|
-
if (
|
|
745
|
-
|
|
2200
|
+
var T = {}, ye;
|
|
2201
|
+
function ls() {
|
|
2202
|
+
if (ye) return T;
|
|
2203
|
+
ye = 1, Object.defineProperty(T, "__esModule", { value: !0 }), T.toBig = T.shrSL = T.shrSH = T.rotrSL = T.rotrSH = T.rotrBL = T.rotrBH = T.rotr32L = T.rotr32H = T.rotlSL = T.rotlSH = T.rotlBL = T.rotlBH = T.add5L = T.add5H = T.add4L = T.add4H = T.add3L = T.add3H = void 0, T.add = W, T.fromBig = s, T.split = o;
|
|
746
2204
|
const t = /* @__PURE__ */ BigInt(2 ** 32 - 1), e = /* @__PURE__ */ BigInt(32);
|
|
747
|
-
function s(
|
|
748
|
-
return
|
|
749
|
-
}
|
|
750
|
-
function
|
|
751
|
-
const
|
|
752
|
-
let
|
|
753
|
-
for (let
|
|
754
|
-
const { h:
|
|
755
|
-
[
|
|
756
|
-
}
|
|
757
|
-
return [
|
|
758
|
-
}
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
const
|
|
762
|
-
|
|
763
|
-
const
|
|
764
|
-
|
|
765
|
-
const
|
|
766
|
-
|
|
767
|
-
const
|
|
768
|
-
|
|
769
|
-
const x = (
|
|
770
|
-
|
|
771
|
-
const H = (
|
|
772
|
-
|
|
773
|
-
const
|
|
774
|
-
|
|
775
|
-
const
|
|
776
|
-
|
|
777
|
-
const
|
|
778
|
-
|
|
779
|
-
const
|
|
780
|
-
|
|
781
|
-
const I = (
|
|
782
|
-
|
|
783
|
-
const
|
|
784
|
-
|
|
785
|
-
function
|
|
786
|
-
const
|
|
787
|
-
return { h:
|
|
788
|
-
}
|
|
789
|
-
const
|
|
790
|
-
|
|
791
|
-
const
|
|
792
|
-
|
|
793
|
-
const
|
|
794
|
-
|
|
795
|
-
const
|
|
796
|
-
|
|
797
|
-
const
|
|
798
|
-
|
|
799
|
-
const
|
|
800
|
-
|
|
801
|
-
const
|
|
2205
|
+
function s(h, u = !1) {
|
|
2206
|
+
return u ? { h: Number(h & t), l: Number(h >> e & t) } : { h: Number(h >> e & t) | 0, l: Number(h & t) | 0 };
|
|
2207
|
+
}
|
|
2208
|
+
function o(h, u = !1) {
|
|
2209
|
+
const l = h.length;
|
|
2210
|
+
let L = new Uint32Array(l), p = new Uint32Array(l);
|
|
2211
|
+
for (let U = 0; U < l; U++) {
|
|
2212
|
+
const { h: F, l: M } = s(h[U], u);
|
|
2213
|
+
[L[U], p[U]] = [F, M];
|
|
2214
|
+
}
|
|
2215
|
+
return [L, p];
|
|
2216
|
+
}
|
|
2217
|
+
const i = (h, u) => BigInt(h >>> 0) << e | BigInt(u >>> 0);
|
|
2218
|
+
T.toBig = i;
|
|
2219
|
+
const c = (h, u, l) => h >>> l;
|
|
2220
|
+
T.shrSH = c;
|
|
2221
|
+
const r = (h, u, l) => h << 32 - l | u >>> l;
|
|
2222
|
+
T.shrSL = r;
|
|
2223
|
+
const a = (h, u, l) => h >>> l | u << 32 - l;
|
|
2224
|
+
T.rotrSH = a;
|
|
2225
|
+
const d = (h, u, l) => h << 32 - l | u >>> l;
|
|
2226
|
+
T.rotrSL = d;
|
|
2227
|
+
const x = (h, u, l) => h << 64 - l | u >>> l - 32;
|
|
2228
|
+
T.rotrBH = x;
|
|
2229
|
+
const H = (h, u, l) => h >>> l - 32 | u << 64 - l;
|
|
2230
|
+
T.rotrBL = H;
|
|
2231
|
+
const f = (h, u) => u;
|
|
2232
|
+
T.rotr32H = f;
|
|
2233
|
+
const g = (h, u) => h;
|
|
2234
|
+
T.rotr32L = g;
|
|
2235
|
+
const w = (h, u, l) => h << l | u >>> 32 - l;
|
|
2236
|
+
T.rotlSH = w;
|
|
2237
|
+
const S = (h, u, l) => u << l | h >>> 32 - l;
|
|
2238
|
+
T.rotlSL = S;
|
|
2239
|
+
const I = (h, u, l) => u << l - 32 | h >>> 64 - l;
|
|
2240
|
+
T.rotlBH = I;
|
|
2241
|
+
const D = (h, u, l) => h << l - 32 | u >>> 64 - l;
|
|
2242
|
+
T.rotlBL = D;
|
|
2243
|
+
function W(h, u, l, L) {
|
|
2244
|
+
const p = (u >>> 0) + (L >>> 0);
|
|
2245
|
+
return { h: h + l + (p / 2 ** 32 | 0) | 0, l: p | 0 };
|
|
2246
|
+
}
|
|
2247
|
+
const v = (h, u, l) => (h >>> 0) + (u >>> 0) + (l >>> 0);
|
|
2248
|
+
T.add3L = v;
|
|
2249
|
+
const _ = (h, u, l, L) => u + l + L + (h / 2 ** 32 | 0) | 0;
|
|
2250
|
+
T.add3H = _;
|
|
2251
|
+
const C = (h, u, l, L) => (h >>> 0) + (u >>> 0) + (l >>> 0) + (L >>> 0);
|
|
2252
|
+
T.add4L = C;
|
|
2253
|
+
const A = (h, u, l, L, p) => u + l + L + p + (h / 2 ** 32 | 0) | 0;
|
|
2254
|
+
T.add4H = A;
|
|
2255
|
+
const B = (h, u, l, L, p) => (h >>> 0) + (u >>> 0) + (l >>> 0) + (L >>> 0) + (p >>> 0);
|
|
2256
|
+
T.add5L = B;
|
|
2257
|
+
const m = (h, u, l, L, p, U) => u + l + L + p + U + (h / 2 ** 32 | 0) | 0;
|
|
2258
|
+
T.add5H = m;
|
|
2259
|
+
const E = {
|
|
802
2260
|
fromBig: s,
|
|
803
|
-
split:
|
|
804
|
-
toBig:
|
|
805
|
-
shrSH:
|
|
806
|
-
shrSL:
|
|
807
|
-
rotrSH:
|
|
808
|
-
rotrSL:
|
|
2261
|
+
split: o,
|
|
2262
|
+
toBig: i,
|
|
2263
|
+
shrSH: c,
|
|
2264
|
+
shrSL: r,
|
|
2265
|
+
rotrSH: a,
|
|
2266
|
+
rotrSL: d,
|
|
809
2267
|
rotrBH: x,
|
|
810
2268
|
rotrBL: H,
|
|
811
|
-
rotr32H:
|
|
812
|
-
rotr32L:
|
|
813
|
-
rotlSH:
|
|
814
|
-
rotlSL:
|
|
2269
|
+
rotr32H: f,
|
|
2270
|
+
rotr32L: g,
|
|
2271
|
+
rotlSH: w,
|
|
2272
|
+
rotlSL: S,
|
|
815
2273
|
rotlBH: I,
|
|
816
|
-
rotlBL:
|
|
817
|
-
add:
|
|
818
|
-
add3L:
|
|
819
|
-
add3H:
|
|
820
|
-
add4L:
|
|
821
|
-
add4H:
|
|
822
|
-
add5H:
|
|
823
|
-
add5L:
|
|
2274
|
+
rotlBL: D,
|
|
2275
|
+
add: W,
|
|
2276
|
+
add3L: v,
|
|
2277
|
+
add3H: _,
|
|
2278
|
+
add4L: C,
|
|
2279
|
+
add4H: A,
|
|
2280
|
+
add5H: m,
|
|
2281
|
+
add5L: B
|
|
824
2282
|
};
|
|
825
|
-
return
|
|
2283
|
+
return T.default = E, T;
|
|
826
2284
|
}
|
|
827
|
-
var
|
|
828
|
-
function
|
|
829
|
-
if (
|
|
830
|
-
|
|
831
|
-
const t = /* @__PURE__ */
|
|
2285
|
+
var _e;
|
|
2286
|
+
function $e() {
|
|
2287
|
+
if (_e) return P;
|
|
2288
|
+
_e = 1, Object.defineProperty(P, "__esModule", { value: !0 }), P.sha512_224 = P.sha512_256 = P.sha384 = P.sha512 = P.sha224 = P.sha256 = P.SHA512_256 = P.SHA512_224 = P.SHA384 = P.SHA512 = P.SHA224 = P.SHA256 = void 0;
|
|
2289
|
+
const t = /* @__PURE__ */ us(), e = /* @__PURE__ */ ls(), s = /* @__PURE__ */ Rt(), o = /* @__PURE__ */ Uint32Array.from([
|
|
832
2290
|
1116352408,
|
|
833
2291
|
1899447441,
|
|
834
2292
|
3049323471,
|
|
@@ -893,48 +2351,48 @@ function ce() {
|
|
|
893
2351
|
2756734187,
|
|
894
2352
|
3204031479,
|
|
895
2353
|
3329325298
|
|
896
|
-
]),
|
|
897
|
-
class
|
|
898
|
-
constructor(
|
|
899
|
-
super(64,
|
|
2354
|
+
]), i = /* @__PURE__ */ new Uint32Array(64);
|
|
2355
|
+
class c extends t.HashMD {
|
|
2356
|
+
constructor(_ = 32) {
|
|
2357
|
+
super(64, _, 8, !1), this.A = t.SHA256_IV[0] | 0, this.B = t.SHA256_IV[1] | 0, this.C = t.SHA256_IV[2] | 0, this.D = t.SHA256_IV[3] | 0, this.E = t.SHA256_IV[4] | 0, this.F = t.SHA256_IV[5] | 0, this.G = t.SHA256_IV[6] | 0, this.H = t.SHA256_IV[7] | 0;
|
|
900
2358
|
}
|
|
901
2359
|
get() {
|
|
902
|
-
const { A:
|
|
903
|
-
return [
|
|
2360
|
+
const { A: _, B: C, C: A, D: B, E: m, F: E, G: h, H: u } = this;
|
|
2361
|
+
return [_, C, A, B, m, E, h, u];
|
|
904
2362
|
}
|
|
905
2363
|
// prettier-ignore
|
|
906
|
-
set(
|
|
907
|
-
this.A =
|
|
908
|
-
}
|
|
909
|
-
process(
|
|
910
|
-
for (let
|
|
911
|
-
|
|
912
|
-
for (let
|
|
913
|
-
const
|
|
914
|
-
|
|
2364
|
+
set(_, C, A, B, m, E, h, u) {
|
|
2365
|
+
this.A = _ | 0, this.B = C | 0, this.C = A | 0, this.D = B | 0, this.E = m | 0, this.F = E | 0, this.G = h | 0, this.H = u | 0;
|
|
2366
|
+
}
|
|
2367
|
+
process(_, C) {
|
|
2368
|
+
for (let p = 0; p < 16; p++, C += 4)
|
|
2369
|
+
i[p] = _.getUint32(C, !1);
|
|
2370
|
+
for (let p = 16; p < 64; p++) {
|
|
2371
|
+
const U = i[p - 15], F = i[p - 2], M = (0, s.rotr)(U, 7) ^ (0, s.rotr)(U, 18) ^ U >>> 3, G = (0, s.rotr)(F, 17) ^ (0, s.rotr)(F, 19) ^ F >>> 10;
|
|
2372
|
+
i[p] = G + i[p - 7] + M + i[p - 16] | 0;
|
|
915
2373
|
}
|
|
916
|
-
let { A
|
|
917
|
-
for (let
|
|
918
|
-
const
|
|
919
|
-
|
|
2374
|
+
let { A, B, C: m, D: E, E: h, F: u, G: l, H: L } = this;
|
|
2375
|
+
for (let p = 0; p < 64; p++) {
|
|
2376
|
+
const U = (0, s.rotr)(h, 6) ^ (0, s.rotr)(h, 11) ^ (0, s.rotr)(h, 25), F = L + U + (0, t.Chi)(h, u, l) + o[p] + i[p] | 0, G = ((0, s.rotr)(A, 2) ^ (0, s.rotr)(A, 13) ^ (0, s.rotr)(A, 22)) + (0, t.Maj)(A, B, m) | 0;
|
|
2377
|
+
L = l, l = u, u = h, h = E + F | 0, E = m, m = B, B = A, A = F + G | 0;
|
|
920
2378
|
}
|
|
921
|
-
|
|
2379
|
+
A = A + this.A | 0, B = B + this.B | 0, m = m + this.C | 0, E = E + this.D | 0, h = h + this.E | 0, u = u + this.F | 0, l = l + this.G | 0, L = L + this.H | 0, this.set(A, B, m, E, h, u, l, L);
|
|
922
2380
|
}
|
|
923
2381
|
roundClean() {
|
|
924
|
-
(0, s.clean)(
|
|
2382
|
+
(0, s.clean)(i);
|
|
925
2383
|
}
|
|
926
2384
|
destroy() {
|
|
927
2385
|
this.set(0, 0, 0, 0, 0, 0, 0, 0), (0, s.clean)(this.buffer);
|
|
928
2386
|
}
|
|
929
2387
|
}
|
|
930
|
-
|
|
931
|
-
class
|
|
2388
|
+
P.SHA256 = c;
|
|
2389
|
+
class r extends c {
|
|
932
2390
|
constructor() {
|
|
933
2391
|
super(28), this.A = t.SHA224_IV[0] | 0, this.B = t.SHA224_IV[1] | 0, this.C = t.SHA224_IV[2] | 0, this.D = t.SHA224_IV[3] | 0, this.E = t.SHA224_IV[4] | 0, this.F = t.SHA224_IV[5] | 0, this.G = t.SHA224_IV[6] | 0, this.H = t.SHA224_IV[7] | 0;
|
|
934
2392
|
}
|
|
935
2393
|
}
|
|
936
|
-
|
|
937
|
-
const
|
|
2394
|
+
P.SHA224 = r;
|
|
2395
|
+
const a = e.split([
|
|
938
2396
|
"0x428a2f98d728ae22",
|
|
939
2397
|
"0x7137449123ef65cd",
|
|
940
2398
|
"0xb5c0fbcfec4d3b2f",
|
|
@@ -1015,51 +2473,51 @@ function ce() {
|
|
|
1015
2473
|
"0x597f299cfc657e2a",
|
|
1016
2474
|
"0x5fcb6fab3ad6faec",
|
|
1017
2475
|
"0x6c44198c4a475817"
|
|
1018
|
-
].map((
|
|
1019
|
-
class
|
|
1020
|
-
constructor(
|
|
1021
|
-
super(128,
|
|
2476
|
+
].map((v) => BigInt(v))), d = a[0], x = a[1], H = /* @__PURE__ */ new Uint32Array(80), f = /* @__PURE__ */ new Uint32Array(80);
|
|
2477
|
+
class g extends t.HashMD {
|
|
2478
|
+
constructor(_ = 64) {
|
|
2479
|
+
super(128, _, 16, !1), this.Ah = t.SHA512_IV[0] | 0, this.Al = t.SHA512_IV[1] | 0, this.Bh = t.SHA512_IV[2] | 0, this.Bl = t.SHA512_IV[3] | 0, this.Ch = t.SHA512_IV[4] | 0, this.Cl = t.SHA512_IV[5] | 0, this.Dh = t.SHA512_IV[6] | 0, this.Dl = t.SHA512_IV[7] | 0, this.Eh = t.SHA512_IV[8] | 0, this.El = t.SHA512_IV[9] | 0, this.Fh = t.SHA512_IV[10] | 0, this.Fl = t.SHA512_IV[11] | 0, this.Gh = t.SHA512_IV[12] | 0, this.Gl = t.SHA512_IV[13] | 0, this.Hh = t.SHA512_IV[14] | 0, this.Hl = t.SHA512_IV[15] | 0;
|
|
1022
2480
|
}
|
|
1023
2481
|
// prettier-ignore
|
|
1024
2482
|
get() {
|
|
1025
|
-
const { Ah:
|
|
1026
|
-
return [
|
|
2483
|
+
const { Ah: _, Al: C, Bh: A, Bl: B, Ch: m, Cl: E, Dh: h, Dl: u, Eh: l, El: L, Fh: p, Fl: U, Gh: F, Gl: M, Hh: G, Hl: q } = this;
|
|
2484
|
+
return [_, C, A, B, m, E, h, u, l, L, p, U, F, M, G, q];
|
|
1027
2485
|
}
|
|
1028
2486
|
// prettier-ignore
|
|
1029
|
-
set(
|
|
1030
|
-
this.Ah =
|
|
1031
|
-
}
|
|
1032
|
-
process(
|
|
1033
|
-
for (let
|
|
1034
|
-
H[
|
|
1035
|
-
for (let
|
|
1036
|
-
const
|
|
1037
|
-
H[
|
|
2487
|
+
set(_, C, A, B, m, E, h, u, l, L, p, U, F, M, G, q) {
|
|
2488
|
+
this.Ah = _ | 0, this.Al = C | 0, this.Bh = A | 0, this.Bl = B | 0, this.Ch = m | 0, this.Cl = E | 0, this.Dh = h | 0, this.Dl = u | 0, this.Eh = l | 0, this.El = L | 0, this.Fh = p | 0, this.Fl = U | 0, this.Gh = F | 0, this.Gl = M | 0, this.Hh = G | 0, this.Hl = q | 0;
|
|
2489
|
+
}
|
|
2490
|
+
process(_, C) {
|
|
2491
|
+
for (let y = 0; y < 16; y++, C += 4)
|
|
2492
|
+
H[y] = _.getUint32(C), f[y] = _.getUint32(C += 4);
|
|
2493
|
+
for (let y = 16; y < 80; y++) {
|
|
2494
|
+
const V = H[y - 15] | 0, k = f[y - 15] | 0, j = e.rotrSH(V, k, 1) ^ e.rotrSH(V, k, 8) ^ e.shrSH(V, k, 7), et = e.rotrSL(V, k, 1) ^ e.rotrSL(V, k, 8) ^ e.shrSL(V, k, 7), K = H[y - 2] | 0, N = f[y - 2] | 0, ot = e.rotrSH(K, N, 19) ^ e.rotrBH(K, N, 61) ^ e.shrSH(K, N, 6), St = e.rotrSL(K, N, 19) ^ e.rotrBL(K, N, 61) ^ e.shrSL(K, N, 6), at = e.add4L(et, St, f[y - 7], f[y - 16]), wt = e.add4H(at, j, ot, H[y - 7], H[y - 16]);
|
|
2495
|
+
H[y] = wt | 0, f[y] = at | 0;
|
|
1038
2496
|
}
|
|
1039
|
-
let { Ah:
|
|
1040
|
-
for (let
|
|
1041
|
-
const
|
|
1042
|
-
|
|
1043
|
-
const
|
|
1044
|
-
|
|
2497
|
+
let { Ah: A, Al: B, Bh: m, Bl: E, Ch: h, Cl: u, Dh: l, Dl: L, Eh: p, El: U, Fh: F, Fl: M, Gh: G, Gl: q, Hh: n, Hl: b } = this;
|
|
2498
|
+
for (let y = 0; y < 80; y++) {
|
|
2499
|
+
const V = e.rotrSH(p, U, 14) ^ e.rotrSH(p, U, 18) ^ e.rotrBH(p, U, 41), k = e.rotrSL(p, U, 14) ^ e.rotrSL(p, U, 18) ^ e.rotrBL(p, U, 41), j = p & F ^ ~p & G, et = U & M ^ ~U & q, K = e.add5L(b, k, et, x[y], f[y]), N = e.add5H(K, n, V, j, d[y], H[y]), ot = K | 0, St = e.rotrSH(A, B, 28) ^ e.rotrBH(A, B, 34) ^ e.rotrBH(A, B, 39), at = e.rotrSL(A, B, 28) ^ e.rotrBL(A, B, 34) ^ e.rotrBL(A, B, 39), wt = A & m ^ A & h ^ m & h, Pt = B & E ^ B & u ^ E & u;
|
|
2500
|
+
n = G | 0, b = q | 0, G = F | 0, q = M | 0, F = p | 0, M = U | 0, { h: p, l: U } = e.add(l | 0, L | 0, N | 0, ot | 0), l = h | 0, L = u | 0, h = m | 0, u = E | 0, m = A | 0, E = B | 0;
|
|
2501
|
+
const Ut = e.add3L(ot, at, Pt);
|
|
2502
|
+
A = e.add3H(Ut, N, St, wt), B = Ut | 0;
|
|
1045
2503
|
}
|
|
1046
|
-
({ h:
|
|
2504
|
+
({ h: A, l: B } = e.add(this.Ah | 0, this.Al | 0, A | 0, B | 0)), { h: m, l: E } = e.add(this.Bh | 0, this.Bl | 0, m | 0, E | 0), { h, l: u } = e.add(this.Ch | 0, this.Cl | 0, h | 0, u | 0), { h: l, l: L } = e.add(this.Dh | 0, this.Dl | 0, l | 0, L | 0), { h: p, l: U } = e.add(this.Eh | 0, this.El | 0, p | 0, U | 0), { h: F, l: M } = e.add(this.Fh | 0, this.Fl | 0, F | 0, M | 0), { h: G, l: q } = e.add(this.Gh | 0, this.Gl | 0, G | 0, q | 0), { h: n, l: b } = e.add(this.Hh | 0, this.Hl | 0, n | 0, b | 0), this.set(A, B, m, E, h, u, l, L, p, U, F, M, G, q, n, b);
|
|
1047
2505
|
}
|
|
1048
2506
|
roundClean() {
|
|
1049
|
-
(0, s.clean)(H,
|
|
2507
|
+
(0, s.clean)(H, f);
|
|
1050
2508
|
}
|
|
1051
2509
|
destroy() {
|
|
1052
2510
|
(0, s.clean)(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
1053
2511
|
}
|
|
1054
2512
|
}
|
|
1055
|
-
|
|
1056
|
-
class
|
|
2513
|
+
P.SHA512 = g;
|
|
2514
|
+
class w extends g {
|
|
1057
2515
|
constructor() {
|
|
1058
2516
|
super(48), this.Ah = t.SHA384_IV[0] | 0, this.Al = t.SHA384_IV[1] | 0, this.Bh = t.SHA384_IV[2] | 0, this.Bl = t.SHA384_IV[3] | 0, this.Ch = t.SHA384_IV[4] | 0, this.Cl = t.SHA384_IV[5] | 0, this.Dh = t.SHA384_IV[6] | 0, this.Dl = t.SHA384_IV[7] | 0, this.Eh = t.SHA384_IV[8] | 0, this.El = t.SHA384_IV[9] | 0, this.Fh = t.SHA384_IV[10] | 0, this.Fl = t.SHA384_IV[11] | 0, this.Gh = t.SHA384_IV[12] | 0, this.Gl = t.SHA384_IV[13] | 0, this.Hh = t.SHA384_IV[14] | 0, this.Hl = t.SHA384_IV[15] | 0;
|
|
1059
2517
|
}
|
|
1060
2518
|
}
|
|
1061
|
-
|
|
1062
|
-
const
|
|
2519
|
+
P.SHA384 = w;
|
|
2520
|
+
const S = /* @__PURE__ */ Uint32Array.from([
|
|
1063
2521
|
2352822216,
|
|
1064
2522
|
424955298,
|
|
1065
2523
|
1944164710,
|
|
@@ -1094,54 +2552,68 @@ function ce() {
|
|
|
1094
2552
|
246885852,
|
|
1095
2553
|
2177182882
|
|
1096
2554
|
]);
|
|
1097
|
-
class
|
|
2555
|
+
class D extends g {
|
|
1098
2556
|
constructor() {
|
|
1099
|
-
super(28), this.Ah =
|
|
2557
|
+
super(28), this.Ah = S[0] | 0, this.Al = S[1] | 0, this.Bh = S[2] | 0, this.Bl = S[3] | 0, this.Ch = S[4] | 0, this.Cl = S[5] | 0, this.Dh = S[6] | 0, this.Dl = S[7] | 0, this.Eh = S[8] | 0, this.El = S[9] | 0, this.Fh = S[10] | 0, this.Fl = S[11] | 0, this.Gh = S[12] | 0, this.Gl = S[13] | 0, this.Hh = S[14] | 0, this.Hl = S[15] | 0;
|
|
1100
2558
|
}
|
|
1101
2559
|
}
|
|
1102
|
-
|
|
1103
|
-
class
|
|
2560
|
+
P.SHA512_224 = D;
|
|
2561
|
+
class W extends g {
|
|
1104
2562
|
constructor() {
|
|
1105
2563
|
super(32), this.Ah = I[0] | 0, this.Al = I[1] | 0, this.Bh = I[2] | 0, this.Bl = I[3] | 0, this.Ch = I[4] | 0, this.Cl = I[5] | 0, this.Dh = I[6] | 0, this.Dl = I[7] | 0, this.Eh = I[8] | 0, this.El = I[9] | 0, this.Fh = I[10] | 0, this.Fl = I[11] | 0, this.Gh = I[12] | 0, this.Gl = I[13] | 0, this.Hh = I[14] | 0, this.Hl = I[15] | 0;
|
|
1106
2564
|
}
|
|
1107
2565
|
}
|
|
1108
|
-
return
|
|
2566
|
+
return P.SHA512_256 = W, P.sha256 = (0, s.createHasher)(() => new c()), P.sha224 = (0, s.createHasher)(() => new r()), P.sha512 = (0, s.createHasher)(() => new g()), P.sha384 = (0, s.createHasher)(() => new w()), P.sha512_256 = (0, s.createHasher)(() => new W()), P.sha512_224 = (0, s.createHasher)(() => new D()), P;
|
|
2567
|
+
}
|
|
2568
|
+
var ge;
|
|
2569
|
+
function Us() {
|
|
2570
|
+
if (ge) return nt;
|
|
2571
|
+
ge = 1, Object.defineProperty(nt, "__esModule", { value: !0 }), nt.sha224 = nt.SHA224 = nt.sha256 = nt.SHA256 = void 0;
|
|
2572
|
+
const t = /* @__PURE__ */ $e();
|
|
2573
|
+
return nt.SHA256 = t.SHA256, nt.sha256 = t.sha256, nt.SHA224 = t.SHA224, nt.sha224 = t.sha224, nt;
|
|
1109
2574
|
}
|
|
1110
|
-
var
|
|
1111
|
-
function
|
|
1112
|
-
|
|
2575
|
+
var X = {}, Se;
|
|
2576
|
+
function Es() {
|
|
2577
|
+
if (Se) return X;
|
|
2578
|
+
Se = 1, Object.defineProperty(X, "__esModule", { value: !0 }), X.sha512_256 = X.SHA512_256 = X.sha512_224 = X.SHA512_224 = X.sha384 = X.SHA384 = X.sha512 = X.SHA512 = void 0;
|
|
2579
|
+
const t = /* @__PURE__ */ $e();
|
|
2580
|
+
return X.SHA512 = t.SHA512, X.sha512 = t.sha512, X.SHA384 = t.SHA384, X.sha384 = t.sha384, X.SHA512_224 = t.SHA512_224, X.sha512_224 = t.sha512_224, X.SHA512_256 = t.SHA512_256, X.sha512_256 = t.sha512_256, X;
|
|
2581
|
+
}
|
|
2582
|
+
var Dt = {}, Qt = {}, we;
|
|
2583
|
+
function bs() {
|
|
2584
|
+
return we || (we = 1, (function(t) {
|
|
1113
2585
|
Object.defineProperty(t, "__esModule", { value: !0 }), t.hmac = t.HMAC = void 0;
|
|
1114
|
-
const e = /* @__PURE__ */
|
|
2586
|
+
const e = /* @__PURE__ */ Rt();
|
|
1115
2587
|
class s extends e.Hash {
|
|
1116
|
-
constructor(
|
|
1117
|
-
super(), this.finished = !1, this.destroyed = !1, (0, e.ahash)(
|
|
1118
|
-
const
|
|
1119
|
-
if (this.iHash =
|
|
2588
|
+
constructor(c, r) {
|
|
2589
|
+
super(), this.finished = !1, this.destroyed = !1, (0, e.ahash)(c);
|
|
2590
|
+
const a = (0, e.toBytes)(r);
|
|
2591
|
+
if (this.iHash = c.create(), typeof this.iHash.update != "function")
|
|
1120
2592
|
throw new Error("Expected instance of class which extends utils.Hash");
|
|
1121
2593
|
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
|
|
1122
|
-
const
|
|
1123
|
-
x.set(
|
|
2594
|
+
const d = this.blockLen, x = new Uint8Array(d);
|
|
2595
|
+
x.set(a.length > d ? c.create().update(a).digest() : a);
|
|
1124
2596
|
for (let H = 0; H < x.length; H++)
|
|
1125
2597
|
x[H] ^= 54;
|
|
1126
|
-
this.iHash.update(x), this.oHash =
|
|
2598
|
+
this.iHash.update(x), this.oHash = c.create();
|
|
1127
2599
|
for (let H = 0; H < x.length; H++)
|
|
1128
2600
|
x[H] ^= 106;
|
|
1129
2601
|
this.oHash.update(x), (0, e.clean)(x);
|
|
1130
2602
|
}
|
|
1131
|
-
update(
|
|
1132
|
-
return (0, e.aexists)(this), this.iHash.update(
|
|
2603
|
+
update(c) {
|
|
2604
|
+
return (0, e.aexists)(this), this.iHash.update(c), this;
|
|
1133
2605
|
}
|
|
1134
|
-
digestInto(
|
|
1135
|
-
(0, e.aexists)(this), (0, e.abytes)(
|
|
2606
|
+
digestInto(c) {
|
|
2607
|
+
(0, e.aexists)(this), (0, e.abytes)(c, this.outputLen), this.finished = !0, this.iHash.digestInto(c), this.oHash.update(c), this.oHash.digestInto(c), this.destroy();
|
|
1136
2608
|
}
|
|
1137
2609
|
digest() {
|
|
1138
|
-
const
|
|
1139
|
-
return this.digestInto(
|
|
2610
|
+
const c = new Uint8Array(this.oHash.outputLen);
|
|
2611
|
+
return this.digestInto(c), c;
|
|
1140
2612
|
}
|
|
1141
|
-
_cloneInto(
|
|
1142
|
-
|
|
1143
|
-
const { oHash:
|
|
1144
|
-
return
|
|
2613
|
+
_cloneInto(c) {
|
|
2614
|
+
c || (c = Object.create(Object.getPrototypeOf(this), {}));
|
|
2615
|
+
const { oHash: r, iHash: a, finished: d, destroyed: x, blockLen: H, outputLen: f } = this;
|
|
2616
|
+
return c = c, c.finished = d, c.destroyed = x, c.blockLen = H, c.outputLen = f, c.oHash = r._cloneInto(c.oHash), c.iHash = a._cloneInto(c.iHash), c;
|
|
1145
2617
|
}
|
|
1146
2618
|
clone() {
|
|
1147
2619
|
return this._cloneInto();
|
|
@@ -1151,523 +2623,80 @@ function Pe() {
|
|
|
1151
2623
|
}
|
|
1152
2624
|
}
|
|
1153
2625
|
t.HMAC = s;
|
|
1154
|
-
const
|
|
1155
|
-
t.hmac =
|
|
1156
|
-
})(
|
|
1157
|
-
}
|
|
1158
|
-
var ot = {}, N = {}, Pt;
|
|
1159
|
-
function We() {
|
|
1160
|
-
if (Pt) return N;
|
|
1161
|
-
Pt = 1, Object.defineProperty(N, "__esModule", { value: !0 }), N.ripemd160 = N.RIPEMD160 = N.md5 = N.MD5 = N.sha1 = N.SHA1 = void 0;
|
|
1162
|
-
const t = /* @__PURE__ */ oe(), e = /* @__PURE__ */ pt(), s = /* @__PURE__ */ Uint32Array.from([
|
|
1163
|
-
1732584193,
|
|
1164
|
-
4023233417,
|
|
1165
|
-
2562383102,
|
|
1166
|
-
271733878,
|
|
1167
|
-
3285377520
|
|
1168
|
-
]), i = /* @__PURE__ */ new Uint32Array(80);
|
|
1169
|
-
class o extends t.HashMD {
|
|
1170
|
-
constructor() {
|
|
1171
|
-
super(64, 20, 8, !1), this.A = s[0] | 0, this.B = s[1] | 0, this.C = s[2] | 0, this.D = s[3] | 0, this.E = s[4] | 0;
|
|
1172
|
-
}
|
|
1173
|
-
get() {
|
|
1174
|
-
const { A: a, B: d, C: f, D: p, E: l } = this;
|
|
1175
|
-
return [a, d, f, p, l];
|
|
1176
|
-
}
|
|
1177
|
-
set(a, d, f, p, l) {
|
|
1178
|
-
this.A = a | 0, this.B = d | 0, this.C = f | 0, this.D = p | 0, this.E = l | 0;
|
|
1179
|
-
}
|
|
1180
|
-
process(a, d) {
|
|
1181
|
-
for (let k = 0; k < 16; k++, d += 4)
|
|
1182
|
-
i[k] = a.getUint32(d, !1);
|
|
1183
|
-
for (let k = 16; k < 80; k++)
|
|
1184
|
-
i[k] = (0, e.rotl)(i[k - 3] ^ i[k - 8] ^ i[k - 14] ^ i[k - 16], 1);
|
|
1185
|
-
let { A: f, B: p, C: l, D: S, E: U } = this;
|
|
1186
|
-
for (let k = 0; k < 80; k++) {
|
|
1187
|
-
let F, v;
|
|
1188
|
-
k < 20 ? (F = (0, t.Chi)(p, l, S), v = 1518500249) : k < 40 ? (F = p ^ l ^ S, v = 1859775393) : k < 60 ? (F = (0, t.Maj)(p, l, S), v = 2400959708) : (F = p ^ l ^ S, v = 3395469782);
|
|
1189
|
-
const c = (0, e.rotl)(f, 5) + F + U + v + i[k] | 0;
|
|
1190
|
-
U = S, S = l, l = (0, e.rotl)(p, 30), p = f, f = c;
|
|
1191
|
-
}
|
|
1192
|
-
f = f + this.A | 0, p = p + this.B | 0, l = l + this.C | 0, S = S + this.D | 0, U = U + this.E | 0, this.set(f, p, l, S, U);
|
|
1193
|
-
}
|
|
1194
|
-
roundClean() {
|
|
1195
|
-
(0, e.clean)(i);
|
|
1196
|
-
}
|
|
1197
|
-
destroy() {
|
|
1198
|
-
this.set(0, 0, 0, 0, 0), (0, e.clean)(this.buffer);
|
|
1199
|
-
}
|
|
1200
|
-
}
|
|
1201
|
-
N.SHA1 = o, N.sha1 = (0, e.createHasher)(() => new o());
|
|
1202
|
-
const r = /* @__PURE__ */ Math.pow(2, 32), n = /* @__PURE__ */ Array.from({ length: 64 }, (B, a) => Math.floor(r * Math.abs(Math.sin(a + 1)))), h = /* @__PURE__ */ s.slice(0, 4), b = /* @__PURE__ */ new Uint32Array(16);
|
|
1203
|
-
class x extends t.HashMD {
|
|
1204
|
-
constructor() {
|
|
1205
|
-
super(64, 16, 8, !0), this.A = h[0] | 0, this.B = h[1] | 0, this.C = h[2] | 0, this.D = h[3] | 0;
|
|
1206
|
-
}
|
|
1207
|
-
get() {
|
|
1208
|
-
const { A: a, B: d, C: f, D: p } = this;
|
|
1209
|
-
return [a, d, f, p];
|
|
1210
|
-
}
|
|
1211
|
-
set(a, d, f, p) {
|
|
1212
|
-
this.A = a | 0, this.B = d | 0, this.C = f | 0, this.D = p | 0;
|
|
1213
|
-
}
|
|
1214
|
-
process(a, d) {
|
|
1215
|
-
for (let U = 0; U < 16; U++, d += 4)
|
|
1216
|
-
b[U] = a.getUint32(d, !0);
|
|
1217
|
-
let { A: f, B: p, C: l, D: S } = this;
|
|
1218
|
-
for (let U = 0; U < 64; U++) {
|
|
1219
|
-
let k, F, v;
|
|
1220
|
-
U < 16 ? (k = (0, t.Chi)(p, l, S), F = U, v = [7, 12, 17, 22]) : U < 32 ? (k = (0, t.Chi)(S, p, l), F = (5 * U + 1) % 16, v = [5, 9, 14, 20]) : U < 48 ? (k = p ^ l ^ S, F = (3 * U + 5) % 16, v = [4, 11, 16, 23]) : (k = l ^ (p | ~S), F = 7 * U % 16, v = [6, 10, 15, 21]), k = k + f + n[U] + b[F], f = S, S = l, l = p, p = p + (0, e.rotl)(k, v[U % 4]);
|
|
1221
|
-
}
|
|
1222
|
-
f = f + this.A | 0, p = p + this.B | 0, l = l + this.C | 0, S = S + this.D | 0, this.set(f, p, l, S);
|
|
1223
|
-
}
|
|
1224
|
-
roundClean() {
|
|
1225
|
-
(0, e.clean)(b);
|
|
1226
|
-
}
|
|
1227
|
-
destroy() {
|
|
1228
|
-
this.set(0, 0, 0, 0), (0, e.clean)(this.buffer);
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
N.MD5 = x, N.md5 = (0, e.createHasher)(() => new x());
|
|
1232
|
-
const H = /* @__PURE__ */ Uint8Array.from([
|
|
1233
|
-
7,
|
|
1234
|
-
4,
|
|
1235
|
-
13,
|
|
1236
|
-
1,
|
|
1237
|
-
10,
|
|
1238
|
-
6,
|
|
1239
|
-
15,
|
|
1240
|
-
3,
|
|
1241
|
-
12,
|
|
1242
|
-
0,
|
|
1243
|
-
9,
|
|
1244
|
-
5,
|
|
1245
|
-
2,
|
|
1246
|
-
14,
|
|
1247
|
-
11,
|
|
1248
|
-
8
|
|
1249
|
-
]), u = Uint8Array.from(new Array(16).fill(0).map((B, a) => a)), A = u.map((B) => (9 * B + 5) % 16), m = /* @__PURE__ */ (() => {
|
|
1250
|
-
const d = [[u], [A]];
|
|
1251
|
-
for (let f = 0; f < 4; f++)
|
|
1252
|
-
for (let p of d)
|
|
1253
|
-
p.push(p[f].map((l) => H[l]));
|
|
1254
|
-
return d;
|
|
1255
|
-
})(), w = m[0], I = m[1], C = /* @__PURE__ */ [
|
|
1256
|
-
[11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],
|
|
1257
|
-
[12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],
|
|
1258
|
-
[13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],
|
|
1259
|
-
[14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],
|
|
1260
|
-
[15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5]
|
|
1261
|
-
].map((B) => Uint8Array.from(B)), R = /* @__PURE__ */ w.map((B, a) => B.map((d) => C[a][d])), M = /* @__PURE__ */ I.map((B, a) => B.map((d) => C[a][d])), y = /* @__PURE__ */ Uint32Array.from([
|
|
1262
|
-
0,
|
|
1263
|
-
1518500249,
|
|
1264
|
-
1859775393,
|
|
1265
|
-
2400959708,
|
|
1266
|
-
2840853838
|
|
1267
|
-
]), O = /* @__PURE__ */ Uint32Array.from([
|
|
1268
|
-
1352829926,
|
|
1269
|
-
1548603684,
|
|
1270
|
-
1836072691,
|
|
1271
|
-
2053994217,
|
|
1272
|
-
0
|
|
1273
|
-
]);
|
|
1274
|
-
function L(B, a, d, f) {
|
|
1275
|
-
return B === 0 ? a ^ d ^ f : B === 1 ? a & d | ~a & f : B === 2 ? (a | ~d) ^ f : B === 3 ? a & f | d & ~f : a ^ (d | ~f);
|
|
1276
|
-
}
|
|
1277
|
-
const E = /* @__PURE__ */ new Uint32Array(16);
|
|
1278
|
-
class D extends t.HashMD {
|
|
1279
|
-
constructor() {
|
|
1280
|
-
super(64, 20, 8, !0), this.h0 = 1732584193, this.h1 = -271733879, this.h2 = -1732584194, this.h3 = 271733878, this.h4 = -1009589776;
|
|
1281
|
-
}
|
|
1282
|
-
get() {
|
|
1283
|
-
const { h0: a, h1: d, h2: f, h3: p, h4: l } = this;
|
|
1284
|
-
return [a, d, f, p, l];
|
|
1285
|
-
}
|
|
1286
|
-
set(a, d, f, p, l) {
|
|
1287
|
-
this.h0 = a | 0, this.h1 = d | 0, this.h2 = f | 0, this.h3 = p | 0, this.h4 = l | 0;
|
|
1288
|
-
}
|
|
1289
|
-
process(a, d) {
|
|
1290
|
-
for (let _ = 0; _ < 16; _++, d += 4)
|
|
1291
|
-
E[_] = a.getUint32(d, !0);
|
|
1292
|
-
let f = this.h0 | 0, p = f, l = this.h1 | 0, S = l, U = this.h2 | 0, k = U, F = this.h3 | 0, v = F, c = this.h4 | 0, g = c;
|
|
1293
|
-
for (let _ = 0; _ < 5; _++) {
|
|
1294
|
-
const T = 4 - _, G = y[_], P = O[_], tt = w[_], X = I[_], J = R[_], at = M[_];
|
|
1295
|
-
for (let Q = 0; Q < 16; Q++) {
|
|
1296
|
-
const et = (0, e.rotl)(f + L(_, l, U, F) + E[tt[Q]] + G, J[Q]) + c | 0;
|
|
1297
|
-
f = c, c = F, F = (0, e.rotl)(U, 10) | 0, U = l, l = et;
|
|
1298
|
-
}
|
|
1299
|
-
for (let Q = 0; Q < 16; Q++) {
|
|
1300
|
-
const et = (0, e.rotl)(p + L(T, S, k, v) + E[X[Q]] + P, at[Q]) + g | 0;
|
|
1301
|
-
p = g, g = v, v = (0, e.rotl)(k, 10) | 0, k = S, S = et;
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
|
-
this.set(this.h1 + U + v | 0, this.h2 + F + g | 0, this.h3 + c + p | 0, this.h4 + f + S | 0, this.h0 + l + k | 0);
|
|
1305
|
-
}
|
|
1306
|
-
roundClean() {
|
|
1307
|
-
(0, e.clean)(E);
|
|
1308
|
-
}
|
|
1309
|
-
destroy() {
|
|
1310
|
-
this.destroyed = !0, (0, e.clean)(this.buffer), this.set(0, 0, 0, 0, 0);
|
|
1311
|
-
}
|
|
1312
|
-
}
|
|
1313
|
-
return N.RIPEMD160 = D, N.ripemd160 = (0, e.createHasher)(() => new D()), N;
|
|
1314
|
-
}
|
|
1315
|
-
var Wt;
|
|
1316
|
-
function As() {
|
|
1317
|
-
if (Wt) return ot;
|
|
1318
|
-
Wt = 1, Object.defineProperty(ot, "__esModule", { value: !0 }), ot.ripemd160 = ot.RIPEMD160 = void 0;
|
|
1319
|
-
const t = /* @__PURE__ */ We();
|
|
1320
|
-
return ot.RIPEMD160 = t.RIPEMD160, ot.ripemd160 = t.ripemd160, ot;
|
|
1321
|
-
}
|
|
1322
|
-
var Y = {}, qt;
|
|
1323
|
-
function ys() {
|
|
1324
|
-
if (qt) return Y;
|
|
1325
|
-
qt = 1, Object.defineProperty(Y, "__esModule", { value: !0 }), Y.sha224 = Y.SHA224 = Y.sha256 = Y.SHA256 = void 0;
|
|
1326
|
-
const t = /* @__PURE__ */ ce();
|
|
1327
|
-
return Y.SHA256 = t.SHA256, Y.sha256 = t.sha256, Y.SHA224 = t.SHA224, Y.sha224 = t.sha224, Y;
|
|
1328
|
-
}
|
|
1329
|
-
var W = {}, Kt;
|
|
1330
|
-
function gs() {
|
|
1331
|
-
if (Kt) return W;
|
|
1332
|
-
Kt = 1, Object.defineProperty(W, "__esModule", { value: !0 }), W.sha512_256 = W.SHA512_256 = W.sha512_224 = W.SHA512_224 = W.sha384 = W.SHA384 = W.sha512 = W.SHA512 = void 0;
|
|
1333
|
-
const t = /* @__PURE__ */ ce();
|
|
1334
|
-
return W.SHA512 = t.SHA512, W.sha512 = t.sha512, W.SHA384 = t.SHA384, W.sha384 = t.sha384, W.SHA512_224 = t.SHA512_224, W.sha512_224 = t.sha512_224, W.SHA512_256 = t.SHA512_256, W.sha512_256 = t.sha512_256, W;
|
|
1335
|
-
}
|
|
1336
|
-
function qe(t) {
|
|
1337
|
-
return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
|
|
1338
|
-
}
|
|
1339
|
-
function Nt(t, e = "") {
|
|
1340
|
-
if (!Number.isSafeInteger(t) || t < 0) {
|
|
1341
|
-
const s = e && `"${e}" `;
|
|
1342
|
-
throw new Error(`${s}expected integer >= 0, got ${t}`);
|
|
1343
|
-
}
|
|
1344
|
-
}
|
|
1345
|
-
function It(t, e, s = "") {
|
|
1346
|
-
const i = qe(t), o = t?.length, r = e !== void 0;
|
|
1347
|
-
if (!i || r && o !== e) {
|
|
1348
|
-
const n = s && `"${s}" `, h = r ? ` of length ${e}` : "", b = i ? `length=${o}` : `type=${typeof t}`;
|
|
1349
|
-
throw new Error(n + "expected Uint8Array" + h + ", got " + b);
|
|
1350
|
-
}
|
|
1351
|
-
return t;
|
|
1352
|
-
}
|
|
1353
|
-
function Xt(t, e = !0) {
|
|
1354
|
-
if (t.destroyed)
|
|
1355
|
-
throw new Error("Hash instance has been destroyed");
|
|
1356
|
-
if (e && t.finished)
|
|
1357
|
-
throw new Error("Hash#digest() has already been called");
|
|
1358
|
-
}
|
|
1359
|
-
function Ke(t, e) {
|
|
1360
|
-
It(t, void 0, "digestInto() output");
|
|
1361
|
-
const s = e.outputLen;
|
|
1362
|
-
if (t.length < s)
|
|
1363
|
-
throw new Error('"digestInto() output" expected to be of length >=' + s);
|
|
1364
|
-
}
|
|
1365
|
-
function Ne(t) {
|
|
1366
|
-
return new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
|
|
1367
|
-
}
|
|
1368
|
-
function he(...t) {
|
|
1369
|
-
for (let e = 0; e < t.length; e++)
|
|
1370
|
-
t[e].fill(0);
|
|
1371
|
-
}
|
|
1372
|
-
const Xe = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
1373
|
-
function Je(t) {
|
|
1374
|
-
return t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
|
|
1375
|
-
}
|
|
1376
|
-
function Qe(t) {
|
|
1377
|
-
for (let e = 0; e < t.length; e++)
|
|
1378
|
-
t[e] = Je(t[e]);
|
|
1379
|
-
return t;
|
|
1380
|
-
}
|
|
1381
|
-
const Jt = Xe ? (t) => t : Qe;
|
|
1382
|
-
function _s(...t) {
|
|
1383
|
-
let e = 0;
|
|
1384
|
-
for (let i = 0; i < t.length; i++) {
|
|
1385
|
-
const o = t[i];
|
|
1386
|
-
It(o), e += o.length;
|
|
1387
|
-
}
|
|
1388
|
-
const s = new Uint8Array(e);
|
|
1389
|
-
for (let i = 0, o = 0; i < t.length; i++) {
|
|
1390
|
-
const r = t[i];
|
|
1391
|
-
s.set(r, o), o += r.length;
|
|
1392
|
-
}
|
|
1393
|
-
return s;
|
|
1394
|
-
}
|
|
1395
|
-
function Ye(t, e = {}) {
|
|
1396
|
-
const s = (o, r) => t(r).update(o).digest(), i = t(void 0);
|
|
1397
|
-
return s.outputLen = i.outputLen, s.blockLen = i.blockLen, s.create = (o) => t(o), Object.assign(s, e), Object.freeze(s);
|
|
1398
|
-
}
|
|
1399
|
-
function ws(t = 32) {
|
|
1400
|
-
const e = typeof globalThis == "object" ? globalThis.crypto : null;
|
|
1401
|
-
if (typeof e?.getRandomValues != "function")
|
|
1402
|
-
throw new Error("crypto.getRandomValues must be defined");
|
|
1403
|
-
return e.getRandomValues(new Uint8Array(t));
|
|
1404
|
-
}
|
|
1405
|
-
const ae = (t) => ({
|
|
1406
|
-
oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, t])
|
|
1407
|
-
}), _t = /* @__PURE__ */ BigInt(2 ** 32 - 1), Qt = /* @__PURE__ */ BigInt(32);
|
|
1408
|
-
function Ze(t, e = !1) {
|
|
1409
|
-
return e ? { h: Number(t & _t), l: Number(t >> Qt & _t) } : { h: Number(t >> Qt & _t) | 0, l: Number(t & _t) | 0 };
|
|
1410
|
-
}
|
|
1411
|
-
function ze(t, e = !1) {
|
|
1412
|
-
const s = t.length;
|
|
1413
|
-
let i = new Uint32Array(s), o = new Uint32Array(s);
|
|
1414
|
-
for (let r = 0; r < s; r++) {
|
|
1415
|
-
const { h: n, l: h } = Ze(t[r], e);
|
|
1416
|
-
[i[r], o[r]] = [n, h];
|
|
1417
|
-
}
|
|
1418
|
-
return [i, o];
|
|
1419
|
-
}
|
|
1420
|
-
const $e = (t, e, s) => t << s | e >>> 32 - s, ts = (t, e, s) => e << s | t >>> 32 - s, es = (t, e, s) => e << s - 32 | t >>> 64 - s, ss = (t, e, s) => t << s - 32 | e >>> 64 - s, ns = BigInt(0), bt = BigInt(1), rs = BigInt(2), is = BigInt(7), os = BigInt(256), cs = BigInt(113), fe = [], de = [], ue = [];
|
|
1421
|
-
for (let t = 0, e = bt, s = 1, i = 0; t < 24; t++) {
|
|
1422
|
-
[s, i] = [i, (2 * s + 3 * i) % 5], fe.push(2 * (5 * i + s)), de.push((t + 1) * (t + 2) / 2 % 64);
|
|
1423
|
-
let o = ns;
|
|
1424
|
-
for (let r = 0; r < 7; r++)
|
|
1425
|
-
e = (e << bt ^ (e >> is) * cs) % os, e & rs && (o ^= bt << (bt << BigInt(r)) - bt);
|
|
1426
|
-
ue.push(o);
|
|
1427
|
-
}
|
|
1428
|
-
const le = ze(ue, !0), hs = le[0], as = le[1], Yt = (t, e, s) => s > 32 ? es(t, e, s) : $e(t, e, s), Zt = (t, e, s) => s > 32 ? ss(t, e, s) : ts(t, e, s);
|
|
1429
|
-
function fs(t, e = 24) {
|
|
1430
|
-
const s = new Uint32Array(10);
|
|
1431
|
-
for (let i = 24 - e; i < 24; i++) {
|
|
1432
|
-
for (let n = 0; n < 10; n++)
|
|
1433
|
-
s[n] = t[n] ^ t[n + 10] ^ t[n + 20] ^ t[n + 30] ^ t[n + 40];
|
|
1434
|
-
for (let n = 0; n < 10; n += 2) {
|
|
1435
|
-
const h = (n + 8) % 10, b = (n + 2) % 10, x = s[b], H = s[b + 1], u = Yt(x, H, 1) ^ s[h], A = Zt(x, H, 1) ^ s[h + 1];
|
|
1436
|
-
for (let m = 0; m < 50; m += 10)
|
|
1437
|
-
t[n + m] ^= u, t[n + m + 1] ^= A;
|
|
1438
|
-
}
|
|
1439
|
-
let o = t[2], r = t[3];
|
|
1440
|
-
for (let n = 0; n < 24; n++) {
|
|
1441
|
-
const h = de[n], b = Yt(o, r, h), x = Zt(o, r, h), H = fe[n];
|
|
1442
|
-
o = t[H], r = t[H + 1], t[H] = b, t[H + 1] = x;
|
|
1443
|
-
}
|
|
1444
|
-
for (let n = 0; n < 50; n += 10) {
|
|
1445
|
-
for (let h = 0; h < 10; h++)
|
|
1446
|
-
s[h] = t[n + h];
|
|
1447
|
-
for (let h = 0; h < 10; h++)
|
|
1448
|
-
t[n + h] ^= ~s[(h + 2) % 10] & s[(h + 4) % 10];
|
|
1449
|
-
}
|
|
1450
|
-
t[0] ^= hs[i], t[1] ^= as[i];
|
|
1451
|
-
}
|
|
1452
|
-
he(s);
|
|
1453
|
-
}
|
|
1454
|
-
class Et {
|
|
1455
|
-
state;
|
|
1456
|
-
pos = 0;
|
|
1457
|
-
posOut = 0;
|
|
1458
|
-
finished = !1;
|
|
1459
|
-
state32;
|
|
1460
|
-
destroyed = !1;
|
|
1461
|
-
blockLen;
|
|
1462
|
-
suffix;
|
|
1463
|
-
outputLen;
|
|
1464
|
-
enableXOF = !1;
|
|
1465
|
-
rounds;
|
|
1466
|
-
// NOTE: we accept arguments in bytes instead of bits here.
|
|
1467
|
-
constructor(e, s, i, o = !1, r = 24) {
|
|
1468
|
-
if (this.blockLen = e, this.suffix = s, this.outputLen = i, this.enableXOF = o, this.rounds = r, Nt(i, "outputLen"), !(0 < e && e < 200))
|
|
1469
|
-
throw new Error("only keccak-f1600 function is supported");
|
|
1470
|
-
this.state = new Uint8Array(200), this.state32 = Ne(this.state);
|
|
1471
|
-
}
|
|
1472
|
-
clone() {
|
|
1473
|
-
return this._cloneInto();
|
|
1474
|
-
}
|
|
1475
|
-
keccak() {
|
|
1476
|
-
Jt(this.state32), fs(this.state32, this.rounds), Jt(this.state32), this.posOut = 0, this.pos = 0;
|
|
1477
|
-
}
|
|
1478
|
-
update(e) {
|
|
1479
|
-
Xt(this), It(e);
|
|
1480
|
-
const { blockLen: s, state: i } = this, o = e.length;
|
|
1481
|
-
for (let r = 0; r < o; ) {
|
|
1482
|
-
const n = Math.min(s - this.pos, o - r);
|
|
1483
|
-
for (let h = 0; h < n; h++)
|
|
1484
|
-
i[this.pos++] ^= e[r++];
|
|
1485
|
-
this.pos === s && this.keccak();
|
|
1486
|
-
}
|
|
1487
|
-
return this;
|
|
1488
|
-
}
|
|
1489
|
-
finish() {
|
|
1490
|
-
if (this.finished)
|
|
1491
|
-
return;
|
|
1492
|
-
this.finished = !0;
|
|
1493
|
-
const { state: e, suffix: s, pos: i, blockLen: o } = this;
|
|
1494
|
-
e[i] ^= s, (s & 128) !== 0 && i === o - 1 && this.keccak(), e[o - 1] ^= 128, this.keccak();
|
|
1495
|
-
}
|
|
1496
|
-
writeInto(e) {
|
|
1497
|
-
Xt(this, !1), It(e), this.finish();
|
|
1498
|
-
const s = this.state, { blockLen: i } = this;
|
|
1499
|
-
for (let o = 0, r = e.length; o < r; ) {
|
|
1500
|
-
this.posOut >= i && this.keccak();
|
|
1501
|
-
const n = Math.min(i - this.posOut, r - o);
|
|
1502
|
-
e.set(s.subarray(this.posOut, this.posOut + n), o), this.posOut += n, o += n;
|
|
1503
|
-
}
|
|
1504
|
-
return e;
|
|
1505
|
-
}
|
|
1506
|
-
xofInto(e) {
|
|
1507
|
-
if (!this.enableXOF)
|
|
1508
|
-
throw new Error("XOF is not possible for this instance");
|
|
1509
|
-
return this.writeInto(e);
|
|
1510
|
-
}
|
|
1511
|
-
xof(e) {
|
|
1512
|
-
return Nt(e), this.xofInto(new Uint8Array(e));
|
|
1513
|
-
}
|
|
1514
|
-
digestInto(e) {
|
|
1515
|
-
if (Ke(e, this), this.finished)
|
|
1516
|
-
throw new Error("digest() was already called");
|
|
1517
|
-
return this.writeInto(e), this.destroy(), e;
|
|
1518
|
-
}
|
|
1519
|
-
digest() {
|
|
1520
|
-
return this.digestInto(new Uint8Array(this.outputLen));
|
|
1521
|
-
}
|
|
1522
|
-
destroy() {
|
|
1523
|
-
this.destroyed = !0, he(this.state);
|
|
1524
|
-
}
|
|
1525
|
-
_cloneInto(e) {
|
|
1526
|
-
const { blockLen: s, suffix: i, outputLen: o, rounds: r, enableXOF: n } = this;
|
|
1527
|
-
return e ||= new Et(s, i, o, n, r), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = r, e.suffix = i, e.outputLen = o, e.enableXOF = n, e.destroyed = this.destroyed, e;
|
|
1528
|
-
}
|
|
1529
|
-
}
|
|
1530
|
-
const be = (t, e, s, i = {}) => Ye((o = {}) => new Et(e, t, o.dkLen === void 0 ? s : o.dkLen, !0), i), Ss = /* @__PURE__ */ be(31, 168, 16, /* @__PURE__ */ ae(11)), Is = /* @__PURE__ */ be(31, 136, 32, /* @__PURE__ */ ae(12));
|
|
1531
|
-
class xe extends se {
|
|
1532
|
-
constructor(e, s) {
|
|
1533
|
-
super(), this.finished = !1, this.destroyed = !1, $t(e);
|
|
1534
|
-
const i = Ut(s);
|
|
1535
|
-
if (this.iHash = e.create(), typeof this.iHash.update != "function")
|
|
1536
|
-
throw new Error("Expected instance of class which extends utils.Hash");
|
|
1537
|
-
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
|
|
1538
|
-
const o = this.blockLen, r = new Uint8Array(o);
|
|
1539
|
-
r.set(i.length > o ? e.create().update(i).digest() : i);
|
|
1540
|
-
for (let n = 0; n < r.length; n++)
|
|
1541
|
-
r[n] ^= 54;
|
|
1542
|
-
this.iHash.update(r), this.oHash = e.create();
|
|
1543
|
-
for (let n = 0; n < r.length; n++)
|
|
1544
|
-
r[n] ^= 106;
|
|
1545
|
-
this.oHash.update(r), ct(r);
|
|
1546
|
-
}
|
|
1547
|
-
update(e) {
|
|
1548
|
-
return St(this), this.iHash.update(e), this;
|
|
1549
|
-
}
|
|
1550
|
-
digestInto(e) {
|
|
1551
|
-
St(this), ht(e, this.outputLen), this.finished = !0, this.iHash.digestInto(e), this.oHash.update(e), this.oHash.digestInto(e), this.destroy();
|
|
1552
|
-
}
|
|
1553
|
-
digest() {
|
|
1554
|
-
const e = new Uint8Array(this.oHash.outputLen);
|
|
1555
|
-
return this.digestInto(e), e;
|
|
1556
|
-
}
|
|
1557
|
-
_cloneInto(e) {
|
|
1558
|
-
e || (e = Object.create(Object.getPrototypeOf(this), {}));
|
|
1559
|
-
const { oHash: s, iHash: i, finished: o, destroyed: r, blockLen: n, outputLen: h } = this;
|
|
1560
|
-
return e = e, e.finished = o, e.destroyed = r, e.blockLen = n, e.outputLen = h, e.oHash = s._cloneInto(e.oHash), e.iHash = i._cloneInto(e.iHash), e;
|
|
1561
|
-
}
|
|
1562
|
-
clone() {
|
|
1563
|
-
return this._cloneInto();
|
|
1564
|
-
}
|
|
1565
|
-
destroy() {
|
|
1566
|
-
this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
|
|
1567
|
-
}
|
|
2626
|
+
const o = (i, c, r) => new s(i, c).update(r).digest();
|
|
2627
|
+
t.hmac = o, t.hmac.create = (i, c) => new s(i, c);
|
|
2628
|
+
})(Qt)), Qt;
|
|
1568
2629
|
}
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
const
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
}
|
|
1579
|
-
function us(t, e, s, i, o) {
|
|
1580
|
-
return t.destroy(), e.destroy(), i && i.destroy(), ct(o), s;
|
|
1581
|
-
}
|
|
1582
|
-
function Ls(t, e, s, i) {
|
|
1583
|
-
const { c: o, dkLen: r, DK: n, PRF: h, PRFSalt: b } = ds(t, e, s, i);
|
|
1584
|
-
let x;
|
|
1585
|
-
const H = new Uint8Array(4), u = wt(H), A = new Uint8Array(h.outputLen);
|
|
1586
|
-
for (let m = 1, w = 0; w < r; m++, w += h.outputLen) {
|
|
1587
|
-
const I = n.subarray(w, w + h.outputLen);
|
|
1588
|
-
u.setInt32(0, m, !1), (x = b._cloneInto(x)).update(H).digestInto(A), I.set(A.subarray(0, I.length));
|
|
1589
|
-
for (let C = 1; C < o; C++) {
|
|
1590
|
-
h._cloneInto(x).update(A).digestInto(A);
|
|
1591
|
-
for (let R = 0; R < I.length; R++)
|
|
1592
|
-
I[R] ^= A[R];
|
|
1593
|
-
}
|
|
1594
|
-
}
|
|
1595
|
-
return us(h, b, n, x, A);
|
|
1596
|
-
}
|
|
1597
|
-
const Bs = Re;
|
|
1598
|
-
var xt = {}, zt;
|
|
1599
|
-
function ms() {
|
|
1600
|
-
if (zt) return xt;
|
|
1601
|
-
zt = 1, Object.defineProperty(xt, "__esModule", { value: !0 }), xt.pbkdf2 = o, xt.pbkdf2Async = r;
|
|
1602
|
-
const t = /* @__PURE__ */ Pe(), e = /* @__PURE__ */ pt();
|
|
1603
|
-
function s(n, h, b, x) {
|
|
1604
|
-
(0, e.ahash)(n);
|
|
1605
|
-
const H = (0, e.checkOpts)({ dkLen: 32, asyncTick: 10 }, x), { c: u, dkLen: A, asyncTick: m } = H;
|
|
1606
|
-
if ((0, e.anumber)(u), (0, e.anumber)(A), (0, e.anumber)(m), u < 1)
|
|
2630
|
+
var Be;
|
|
2631
|
+
function Vs() {
|
|
2632
|
+
if (Be) return Dt;
|
|
2633
|
+
Be = 1, Object.defineProperty(Dt, "__esModule", { value: !0 }), Dt.pbkdf2 = i, Dt.pbkdf2Async = c;
|
|
2634
|
+
const t = /* @__PURE__ */ bs(), e = /* @__PURE__ */ Rt();
|
|
2635
|
+
function s(r, a, d, x) {
|
|
2636
|
+
(0, e.ahash)(r);
|
|
2637
|
+
const H = (0, e.checkOpts)({ dkLen: 32, asyncTick: 10 }, x), { c: f, dkLen: g, asyncTick: w } = H;
|
|
2638
|
+
if ((0, e.anumber)(f), (0, e.anumber)(g), (0, e.anumber)(w), f < 1)
|
|
1607
2639
|
throw new Error("iterations (c) should be >= 1");
|
|
1608
|
-
const
|
|
1609
|
-
return { c:
|
|
2640
|
+
const S = (0, e.kdfInputToBytes)(a), I = (0, e.kdfInputToBytes)(d), D = new Uint8Array(g), W = t.hmac.create(r, S), v = W._cloneInto().update(I);
|
|
2641
|
+
return { c: f, dkLen: g, asyncTick: w, DK: D, PRF: W, PRFSalt: v };
|
|
1610
2642
|
}
|
|
1611
|
-
function
|
|
1612
|
-
return
|
|
2643
|
+
function o(r, a, d, x, H) {
|
|
2644
|
+
return r.destroy(), a.destroy(), x && x.destroy(), (0, e.clean)(H), d;
|
|
1613
2645
|
}
|
|
1614
|
-
function
|
|
1615
|
-
const { c: H, dkLen:
|
|
2646
|
+
function i(r, a, d, x) {
|
|
2647
|
+
const { c: H, dkLen: f, DK: g, PRF: w, PRFSalt: S } = s(r, a, d, x);
|
|
1616
2648
|
let I;
|
|
1617
|
-
const
|
|
1618
|
-
for (let
|
|
1619
|
-
const
|
|
1620
|
-
|
|
1621
|
-
for (let
|
|
1622
|
-
|
|
1623
|
-
for (let
|
|
1624
|
-
|
|
2649
|
+
const D = new Uint8Array(4), W = (0, e.createView)(D), v = new Uint8Array(w.outputLen);
|
|
2650
|
+
for (let _ = 1, C = 0; C < f; _++, C += w.outputLen) {
|
|
2651
|
+
const A = g.subarray(C, C + w.outputLen);
|
|
2652
|
+
W.setInt32(0, _, !1), (I = S._cloneInto(I)).update(D).digestInto(v), A.set(v.subarray(0, A.length));
|
|
2653
|
+
for (let B = 1; B < H; B++) {
|
|
2654
|
+
w._cloneInto(I).update(v).digestInto(v);
|
|
2655
|
+
for (let m = 0; m < A.length; m++)
|
|
2656
|
+
A[m] ^= v[m];
|
|
1625
2657
|
}
|
|
1626
2658
|
}
|
|
1627
|
-
return
|
|
1628
|
-
}
|
|
1629
|
-
async function r
|
|
1630
|
-
const { c: H, dkLen:
|
|
1631
|
-
let
|
|
1632
|
-
const
|
|
1633
|
-
for (let
|
|
1634
|
-
const
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
for (let
|
|
1638
|
-
|
|
2659
|
+
return o(w, S, g, I, v);
|
|
2660
|
+
}
|
|
2661
|
+
async function c(r, a, d, x) {
|
|
2662
|
+
const { c: H, dkLen: f, asyncTick: g, DK: w, PRF: S, PRFSalt: I } = s(r, a, d, x);
|
|
2663
|
+
let D;
|
|
2664
|
+
const W = new Uint8Array(4), v = (0, e.createView)(W), _ = new Uint8Array(S.outputLen);
|
|
2665
|
+
for (let C = 1, A = 0; A < f; C++, A += S.outputLen) {
|
|
2666
|
+
const B = w.subarray(A, A + S.outputLen);
|
|
2667
|
+
v.setInt32(0, C, !1), (D = I._cloneInto(D)).update(W).digestInto(_), B.set(_.subarray(0, B.length)), await (0, e.asyncLoop)(H - 1, g, () => {
|
|
2668
|
+
S._cloneInto(D).update(_).digestInto(_);
|
|
2669
|
+
for (let m = 0; m < B.length; m++)
|
|
2670
|
+
B[m] ^= _[m];
|
|
1639
2671
|
});
|
|
1640
2672
|
}
|
|
1641
|
-
return
|
|
2673
|
+
return o(S, I, w, D, _);
|
|
1642
2674
|
}
|
|
1643
|
-
return
|
|
2675
|
+
return Dt;
|
|
1644
2676
|
}
|
|
1645
2677
|
export {
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
gs as
|
|
1650
|
-
|
|
1651
|
-
It as e,
|
|
2678
|
+
Bs as a,
|
|
2679
|
+
Ss as b,
|
|
2680
|
+
Is as c,
|
|
2681
|
+
gs as d,
|
|
2682
|
+
_t as e,
|
|
1652
2683
|
_s as f,
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
Hs as y,
|
|
1672
|
-
ve as z
|
|
2684
|
+
zt as g,
|
|
2685
|
+
Ls as h,
|
|
2686
|
+
u0 as i,
|
|
2687
|
+
ms as j,
|
|
2688
|
+
As as k,
|
|
2689
|
+
Vs as l,
|
|
2690
|
+
Es as m,
|
|
2691
|
+
Us as n,
|
|
2692
|
+
Rt as o,
|
|
2693
|
+
ps as p,
|
|
2694
|
+
Gt as q,
|
|
2695
|
+
ws as r,
|
|
2696
|
+
Hs as s,
|
|
2697
|
+
ys as t,
|
|
2698
|
+
l0 as u,
|
|
2699
|
+
Ue as v,
|
|
2700
|
+
N0 as w,
|
|
2701
|
+
J0 as x
|
|
1673
2702
|
};
|