@btc-vision/transaction 1.8.6 → 1.8.7
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/btc-vision-bitcoin.js +364 -364
- package/browser/index.js +1577 -1276
- package/browser/noble-curves.js +1072 -1173
- package/browser/noble-hashes.js +282 -261
- package/browser/rolldown-runtime.js +7 -7
- package/browser/src/_version.d.ts +1 -0
- package/browser/{abi → src/abi}/ABICoder.d.ts +0 -1
- package/browser/{abi → src/abi}/ABIDataTypes.d.ts +0 -1
- package/browser/{abi → src/abi}/AbiTypes.d.ts +0 -1
- package/browser/{abi → src/abi}/TupleUtils.d.ts +0 -1
- package/browser/{branded → src/branded}/Branded.d.ts +0 -1
- package/browser/{buffer → src/buffer}/BinaryReader.d.ts +0 -1
- package/browser/{buffer → src/buffer}/BinaryWriter.d.ts +0 -1
- package/browser/{bytecode → src/bytecode}/Compressor.d.ts +0 -1
- package/browser/{chain → src/chain}/ChainData.d.ts +1 -2
- package/browser/{consensus → src/consensus}/Consensus.d.ts +0 -1
- package/browser/{consensus → src/consensus}/ConsensusConfig.d.ts +0 -1
- package/browser/{consensus → src/consensus}/IConsensusConfig.d.ts +0 -1
- package/browser/{consensus → src/consensus}/metadata/RoswellConsensus.d.ts +0 -1
- package/browser/{crypto → src/crypto}/crypto.d.ts +1 -2
- package/browser/{deterministic → src/deterministic}/AddressMap.d.ts +0 -1
- package/browser/{deterministic → src/deterministic}/AddressSet.d.ts +0 -1
- package/browser/{deterministic → src/deterministic}/CustomMap.d.ts +0 -1
- package/browser/{deterministic → src/deterministic}/DeterministicMap.d.ts +0 -1
- package/browser/{deterministic → src/deterministic}/DeterministicSet.d.ts +0 -1
- package/browser/{deterministic → src/deterministic}/ExtendedAddressMap.d.ts +0 -1
- package/browser/{deterministic → src/deterministic}/FastMap.d.ts +0 -1
- package/browser/{ecc → src/ecc}/backend.d.ts +1 -2
- package/browser/{epoch → src/epoch}/ChallengeSolution.d.ts +0 -1
- package/browser/{epoch → src/epoch}/interfaces/IChallengeSolution.d.ts +0 -1
- package/browser/{epoch → src/epoch}/validator/EpochValidator.d.ts +0 -1
- package/browser/{event → src/event}/NetEvent.d.ts +0 -1
- package/browser/{generators → src/generators}/AddressGenerator.d.ts +1 -2
- package/browser/{generators → src/generators}/Features.d.ts +0 -1
- package/browser/{generators → src/generators}/Generator.d.ts +1 -2
- package/browser/{generators → src/generators}/MLDSAData.d.ts +1 -2
- package/browser/{generators → src/generators}/builders/CalldataGenerator.d.ts +1 -2
- package/browser/{generators → src/generators}/builders/CustomGenerator.d.ts +1 -2
- package/browser/{generators → src/generators}/builders/DeploymentGenerator.d.ts +1 -2
- package/browser/{generators → src/generators}/builders/HashCommitmentGenerator.d.ts +1 -2
- package/browser/{generators → src/generators}/builders/LegacyCalldataGenerator.d.ts +1 -2
- package/browser/{generators → src/generators}/builders/MultiSignGenerator.d.ts +1 -2
- package/browser/{generators → src/generators}/builders/P2WDAGenerator.d.ts +1 -2
- package/browser/{index.d.ts → src/index.d.ts} +0 -1
- package/browser/{keypair → src/keypair}/Address.d.ts +2 -3
- package/browser/{keypair → src/keypair}/AddressVerificator.d.ts +2 -3
- package/browser/{keypair → src/keypair}/EcKeyPair.d.ts +2 -3
- package/browser/{keypair → src/keypair}/MessageSigner.d.ts +2 -3
- package/browser/{keypair → src/keypair}/Secp256k1PointDeriver.d.ts +0 -1
- package/browser/{keypair → src/keypair}/Wallet.d.ts +2 -3
- package/browser/{keypair → src/keypair}/interfaces/IWallet.d.ts +0 -1
- package/browser/{metadata → src/metadata}/ContractBaseMetadata.d.ts +1 -2
- package/browser/{mnemonic → src/mnemonic}/BIPStandard.d.ts +0 -1
- package/browser/{mnemonic → src/mnemonic}/Mnemonic.d.ts +2 -3
- package/browser/{mnemonic → src/mnemonic}/MnemonicStrength.d.ts +0 -1
- package/browser/{network → src/network}/ChainId.d.ts +0 -1
- package/browser/{opnet.d.ts → src/opnet.d.ts} +2 -2
- package/browser/{p2wda → src/p2wda}/P2WDADetector.d.ts +1 -2
- package/browser/{polyfill → src/polyfill}/disposable.d.ts +0 -1
- package/browser/{signer → src/signer}/AddressRotation.d.ts +0 -1
- package/browser/{signer → src/signer}/IRotationSigner.d.ts +1 -2
- package/browser/{signer → src/signer}/ParallelSignerAdapter.d.ts +1 -2
- package/browser/{signer → src/signer}/SignerUtils.d.ts +1 -2
- package/browser/{signer → src/signer}/TweakedSigner.d.ts +1 -2
- package/browser/{transaction → src/transaction}/ContractAddress.d.ts +0 -1
- package/browser/{transaction → src/transaction}/TransactionFactory.d.ts +1 -2
- package/browser/{transaction → src/transaction}/browser/BrowserSignerBase.d.ts +1 -2
- package/browser/{transaction → src/transaction}/browser/WalletNetworks.d.ts +0 -1
- package/browser/{transaction → src/transaction}/browser/Web3Provider.d.ts +0 -1
- package/browser/{transaction → src/transaction}/browser/extensions/UnisatSigner.d.ts +1 -2
- package/browser/{transaction → src/transaction}/browser/extensions/XverseSigner.d.ts +1 -2
- package/browser/{transaction → src/transaction}/browser/types/OPWallet.d.ts +0 -1
- package/browser/{transaction → src/transaction}/browser/types/Unisat.d.ts +0 -1
- package/browser/{transaction → src/transaction}/browser/types/Xverse.d.ts +0 -1
- package/browser/{transaction → src/transaction}/builders/CancelTransaction.d.ts +1 -2
- package/browser/src/transaction/builders/ChallengeSolutionTransaction.d.ts +1 -0
- package/browser/{transaction → src/transaction}/builders/ConsolidatedInteractionTransaction.d.ts +0 -1
- package/browser/{transaction → src/transaction}/builders/CustomScriptTransaction.d.ts +1 -2
- package/browser/{transaction → src/transaction}/builders/DeploymentTransaction.d.ts +1 -2
- package/browser/{transaction → src/transaction}/builders/FundingTransaction.d.ts +1 -2
- package/browser/{transaction → src/transaction}/builders/InteractionTransaction.d.ts +1 -2
- package/browser/{transaction → src/transaction}/builders/InteractionTransactionP2WDA.d.ts +1 -2
- package/browser/{transaction → src/transaction}/builders/MultiSignTransaction.d.ts +1 -2
- package/browser/{transaction → src/transaction}/builders/SharedInteractionTransaction.d.ts +1 -2
- package/browser/{transaction → src/transaction}/builders/TransactionBuilder.d.ts +2 -2
- package/browser/{transaction → src/transaction}/enums/TransactionType.d.ts +0 -1
- package/browser/{transaction → src/transaction}/interfaces/ICancelTransactionParameters.d.ts +0 -1
- package/browser/{transaction → src/transaction}/interfaces/IConsolidatedTransactionParameters.d.ts +0 -1
- package/browser/{transaction → src/transaction}/interfaces/ICustomTransactionParameters.d.ts +1 -2
- package/browser/{transaction → src/transaction}/interfaces/ITransactionParameters.d.ts +1 -2
- package/browser/{transaction → src/transaction}/interfaces/ITransactionResponses.d.ts +0 -1
- package/browser/{transaction → src/transaction}/interfaces/ITweakedTransactionData.d.ts +2 -3
- package/browser/{transaction → src/transaction}/interfaces/IWeb3ProviderTypes.d.ts +1 -2
- package/browser/{transaction → src/transaction}/interfaces/Tap.d.ts +1 -2
- package/browser/src/transaction/mineable/CSVMultisigProvider.d.ts +102 -0
- package/browser/{transaction → src/transaction}/mineable/IP2WSHAddress.d.ts +0 -1
- package/browser/{transaction → src/transaction}/mineable/TimelockGenerator.d.ts +1 -2
- package/browser/{transaction → src/transaction}/offline/OfflineTransactionManager.d.ts +51 -2
- package/browser/{transaction → src/transaction}/offline/TransactionReconstructor.d.ts +2 -3
- package/browser/{transaction → src/transaction}/offline/TransactionSerializer.d.ts +0 -1
- package/browser/{transaction → src/transaction}/offline/TransactionStateCapture.d.ts +0 -1
- package/browser/{transaction → src/transaction}/offline/interfaces/ISerializableState.d.ts +10 -3
- package/browser/{transaction → src/transaction}/offline/interfaces/ITypeSpecificData.d.ts +0 -1
- package/browser/{transaction → src/transaction}/psbt/PSBTTypes.d.ts +0 -1
- package/browser/{transaction → src/transaction}/shared/P2MR_MS.d.ts +1 -2
- package/browser/{transaction → src/transaction}/shared/P2TR_MS.d.ts +1 -2
- package/browser/{transaction → src/transaction}/shared/TweakedTransaction.d.ts +21 -3
- package/browser/{transaction → src/transaction}/utils/WitnessUtils.d.ts +0 -1
- package/browser/{utils → src/utils}/BitcoinUtils.d.ts +0 -1
- package/browser/{utils → src/utils}/BufferHelper.d.ts +0 -1
- package/browser/{utils → src/utils}/StringToBuffer.d.ts +0 -1
- package/browser/{utils → src/utils}/lengths.d.ts +0 -1
- package/browser/{utils → src/utils}/types.d.ts +0 -1
- package/browser/{utxo → src/utxo}/OPNetLimitedProvider.d.ts +1 -2
- package/browser/{utxo → src/utxo}/interfaces/BroadcastResponse.d.ts +0 -1
- package/browser/{utxo → src/utxo}/interfaces/IUTXO.d.ts +0 -1
- package/browser/{verification → src/verification}/TapscriptVerificator.d.ts +1 -2
- package/browser/vendors.js +1397 -1397
- package/build/_version.d.ts +1 -2
- package/build/_version.js +1 -2
- package/build/abi/ABICoder.d.ts +0 -1
- package/build/abi/ABICoder.js +0 -1
- package/build/abi/ABIDataTypes.d.ts +0 -1
- package/build/abi/ABIDataTypes.js +0 -1
- package/build/abi/AbiTypes.d.ts +0 -1
- package/build/abi/AbiTypes.js +0 -1
- package/build/abi/TupleUtils.d.ts +0 -1
- package/build/abi/TupleUtils.js +0 -1
- package/build/branded/Branded.d.ts +0 -1
- package/build/branded/Branded.js +0 -1
- package/build/buffer/BinaryReader.d.ts +0 -1
- package/build/buffer/BinaryReader.js +0 -1
- package/build/buffer/BinaryWriter.d.ts +0 -1
- package/build/buffer/BinaryWriter.js +0 -1
- package/build/bytecode/Compressor.d.ts +0 -1
- package/build/bytecode/Compressor.js +0 -1
- package/build/chain/ChainData.d.ts +0 -1
- package/build/chain/ChainData.js +0 -1
- package/build/consensus/Consensus.d.ts +0 -1
- package/build/consensus/Consensus.js +0 -1
- package/build/consensus/ConsensusConfig.d.ts +0 -1
- package/build/consensus/ConsensusConfig.js +0 -1
- package/build/consensus/IConsensusConfig.d.ts +0 -1
- package/build/consensus/IConsensusConfig.js +0 -1
- package/build/consensus/metadata/RoswellConsensus.d.ts +0 -1
- package/build/consensus/metadata/RoswellConsensus.js +0 -1
- package/build/crypto/crypto.d.ts +0 -1
- package/build/crypto/crypto.js +0 -1
- package/build/deterministic/AddressMap.d.ts +0 -1
- package/build/deterministic/AddressMap.js +0 -1
- package/build/deterministic/AddressSet.d.ts +0 -1
- package/build/deterministic/AddressSet.js +0 -1
- package/build/deterministic/CustomMap.d.ts +0 -1
- package/build/deterministic/CustomMap.js +0 -1
- package/build/deterministic/DeterministicMap.d.ts +0 -1
- package/build/deterministic/DeterministicMap.js +0 -1
- package/build/deterministic/DeterministicSet.d.ts +0 -1
- package/build/deterministic/DeterministicSet.js +0 -1
- package/build/deterministic/ExtendedAddressMap.d.ts +0 -1
- package/build/deterministic/ExtendedAddressMap.js +0 -1
- package/build/deterministic/FastMap.d.ts +0 -1
- package/build/deterministic/FastMap.js +0 -1
- package/build/ecc/backend.d.ts +0 -1
- package/build/ecc/backend.js +0 -1
- package/build/epoch/ChallengeSolution.d.ts +0 -1
- package/build/epoch/ChallengeSolution.js +0 -1
- package/build/epoch/interfaces/IChallengeSolution.d.ts +0 -1
- package/build/epoch/interfaces/IChallengeSolution.js +0 -1
- package/build/epoch/validator/EpochValidator.d.ts +0 -1
- package/build/epoch/validator/EpochValidator.js +0 -1
- package/build/event/NetEvent.d.ts +0 -1
- package/build/event/NetEvent.js +0 -1
- package/build/generators/AddressGenerator.d.ts +0 -1
- package/build/generators/AddressGenerator.js +0 -1
- package/build/generators/Features.d.ts +0 -1
- package/build/generators/Features.js +0 -1
- package/build/generators/Generator.d.ts +0 -1
- package/build/generators/Generator.js +0 -1
- package/build/generators/MLDSAData.d.ts +0 -1
- package/build/generators/MLDSAData.js +0 -1
- package/build/generators/builders/CalldataGenerator.d.ts +0 -1
- package/build/generators/builders/CalldataGenerator.js +0 -1
- package/build/generators/builders/CustomGenerator.d.ts +0 -1
- package/build/generators/builders/CustomGenerator.js +0 -1
- package/build/generators/builders/DeploymentGenerator.d.ts +0 -1
- package/build/generators/builders/DeploymentGenerator.js +0 -1
- package/build/generators/builders/HashCommitmentGenerator.d.ts +0 -1
- package/build/generators/builders/HashCommitmentGenerator.js +0 -1
- package/build/generators/builders/LegacyCalldataGenerator.d.ts +0 -1
- package/build/generators/builders/LegacyCalldataGenerator.js +0 -1
- package/build/generators/builders/MultiSignGenerator.d.ts +0 -1
- package/build/generators/builders/MultiSignGenerator.js +0 -1
- package/build/generators/builders/P2WDAGenerator.d.ts +0 -1
- package/build/generators/builders/P2WDAGenerator.js +0 -1
- package/build/index.d.ts +0 -1
- package/build/index.js +0 -1
- package/build/keypair/Address.d.ts +0 -1
- package/build/keypair/Address.js +0 -1
- package/build/keypair/AddressVerificator.d.ts +0 -1
- package/build/keypair/AddressVerificator.js +0 -1
- package/build/keypair/EcKeyPair.d.ts +0 -1
- package/build/keypair/EcKeyPair.js +0 -1
- package/build/keypair/MessageSigner.d.ts +0 -1
- package/build/keypair/MessageSigner.js +0 -1
- package/build/keypair/Secp256k1PointDeriver.d.ts +0 -1
- package/build/keypair/Secp256k1PointDeriver.js +0 -1
- package/build/keypair/Wallet.d.ts +0 -1
- package/build/keypair/Wallet.js +0 -1
- package/build/keypair/interfaces/IWallet.d.ts +0 -1
- package/build/keypair/interfaces/IWallet.js +0 -1
- package/build/metadata/ContractBaseMetadata.d.ts +0 -1
- package/build/metadata/ContractBaseMetadata.js +0 -1
- package/build/mnemonic/BIPStandard.d.ts +0 -1
- package/build/mnemonic/BIPStandard.js +0 -1
- package/build/mnemonic/Mnemonic.d.ts +0 -1
- package/build/mnemonic/Mnemonic.js +0 -1
- package/build/mnemonic/MnemonicStrength.d.ts +0 -1
- package/build/mnemonic/MnemonicStrength.js +0 -1
- package/build/network/ChainId.d.ts +0 -1
- package/build/network/ChainId.js +0 -1
- package/build/opnet.d.ts +1 -1
- package/build/opnet.js +1 -1
- package/build/p2wda/P2WDADetector.d.ts +0 -1
- package/build/p2wda/P2WDADetector.js +0 -1
- package/build/polyfill/disposable.d.ts +0 -1
- package/build/polyfill/disposable.js +0 -1
- package/build/signer/AddressRotation.d.ts +0 -1
- package/build/signer/AddressRotation.js +0 -1
- package/build/signer/IRotationSigner.d.ts +0 -1
- package/build/signer/IRotationSigner.js +0 -1
- package/build/signer/ParallelSignerAdapter.d.ts +0 -1
- package/build/signer/ParallelSignerAdapter.js +0 -1
- package/build/signer/SignerUtils.d.ts +0 -1
- package/build/signer/SignerUtils.js +0 -1
- package/build/signer/TweakedSigner.d.ts +0 -1
- package/build/signer/TweakedSigner.js +0 -1
- package/build/transaction/ContractAddress.d.ts +0 -1
- package/build/transaction/ContractAddress.js +0 -1
- package/build/transaction/TransactionFactory.d.ts +0 -1
- package/build/transaction/TransactionFactory.js +1 -2
- package/build/transaction/browser/BrowserSignerBase.d.ts +0 -1
- package/build/transaction/browser/BrowserSignerBase.js +0 -1
- package/build/transaction/browser/WalletNetworks.d.ts +0 -1
- package/build/transaction/browser/WalletNetworks.js +0 -1
- package/build/transaction/browser/Web3Provider.d.ts +0 -1
- package/build/transaction/browser/Web3Provider.js +0 -1
- package/build/transaction/browser/extensions/UnisatSigner.d.ts +0 -1
- package/build/transaction/browser/extensions/UnisatSigner.js +0 -1
- package/build/transaction/browser/extensions/XverseSigner.d.ts +0 -1
- package/build/transaction/browser/extensions/XverseSigner.js +0 -1
- package/build/transaction/browser/types/OPWallet.d.ts +0 -1
- package/build/transaction/browser/types/OPWallet.js +0 -1
- package/build/transaction/browser/types/Unisat.d.ts +0 -1
- package/build/transaction/browser/types/Unisat.js +0 -1
- package/build/transaction/browser/types/Xverse.d.ts +0 -1
- package/build/transaction/browser/types/Xverse.js +0 -1
- package/build/transaction/builders/CancelTransaction.d.ts +0 -1
- package/build/transaction/builders/CancelTransaction.js +0 -1
- package/build/transaction/builders/ChallengeSolutionTransaction.d.ts +0 -1
- package/build/transaction/builders/ChallengeSolutionTransaction.js +0 -1
- package/build/transaction/builders/ConsolidatedInteractionTransaction.d.ts +0 -1
- package/build/transaction/builders/ConsolidatedInteractionTransaction.js +0 -1
- package/build/transaction/builders/CustomScriptTransaction.d.ts +0 -1
- package/build/transaction/builders/CustomScriptTransaction.js +0 -1
- package/build/transaction/builders/DeploymentTransaction.d.ts +0 -1
- package/build/transaction/builders/DeploymentTransaction.js +0 -1
- package/build/transaction/builders/FundingTransaction.d.ts +0 -1
- package/build/transaction/builders/FundingTransaction.js +17 -14
- package/build/transaction/builders/InteractionTransaction.d.ts +0 -1
- package/build/transaction/builders/InteractionTransaction.js +0 -1
- package/build/transaction/builders/InteractionTransactionP2WDA.d.ts +0 -1
- package/build/transaction/builders/InteractionTransactionP2WDA.js +0 -1
- package/build/transaction/builders/MultiSignTransaction.d.ts +0 -1
- package/build/transaction/builders/MultiSignTransaction.js +0 -1
- package/build/transaction/builders/SharedInteractionTransaction.d.ts +0 -1
- package/build/transaction/builders/SharedInteractionTransaction.js +0 -1
- package/build/transaction/builders/TransactionBuilder.d.ts +1 -1
- package/build/transaction/builders/TransactionBuilder.js +39 -8
- package/build/transaction/enums/TransactionType.d.ts +0 -1
- package/build/transaction/enums/TransactionType.js +0 -1
- package/build/transaction/interfaces/ICancelTransactionParameters.d.ts +0 -1
- package/build/transaction/interfaces/ICancelTransactionParameters.js +0 -1
- package/build/transaction/interfaces/IConsolidatedTransactionParameters.d.ts +0 -1
- package/build/transaction/interfaces/IConsolidatedTransactionParameters.js +0 -1
- package/build/transaction/interfaces/ICustomTransactionParameters.d.ts +0 -1
- package/build/transaction/interfaces/ICustomTransactionParameters.js +0 -1
- package/build/transaction/interfaces/ITransactionParameters.d.ts +0 -1
- package/build/transaction/interfaces/ITransactionParameters.js +0 -1
- package/build/transaction/interfaces/ITransactionResponses.d.ts +0 -1
- package/build/transaction/interfaces/ITransactionResponses.js +0 -1
- package/build/transaction/interfaces/ITweakedTransactionData.d.ts +0 -1
- package/build/transaction/interfaces/ITweakedTransactionData.js +0 -1
- package/build/transaction/interfaces/IWeb3ProviderTypes.d.ts +0 -1
- package/build/transaction/interfaces/IWeb3ProviderTypes.js +0 -1
- package/build/transaction/interfaces/Tap.d.ts +0 -1
- package/build/transaction/interfaces/Tap.js +0 -1
- package/build/transaction/mineable/CSVMultisigProvider.d.ts +102 -0
- package/build/transaction/mineable/CSVMultisigProvider.js +348 -0
- package/build/transaction/mineable/IP2WSHAddress.d.ts +0 -1
- package/build/transaction/mineable/IP2WSHAddress.js +0 -1
- package/build/transaction/mineable/TimelockGenerator.d.ts +0 -1
- package/build/transaction/mineable/TimelockGenerator.js +0 -1
- package/build/transaction/offline/OfflineTransactionManager.d.ts +50 -1
- package/build/transaction/offline/OfflineTransactionManager.js +142 -2
- package/build/transaction/offline/TransactionReconstructor.d.ts +0 -1
- package/build/transaction/offline/TransactionReconstructor.js +0 -1
- package/build/transaction/offline/TransactionSerializer.d.ts +0 -1
- package/build/transaction/offline/TransactionSerializer.js +9 -1
- package/build/transaction/offline/TransactionStateCapture.d.ts +0 -1
- package/build/transaction/offline/TransactionStateCapture.js +0 -1
- package/build/transaction/offline/interfaces/ISerializableState.d.ts +10 -3
- package/build/transaction/offline/interfaces/ISerializableState.js +3 -3
- package/build/transaction/offline/interfaces/ITypeSpecificData.d.ts +0 -1
- package/build/transaction/offline/interfaces/ITypeSpecificData.js +0 -1
- package/build/transaction/psbt/PSBTTypes.d.ts +0 -1
- package/build/transaction/psbt/PSBTTypes.js +0 -1
- package/build/transaction/shared/P2MR_MS.d.ts +0 -1
- package/build/transaction/shared/P2MR_MS.js +0 -1
- package/build/transaction/shared/P2TR_MS.d.ts +0 -1
- package/build/transaction/shared/P2TR_MS.js +0 -1
- package/build/transaction/shared/TweakedTransaction.d.ts +19 -1
- package/build/transaction/shared/TweakedTransaction.js +96 -12
- package/build/transaction/utils/WitnessUtils.d.ts +0 -1
- package/build/transaction/utils/WitnessUtils.js +0 -1
- package/build/utils/BitcoinUtils.d.ts +0 -1
- package/build/utils/BitcoinUtils.js +0 -1
- package/build/utils/BufferHelper.d.ts +0 -1
- package/build/utils/BufferHelper.js +0 -1
- package/build/utils/StringToBuffer.d.ts +0 -1
- package/build/utils/StringToBuffer.js +0 -1
- package/build/utils/lengths.d.ts +0 -1
- package/build/utils/lengths.js +0 -1
- package/build/utils/types.d.ts +0 -1
- package/build/utils/types.js +0 -1
- package/build/utxo/OPNetLimitedProvider.d.ts +0 -1
- package/build/utxo/OPNetLimitedProvider.js +0 -1
- package/build/utxo/interfaces/BroadcastResponse.d.ts +0 -1
- package/build/utxo/interfaces/BroadcastResponse.js +0 -1
- package/build/utxo/interfaces/IUTXO.d.ts +0 -1
- package/build/utxo/interfaces/IUTXO.js +0 -1
- package/build/verification/TapscriptVerificator.d.ts +0 -1
- package/build/verification/TapscriptVerificator.js +0 -1
- package/eslint.config.js +5 -0
- package/package.json +20 -17
- package/src/_version.ts +1 -1
- package/src/keypair/Address.ts +1 -1
- package/src/opnet.ts +1 -0
- package/src/transaction/TransactionFactory.ts +1 -1
- package/src/transaction/builders/FundingTransaction.ts +21 -16
- package/src/transaction/builders/TransactionBuilder.ts +56 -10
- package/src/transaction/mineable/CSVMultisigProvider.ts +465 -0
- package/src/transaction/offline/OfflineTransactionManager.ts +191 -1
- package/src/transaction/offline/TransactionSerializer.ts +11 -0
- package/src/transaction/offline/interfaces/ISerializableState.ts +10 -2
- package/src/transaction/shared/TweakedTransaction.ts +123 -10
- package/test/add-refund-output.test.ts +96 -11
- package/test/csv-multisig-offline-edges.test.ts +293 -0
- package/test/csv-multisig-offline.test.ts +202 -0
- package/test/csv-multisig-spend.test.ts +363 -0
- package/test/transaction-builders.test.ts +69 -3
- package/test/web3-provider-types.test.ts +349 -0
- package/test/zero-amount-funding.test.ts +311 -0
- package/tsconfig.base.json +2 -2
- package/tsconfig.build.json +4 -1
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +9 -3
- package/browser/_version.d.ts +0 -2
- package/browser/_version.d.ts.map +0 -1
- package/browser/abi/ABICoder.d.ts.map +0 -1
- package/browser/abi/ABIDataTypes.d.ts.map +0 -1
- package/browser/abi/AbiTypes.d.ts.map +0 -1
- package/browser/abi/TupleUtils.d.ts.map +0 -1
- package/browser/branded/Branded.d.ts.map +0 -1
- package/browser/buffer/BinaryReader.d.ts.map +0 -1
- package/browser/buffer/BinaryWriter.d.ts.map +0 -1
- package/browser/bytecode/Compressor.d.ts.map +0 -1
- package/browser/chain/ChainData.d.ts.map +0 -1
- package/browser/consensus/Consensus.d.ts.map +0 -1
- package/browser/consensus/ConsensusConfig.d.ts.map +0 -1
- package/browser/consensus/IConsensusConfig.d.ts.map +0 -1
- package/browser/consensus/metadata/RoswellConsensus.d.ts.map +0 -1
- package/browser/crypto/crypto.d.ts.map +0 -1
- package/browser/deterministic/AddressMap.d.ts.map +0 -1
- package/browser/deterministic/AddressSet.d.ts.map +0 -1
- package/browser/deterministic/CustomMap.d.ts.map +0 -1
- package/browser/deterministic/DeterministicMap.d.ts.map +0 -1
- package/browser/deterministic/DeterministicSet.d.ts.map +0 -1
- package/browser/deterministic/ExtendedAddressMap.d.ts.map +0 -1
- package/browser/deterministic/FastMap.d.ts.map +0 -1
- package/browser/ecc/backend.d.ts.map +0 -1
- package/browser/epoch/ChallengeSolution.d.ts.map +0 -1
- package/browser/epoch/interfaces/IChallengeSolution.d.ts.map +0 -1
- package/browser/epoch/validator/EpochValidator.d.ts.map +0 -1
- package/browser/event/NetEvent.d.ts.map +0 -1
- package/browser/generators/AddressGenerator.d.ts.map +0 -1
- package/browser/generators/Features.d.ts.map +0 -1
- package/browser/generators/Generator.d.ts.map +0 -1
- package/browser/generators/MLDSAData.d.ts.map +0 -1
- package/browser/generators/builders/CalldataGenerator.d.ts.map +0 -1
- package/browser/generators/builders/CustomGenerator.d.ts.map +0 -1
- package/browser/generators/builders/DeploymentGenerator.d.ts.map +0 -1
- package/browser/generators/builders/HashCommitmentGenerator.d.ts.map +0 -1
- package/browser/generators/builders/LegacyCalldataGenerator.d.ts.map +0 -1
- package/browser/generators/builders/MultiSignGenerator.d.ts.map +0 -1
- package/browser/generators/builders/P2WDAGenerator.d.ts.map +0 -1
- package/browser/index.d.ts.map +0 -1
- package/browser/keypair/Address.d.ts.map +0 -1
- package/browser/keypair/AddressVerificator.d.ts.map +0 -1
- package/browser/keypair/EcKeyPair.d.ts.map +0 -1
- package/browser/keypair/MessageSigner.d.ts.map +0 -1
- package/browser/keypair/Secp256k1PointDeriver.d.ts.map +0 -1
- package/browser/keypair/Wallet.d.ts.map +0 -1
- package/browser/keypair/interfaces/IWallet.d.ts.map +0 -1
- package/browser/metadata/ContractBaseMetadata.d.ts.map +0 -1
- package/browser/mnemonic/BIPStandard.d.ts.map +0 -1
- package/browser/mnemonic/Mnemonic.d.ts.map +0 -1
- package/browser/mnemonic/MnemonicStrength.d.ts.map +0 -1
- package/browser/network/ChainId.d.ts.map +0 -1
- package/browser/opnet.d.ts.map +0 -1
- package/browser/p2wda/P2WDADetector.d.ts.map +0 -1
- package/browser/polyfill/disposable.d.ts.map +0 -1
- package/browser/signer/AddressRotation.d.ts.map +0 -1
- package/browser/signer/IRotationSigner.d.ts.map +0 -1
- package/browser/signer/ParallelSignerAdapter.d.ts.map +0 -1
- package/browser/signer/SignerUtils.d.ts.map +0 -1
- package/browser/signer/TweakedSigner.d.ts.map +0 -1
- package/browser/transaction/ContractAddress.d.ts.map +0 -1
- package/browser/transaction/TransactionFactory.d.ts.map +0 -1
- package/browser/transaction/browser/BrowserSignerBase.d.ts.map +0 -1
- package/browser/transaction/browser/WalletNetworks.d.ts.map +0 -1
- package/browser/transaction/browser/Web3Provider.d.ts.map +0 -1
- package/browser/transaction/browser/extensions/UnisatSigner.d.ts.map +0 -1
- package/browser/transaction/browser/extensions/XverseSigner.d.ts.map +0 -1
- package/browser/transaction/browser/types/OPWallet.d.ts.map +0 -1
- package/browser/transaction/browser/types/Unisat.d.ts.map +0 -1
- package/browser/transaction/browser/types/Xverse.d.ts.map +0 -1
- package/browser/transaction/builders/CancelTransaction.d.ts.map +0 -1
- package/browser/transaction/builders/ChallengeSolutionTransaction.d.ts +0 -2
- package/browser/transaction/builders/ChallengeSolutionTransaction.d.ts.map +0 -1
- package/browser/transaction/builders/ConsolidatedInteractionTransaction.d.ts.map +0 -1
- package/browser/transaction/builders/CustomScriptTransaction.d.ts.map +0 -1
- package/browser/transaction/builders/DeploymentTransaction.d.ts.map +0 -1
- package/browser/transaction/builders/FundingTransaction.d.ts.map +0 -1
- package/browser/transaction/builders/InteractionTransaction.d.ts.map +0 -1
- package/browser/transaction/builders/InteractionTransactionP2WDA.d.ts.map +0 -1
- package/browser/transaction/builders/MultiSignTransaction.d.ts.map +0 -1
- package/browser/transaction/builders/SharedInteractionTransaction.d.ts.map +0 -1
- package/browser/transaction/builders/TransactionBuilder.d.ts.map +0 -1
- package/browser/transaction/enums/TransactionType.d.ts.map +0 -1
- package/browser/transaction/interfaces/ICancelTransactionParameters.d.ts.map +0 -1
- package/browser/transaction/interfaces/IConsolidatedTransactionParameters.d.ts.map +0 -1
- package/browser/transaction/interfaces/ICustomTransactionParameters.d.ts.map +0 -1
- package/browser/transaction/interfaces/ITransactionParameters.d.ts.map +0 -1
- package/browser/transaction/interfaces/ITransactionResponses.d.ts.map +0 -1
- package/browser/transaction/interfaces/ITweakedTransactionData.d.ts.map +0 -1
- package/browser/transaction/interfaces/IWeb3ProviderTypes.d.ts.map +0 -1
- package/browser/transaction/interfaces/Tap.d.ts.map +0 -1
- package/browser/transaction/mineable/IP2WSHAddress.d.ts.map +0 -1
- package/browser/transaction/mineable/TimelockGenerator.d.ts.map +0 -1
- package/browser/transaction/offline/OfflineTransactionManager.d.ts.map +0 -1
- package/browser/transaction/offline/TransactionReconstructor.d.ts.map +0 -1
- package/browser/transaction/offline/TransactionSerializer.d.ts.map +0 -1
- package/browser/transaction/offline/TransactionStateCapture.d.ts.map +0 -1
- package/browser/transaction/offline/interfaces/ISerializableState.d.ts.map +0 -1
- package/browser/transaction/offline/interfaces/ITypeSpecificData.d.ts.map +0 -1
- package/browser/transaction/psbt/PSBTTypes.d.ts.map +0 -1
- package/browser/transaction/shared/P2MR_MS.d.ts.map +0 -1
- package/browser/transaction/shared/P2TR_MS.d.ts.map +0 -1
- package/browser/transaction/shared/TweakedTransaction.d.ts.map +0 -1
- package/browser/transaction/utils/WitnessUtils.d.ts.map +0 -1
- package/browser/utils/BitcoinUtils.d.ts.map +0 -1
- package/browser/utils/BufferHelper.d.ts.map +0 -1
- package/browser/utils/StringToBuffer.d.ts.map +0 -1
- package/browser/utils/lengths.d.ts.map +0 -1
- package/browser/utils/types.d.ts.map +0 -1
- package/browser/utxo/OPNetLimitedProvider.d.ts.map +0 -1
- package/browser/utxo/interfaces/BroadcastResponse.d.ts.map +0 -1
- package/browser/utxo/interfaces/IUTXO.d.ts.map +0 -1
- package/browser/verification/TapscriptVerificator.d.ts.map +0 -1
- package/build/_version.d.ts.map +0 -1
- package/build/_version.js.map +0 -1
- package/build/abi/ABICoder.d.ts.map +0 -1
- package/build/abi/ABICoder.js.map +0 -1
- package/build/abi/ABIDataTypes.d.ts.map +0 -1
- package/build/abi/ABIDataTypes.js.map +0 -1
- package/build/abi/AbiTypes.d.ts.map +0 -1
- package/build/abi/AbiTypes.js.map +0 -1
- package/build/abi/TupleUtils.d.ts.map +0 -1
- package/build/abi/TupleUtils.js.map +0 -1
- package/build/branded/Branded.d.ts.map +0 -1
- package/build/branded/Branded.js.map +0 -1
- package/build/buffer/BinaryReader.d.ts.map +0 -1
- package/build/buffer/BinaryReader.js.map +0 -1
- package/build/buffer/BinaryWriter.d.ts.map +0 -1
- package/build/buffer/BinaryWriter.js.map +0 -1
- package/build/bytecode/Compressor.d.ts.map +0 -1
- package/build/bytecode/Compressor.js.map +0 -1
- package/build/chain/ChainData.d.ts.map +0 -1
- package/build/chain/ChainData.js.map +0 -1
- package/build/consensus/Consensus.d.ts.map +0 -1
- package/build/consensus/Consensus.js.map +0 -1
- package/build/consensus/ConsensusConfig.d.ts.map +0 -1
- package/build/consensus/ConsensusConfig.js.map +0 -1
- package/build/consensus/IConsensusConfig.d.ts.map +0 -1
- package/build/consensus/IConsensusConfig.js.map +0 -1
- package/build/consensus/metadata/RoswellConsensus.d.ts.map +0 -1
- package/build/consensus/metadata/RoswellConsensus.js.map +0 -1
- package/build/crypto/crypto.d.ts.map +0 -1
- package/build/crypto/crypto.js.map +0 -1
- package/build/deterministic/AddressMap.d.ts.map +0 -1
- package/build/deterministic/AddressMap.js.map +0 -1
- package/build/deterministic/AddressSet.d.ts.map +0 -1
- package/build/deterministic/AddressSet.js.map +0 -1
- package/build/deterministic/CustomMap.d.ts.map +0 -1
- package/build/deterministic/CustomMap.js.map +0 -1
- package/build/deterministic/DeterministicMap.d.ts.map +0 -1
- package/build/deterministic/DeterministicMap.js.map +0 -1
- package/build/deterministic/DeterministicSet.d.ts.map +0 -1
- package/build/deterministic/DeterministicSet.js.map +0 -1
- package/build/deterministic/ExtendedAddressMap.d.ts.map +0 -1
- package/build/deterministic/ExtendedAddressMap.js.map +0 -1
- package/build/deterministic/FastMap.d.ts.map +0 -1
- package/build/deterministic/FastMap.js.map +0 -1
- package/build/ecc/backend.d.ts.map +0 -1
- package/build/ecc/backend.js.map +0 -1
- package/build/epoch/ChallengeSolution.d.ts.map +0 -1
- package/build/epoch/ChallengeSolution.js.map +0 -1
- package/build/epoch/interfaces/IChallengeSolution.d.ts.map +0 -1
- package/build/epoch/interfaces/IChallengeSolution.js.map +0 -1
- package/build/epoch/validator/EpochValidator.d.ts.map +0 -1
- package/build/epoch/validator/EpochValidator.js.map +0 -1
- package/build/event/NetEvent.d.ts.map +0 -1
- package/build/event/NetEvent.js.map +0 -1
- package/build/generators/AddressGenerator.d.ts.map +0 -1
- package/build/generators/AddressGenerator.js.map +0 -1
- package/build/generators/Features.d.ts.map +0 -1
- package/build/generators/Features.js.map +0 -1
- package/build/generators/Generator.d.ts.map +0 -1
- package/build/generators/Generator.js.map +0 -1
- package/build/generators/MLDSAData.d.ts.map +0 -1
- package/build/generators/MLDSAData.js.map +0 -1
- package/build/generators/builders/CalldataGenerator.d.ts.map +0 -1
- package/build/generators/builders/CalldataGenerator.js.map +0 -1
- package/build/generators/builders/CustomGenerator.d.ts.map +0 -1
- package/build/generators/builders/CustomGenerator.js.map +0 -1
- package/build/generators/builders/DeploymentGenerator.d.ts.map +0 -1
- package/build/generators/builders/DeploymentGenerator.js.map +0 -1
- package/build/generators/builders/HashCommitmentGenerator.d.ts.map +0 -1
- package/build/generators/builders/HashCommitmentGenerator.js.map +0 -1
- package/build/generators/builders/LegacyCalldataGenerator.d.ts.map +0 -1
- package/build/generators/builders/LegacyCalldataGenerator.js.map +0 -1
- package/build/generators/builders/MultiSignGenerator.d.ts.map +0 -1
- package/build/generators/builders/MultiSignGenerator.js.map +0 -1
- package/build/generators/builders/P2WDAGenerator.d.ts.map +0 -1
- package/build/generators/builders/P2WDAGenerator.js.map +0 -1
- package/build/index.d.ts.map +0 -1
- package/build/index.js.map +0 -1
- package/build/keypair/Address.d.ts.map +0 -1
- package/build/keypair/Address.js.map +0 -1
- package/build/keypair/AddressVerificator.d.ts.map +0 -1
- package/build/keypair/AddressVerificator.js.map +0 -1
- package/build/keypair/EcKeyPair.d.ts.map +0 -1
- package/build/keypair/EcKeyPair.js.map +0 -1
- package/build/keypair/MessageSigner.d.ts.map +0 -1
- package/build/keypair/MessageSigner.js.map +0 -1
- package/build/keypair/Secp256k1PointDeriver.d.ts.map +0 -1
- package/build/keypair/Secp256k1PointDeriver.js.map +0 -1
- package/build/keypair/Wallet.d.ts.map +0 -1
- package/build/keypair/Wallet.js.map +0 -1
- package/build/keypair/interfaces/IWallet.d.ts.map +0 -1
- package/build/keypair/interfaces/IWallet.js.map +0 -1
- package/build/metadata/ContractBaseMetadata.d.ts.map +0 -1
- package/build/metadata/ContractBaseMetadata.js.map +0 -1
- package/build/mnemonic/BIPStandard.d.ts.map +0 -1
- package/build/mnemonic/BIPStandard.js.map +0 -1
- package/build/mnemonic/Mnemonic.d.ts.map +0 -1
- package/build/mnemonic/Mnemonic.js.map +0 -1
- package/build/mnemonic/MnemonicStrength.d.ts.map +0 -1
- package/build/mnemonic/MnemonicStrength.js.map +0 -1
- package/build/network/ChainId.d.ts.map +0 -1
- package/build/network/ChainId.js.map +0 -1
- package/build/opnet.d.ts.map +0 -1
- package/build/opnet.js.map +0 -1
- package/build/p2wda/P2WDADetector.d.ts.map +0 -1
- package/build/p2wda/P2WDADetector.js.map +0 -1
- package/build/polyfill/disposable.d.ts.map +0 -1
- package/build/polyfill/disposable.js.map +0 -1
- package/build/signer/AddressRotation.d.ts.map +0 -1
- package/build/signer/AddressRotation.js.map +0 -1
- package/build/signer/IRotationSigner.d.ts.map +0 -1
- package/build/signer/IRotationSigner.js.map +0 -1
- package/build/signer/ParallelSignerAdapter.d.ts.map +0 -1
- package/build/signer/ParallelSignerAdapter.js.map +0 -1
- package/build/signer/SignerUtils.d.ts.map +0 -1
- package/build/signer/SignerUtils.js.map +0 -1
- package/build/signer/TweakedSigner.d.ts.map +0 -1
- package/build/signer/TweakedSigner.js.map +0 -1
- package/build/transaction/ContractAddress.d.ts.map +0 -1
- package/build/transaction/ContractAddress.js.map +0 -1
- package/build/transaction/TransactionFactory.d.ts.map +0 -1
- package/build/transaction/TransactionFactory.js.map +0 -1
- package/build/transaction/browser/BrowserSignerBase.d.ts.map +0 -1
- package/build/transaction/browser/BrowserSignerBase.js.map +0 -1
- package/build/transaction/browser/WalletNetworks.d.ts.map +0 -1
- package/build/transaction/browser/WalletNetworks.js.map +0 -1
- package/build/transaction/browser/Web3Provider.d.ts.map +0 -1
- package/build/transaction/browser/Web3Provider.js.map +0 -1
- package/build/transaction/browser/extensions/UnisatSigner.d.ts.map +0 -1
- package/build/transaction/browser/extensions/UnisatSigner.js.map +0 -1
- package/build/transaction/browser/extensions/XverseSigner.d.ts.map +0 -1
- package/build/transaction/browser/extensions/XverseSigner.js.map +0 -1
- package/build/transaction/browser/types/OPWallet.d.ts.map +0 -1
- package/build/transaction/browser/types/OPWallet.js.map +0 -1
- package/build/transaction/browser/types/Unisat.d.ts.map +0 -1
- package/build/transaction/browser/types/Unisat.js.map +0 -1
- package/build/transaction/browser/types/Xverse.d.ts.map +0 -1
- package/build/transaction/browser/types/Xverse.js.map +0 -1
- package/build/transaction/builders/CancelTransaction.d.ts.map +0 -1
- package/build/transaction/builders/CancelTransaction.js.map +0 -1
- package/build/transaction/builders/ChallengeSolutionTransaction.d.ts.map +0 -1
- package/build/transaction/builders/ChallengeSolutionTransaction.js.map +0 -1
- package/build/transaction/builders/ConsolidatedInteractionTransaction.d.ts.map +0 -1
- package/build/transaction/builders/ConsolidatedInteractionTransaction.js.map +0 -1
- package/build/transaction/builders/CustomScriptTransaction.d.ts.map +0 -1
- package/build/transaction/builders/CustomScriptTransaction.js.map +0 -1
- package/build/transaction/builders/DeploymentTransaction.d.ts.map +0 -1
- package/build/transaction/builders/DeploymentTransaction.js.map +0 -1
- package/build/transaction/builders/FundingTransaction.d.ts.map +0 -1
- package/build/transaction/builders/FundingTransaction.js.map +0 -1
- package/build/transaction/builders/InteractionTransaction.d.ts.map +0 -1
- package/build/transaction/builders/InteractionTransaction.js.map +0 -1
- package/build/transaction/builders/InteractionTransactionP2WDA.d.ts.map +0 -1
- package/build/transaction/builders/InteractionTransactionP2WDA.js.map +0 -1
- package/build/transaction/builders/MultiSignTransaction.d.ts.map +0 -1
- package/build/transaction/builders/MultiSignTransaction.js.map +0 -1
- package/build/transaction/builders/SharedInteractionTransaction.d.ts.map +0 -1
- package/build/transaction/builders/SharedInteractionTransaction.js.map +0 -1
- package/build/transaction/builders/TransactionBuilder.d.ts.map +0 -1
- package/build/transaction/builders/TransactionBuilder.js.map +0 -1
- package/build/transaction/enums/TransactionType.d.ts.map +0 -1
- package/build/transaction/enums/TransactionType.js.map +0 -1
- package/build/transaction/interfaces/ICancelTransactionParameters.d.ts.map +0 -1
- package/build/transaction/interfaces/ICancelTransactionParameters.js.map +0 -1
- package/build/transaction/interfaces/IConsolidatedTransactionParameters.d.ts.map +0 -1
- package/build/transaction/interfaces/IConsolidatedTransactionParameters.js.map +0 -1
- package/build/transaction/interfaces/ICustomTransactionParameters.d.ts.map +0 -1
- package/build/transaction/interfaces/ICustomTransactionParameters.js.map +0 -1
- package/build/transaction/interfaces/ITransactionParameters.d.ts.map +0 -1
- package/build/transaction/interfaces/ITransactionParameters.js.map +0 -1
- package/build/transaction/interfaces/ITransactionResponses.d.ts.map +0 -1
- package/build/transaction/interfaces/ITransactionResponses.js.map +0 -1
- package/build/transaction/interfaces/ITweakedTransactionData.d.ts.map +0 -1
- package/build/transaction/interfaces/ITweakedTransactionData.js.map +0 -1
- package/build/transaction/interfaces/IWeb3ProviderTypes.d.ts.map +0 -1
- package/build/transaction/interfaces/IWeb3ProviderTypes.js.map +0 -1
- package/build/transaction/interfaces/Tap.d.ts.map +0 -1
- package/build/transaction/interfaces/Tap.js.map +0 -1
- package/build/transaction/mineable/IP2WSHAddress.d.ts.map +0 -1
- package/build/transaction/mineable/IP2WSHAddress.js.map +0 -1
- package/build/transaction/mineable/TimelockGenerator.d.ts.map +0 -1
- package/build/transaction/mineable/TimelockGenerator.js.map +0 -1
- package/build/transaction/offline/OfflineTransactionManager.d.ts.map +0 -1
- package/build/transaction/offline/OfflineTransactionManager.js.map +0 -1
- package/build/transaction/offline/TransactionReconstructor.d.ts.map +0 -1
- package/build/transaction/offline/TransactionReconstructor.js.map +0 -1
- package/build/transaction/offline/TransactionSerializer.d.ts.map +0 -1
- package/build/transaction/offline/TransactionSerializer.js.map +0 -1
- package/build/transaction/offline/TransactionStateCapture.d.ts.map +0 -1
- package/build/transaction/offline/TransactionStateCapture.js.map +0 -1
- package/build/transaction/offline/interfaces/ISerializableState.d.ts.map +0 -1
- package/build/transaction/offline/interfaces/ISerializableState.js.map +0 -1
- package/build/transaction/offline/interfaces/ITypeSpecificData.d.ts.map +0 -1
- package/build/transaction/offline/interfaces/ITypeSpecificData.js.map +0 -1
- package/build/transaction/psbt/PSBTTypes.d.ts.map +0 -1
- package/build/transaction/psbt/PSBTTypes.js.map +0 -1
- package/build/transaction/shared/P2MR_MS.d.ts.map +0 -1
- package/build/transaction/shared/P2MR_MS.js.map +0 -1
- package/build/transaction/shared/P2TR_MS.d.ts.map +0 -1
- package/build/transaction/shared/P2TR_MS.js.map +0 -1
- package/build/transaction/shared/TweakedTransaction.d.ts.map +0 -1
- package/build/transaction/shared/TweakedTransaction.js.map +0 -1
- package/build/transaction/utils/WitnessUtils.d.ts.map +0 -1
- package/build/transaction/utils/WitnessUtils.js.map +0 -1
- package/build/tsconfig.build.tsbuildinfo +0 -1
- package/build/utils/BitcoinUtils.d.ts.map +0 -1
- package/build/utils/BitcoinUtils.js.map +0 -1
- package/build/utils/BufferHelper.d.ts.map +0 -1
- package/build/utils/BufferHelper.js.map +0 -1
- package/build/utils/StringToBuffer.d.ts.map +0 -1
- package/build/utils/StringToBuffer.js.map +0 -1
- package/build/utils/lengths.d.ts.map +0 -1
- package/build/utils/lengths.js.map +0 -1
- package/build/utils/types.d.ts.map +0 -1
- package/build/utils/types.js.map +0 -1
- package/build/utxo/OPNetLimitedProvider.d.ts.map +0 -1
- package/build/utxo/OPNetLimitedProvider.js.map +0 -1
- package/build/utxo/interfaces/BroadcastResponse.d.ts.map +0 -1
- package/build/utxo/interfaces/BroadcastResponse.js.map +0 -1
- package/build/utxo/interfaces/IUTXO.d.ts.map +0 -1
- package/build/utxo/interfaces/IUTXO.js.map +0 -1
- package/build/verification/TapscriptVerificator.d.ts.map +0 -1
- package/build/verification/TapscriptVerificator.js.map +0 -1
package/browser/noble-curves.js
CHANGED
|
@@ -1,114 +1,115 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
function
|
|
3
|
-
return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
|
|
1
|
+
import { n as dt, r as Ze } from "./rolldown-runtime.js";
|
|
2
|
+
function Ce(t) {
|
|
3
|
+
return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in t && t.BYTES_PER_ELEMENT === 1;
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function Et(t, e = "") {
|
|
6
|
+
if (typeof t != "number") {
|
|
7
|
+
const r = e && `"${e}" `;
|
|
8
|
+
throw new TypeError(`${r}expected number, got ${typeof t}`);
|
|
9
|
+
}
|
|
6
10
|
if (!Number.isSafeInteger(t) || t < 0) {
|
|
7
11
|
const r = e && `"${e}" `;
|
|
8
|
-
throw new
|
|
12
|
+
throw new RangeError(`${r}expected integer >= 0, got ${t}`);
|
|
9
13
|
}
|
|
10
14
|
}
|
|
11
|
-
function
|
|
12
|
-
const n =
|
|
13
|
-
if (!n ||
|
|
14
|
-
const
|
|
15
|
-
throw new
|
|
15
|
+
function mt(t, e, r = "") {
|
|
16
|
+
const n = Ce(t), o = t?.length, i = e !== void 0;
|
|
17
|
+
if (!n || i && o !== e) {
|
|
18
|
+
const c = r && `"${r}" `, s = i ? ` of length ${e}` : "", a = n ? `length=${o}` : `type=${typeof t}`, u = c + "expected Uint8Array" + s + ", got " + a;
|
|
19
|
+
throw n ? new RangeError(u) : new TypeError(u);
|
|
16
20
|
}
|
|
17
21
|
return t;
|
|
18
22
|
}
|
|
19
|
-
function
|
|
20
|
-
if (typeof t != "function" || typeof t.create != "function") throw new
|
|
21
|
-
|
|
23
|
+
function ke(t) {
|
|
24
|
+
if (typeof t != "function" || typeof t.create != "function") throw new TypeError("Hash must wrapped by utils.createHasher");
|
|
25
|
+
if (Et(t.outputLen), Et(t.blockLen), t.outputLen < 1) throw new Error('"outputLen" must be >= 1');
|
|
26
|
+
if (t.blockLen < 1) throw new Error('"blockLen" must be >= 1');
|
|
22
27
|
}
|
|
23
|
-
function
|
|
28
|
+
function Dt(t, e = !0) {
|
|
24
29
|
if (t.destroyed) throw new Error("Hash instance has been destroyed");
|
|
25
30
|
if (e && t.finished) throw new Error("Hash#digest() has already been called");
|
|
26
31
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
32
|
+
function je(t, e) {
|
|
33
|
+
mt(t, void 0, "digestInto() output");
|
|
29
34
|
const r = e.outputLen;
|
|
30
|
-
if (t.length < r) throw new
|
|
35
|
+
if (t.length < r) throw new RangeError('"digestInto() output" expected to be of length >=' + r);
|
|
31
36
|
}
|
|
32
|
-
function
|
|
33
|
-
return new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
|
|
34
|
-
}
|
|
35
|
-
function At(...t) {
|
|
37
|
+
function Bt(...t) {
|
|
36
38
|
for (let e = 0; e < t.length; e++) t[e].fill(0);
|
|
37
39
|
}
|
|
38
|
-
function
|
|
40
|
+
function Vt(t) {
|
|
39
41
|
return new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
40
42
|
}
|
|
41
|
-
function
|
|
43
|
+
function nt(t, e) {
|
|
42
44
|
return t << 32 - e | t >>> e;
|
|
43
45
|
}
|
|
44
|
-
function
|
|
46
|
+
function vr(t, e) {
|
|
45
47
|
return t << e | t >>> 32 - e >>> 0;
|
|
46
48
|
}
|
|
47
|
-
function
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
function Hn(t) {
|
|
51
|
-
for (let e = 0; e < t.length; e++) t[e] = On(t[e]);
|
|
52
|
-
return t;
|
|
53
|
-
}
|
|
54
|
-
function Xt(t) {
|
|
55
|
-
if (C(t), pe) return t.toHex();
|
|
49
|
+
function le(t) {
|
|
50
|
+
if (mt(t), he) return t.toHex();
|
|
56
51
|
let e = "";
|
|
57
|
-
for (let r = 0; r < t.length; r++) e +=
|
|
52
|
+
for (let r = 0; r < t.length; r++) e += Ye[t[r]];
|
|
58
53
|
return e;
|
|
59
54
|
}
|
|
60
|
-
function
|
|
61
|
-
if (t >=
|
|
62
|
-
if (t >=
|
|
63
|
-
if (t >=
|
|
55
|
+
function Ae(t) {
|
|
56
|
+
if (t >= rt._0 && t <= rt._9) return t - rt._0;
|
|
57
|
+
if (t >= rt.A && t <= rt.F) return t - (rt.A - 10);
|
|
58
|
+
if (t >= rt.a && t <= rt.f) return t - (rt.a - 10);
|
|
64
59
|
}
|
|
65
|
-
function
|
|
66
|
-
if (typeof t != "string") throw new
|
|
67
|
-
if (
|
|
60
|
+
function Ve(t) {
|
|
61
|
+
if (typeof t != "string") throw new TypeError("hex string expected, got " + typeof t);
|
|
62
|
+
if (he) try {
|
|
63
|
+
return Uint8Array.fromHex(t);
|
|
64
|
+
} catch (o) {
|
|
65
|
+
throw o instanceof SyntaxError ? new RangeError(o.message) : o;
|
|
66
|
+
}
|
|
68
67
|
const e = t.length, r = e / 2;
|
|
69
|
-
if (e % 2) throw new
|
|
68
|
+
if (e % 2) throw new RangeError("hex string expected, got unpadded hex of length " + e);
|
|
70
69
|
const n = new Uint8Array(r);
|
|
71
|
-
for (let o = 0,
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
const
|
|
75
|
-
throw new
|
|
70
|
+
for (let o = 0, i = 0; o < r; o++, i += 2) {
|
|
71
|
+
const c = Ae(t.charCodeAt(i)), s = Ae(t.charCodeAt(i + 1));
|
|
72
|
+
if (c === void 0 || s === void 0) {
|
|
73
|
+
const a = t[i] + t[i + 1];
|
|
74
|
+
throw new RangeError('hex string expected, got non-hex character "' + a + '" at index ' + i);
|
|
76
75
|
}
|
|
77
|
-
n[o] =
|
|
76
|
+
n[o] = c * 16 + s;
|
|
78
77
|
}
|
|
79
78
|
return n;
|
|
80
79
|
}
|
|
81
|
-
function
|
|
80
|
+
function In(...t) {
|
|
82
81
|
let e = 0;
|
|
83
82
|
for (let n = 0; n < t.length; n++) {
|
|
84
83
|
const o = t[n];
|
|
85
|
-
|
|
84
|
+
mt(o), e += o.length;
|
|
86
85
|
}
|
|
87
86
|
const r = new Uint8Array(e);
|
|
88
87
|
for (let n = 0, o = 0; n < t.length; n++) {
|
|
89
|
-
const
|
|
90
|
-
r.set(
|
|
88
|
+
const i = t[n];
|
|
89
|
+
r.set(i, o), o += i.length;
|
|
91
90
|
}
|
|
92
91
|
return r;
|
|
93
92
|
}
|
|
94
|
-
function
|
|
95
|
-
const r = (o,
|
|
96
|
-
return r.outputLen = n.outputLen, r.blockLen = n.blockLen, r.create = (o) => t(o), Object.assign(r, e), Object.freeze(r);
|
|
93
|
+
function xt(t, e = {}) {
|
|
94
|
+
const r = (o, i) => t(i).update(o).digest(), n = t(void 0);
|
|
95
|
+
return r.outputLen = n.outputLen, r.blockLen = n.blockLen, r.canXOF = n.canXOF, r.create = (o) => t(o), Object.assign(r, e), Object.freeze(r);
|
|
97
96
|
}
|
|
98
|
-
function
|
|
97
|
+
function Fn(t = 32) {
|
|
98
|
+
Et(t, "bytesLength");
|
|
99
99
|
const e = typeof globalThis == "object" ? globalThis.crypto : null;
|
|
100
100
|
if (typeof e?.getRandomValues != "function") throw new Error("crypto.getRandomValues must be defined");
|
|
101
|
+
if (t > 65536) throw new RangeError(`"bytesLength" expected <= 65536, got ${t}`);
|
|
101
102
|
return e.getRandomValues(new Uint8Array(t));
|
|
102
103
|
}
|
|
103
|
-
var
|
|
104
|
-
|
|
104
|
+
var he, Ye, rt, gt, It = dt((() => {
|
|
105
|
+
he = typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", Ye = /* @__PURE__ */ Array.from({ length: 256 }, (t, e) => e.toString(16).padStart(2, "0")), rt = {
|
|
105
106
|
_0: 48,
|
|
106
107
|
_9: 57,
|
|
107
108
|
A: 65,
|
|
108
109
|
F: 70,
|
|
109
110
|
a: 97,
|
|
110
111
|
f: 102
|
|
111
|
-
},
|
|
112
|
+
}, gt = (t) => ({ oid: Uint8Array.from([
|
|
112
113
|
6,
|
|
113
114
|
9,
|
|
114
115
|
96,
|
|
@@ -121,32 +122,35 @@ var He, In, pe, Ke, it, mt, Nt = Bt((() => {
|
|
|
121
122
|
2,
|
|
122
123
|
t
|
|
123
124
|
]) });
|
|
124
|
-
})),
|
|
125
|
-
_HMAC: () =>
|
|
126
|
-
hmac: () =>
|
|
127
|
-
}),
|
|
128
|
-
|
|
125
|
+
})), xr = /* @__PURE__ */ Ze({
|
|
126
|
+
_HMAC: () => Ut,
|
|
127
|
+
hmac: () => de
|
|
128
|
+
}), Ut, de, Ln = dt((() => {
|
|
129
|
+
It(), Ut = class {
|
|
129
130
|
oHash;
|
|
130
131
|
iHash;
|
|
131
132
|
blockLen;
|
|
132
133
|
outputLen;
|
|
134
|
+
canXOF = !1;
|
|
133
135
|
finished = !1;
|
|
134
136
|
destroyed = !1;
|
|
135
137
|
constructor(t, e) {
|
|
136
|
-
if (
|
|
138
|
+
if (ke(t), mt(e, void 0, "key"), this.iHash = t.create(), typeof this.iHash.update != "function") throw new Error("Expected instance of class which extends utils.Hash");
|
|
137
139
|
this.blockLen = this.iHash.blockLen, this.outputLen = this.iHash.outputLen;
|
|
138
140
|
const r = this.blockLen, n = new Uint8Array(r);
|
|
139
141
|
n.set(e.length > r ? t.create().update(e).digest() : e);
|
|
140
142
|
for (let o = 0; o < n.length; o++) n[o] ^= 54;
|
|
141
143
|
this.iHash.update(n), this.oHash = t.create();
|
|
142
144
|
for (let o = 0; o < n.length; o++) n[o] ^= 106;
|
|
143
|
-
this.oHash.update(n),
|
|
145
|
+
this.oHash.update(n), Bt(n);
|
|
144
146
|
}
|
|
145
147
|
update(t) {
|
|
146
|
-
return
|
|
148
|
+
return Dt(this), this.iHash.update(t), this;
|
|
147
149
|
}
|
|
148
150
|
digestInto(t) {
|
|
149
|
-
|
|
151
|
+
Dt(this), je(t, this), this.finished = !0;
|
|
152
|
+
const e = t.subarray(0, this.outputLen);
|
|
153
|
+
this.iHash.digestInto(e), this.oHash.update(e), this.oHash.digestInto(e), this.destroy();
|
|
150
154
|
}
|
|
151
155
|
digest() {
|
|
152
156
|
const t = new Uint8Array(this.oHash.outputLen);
|
|
@@ -154,8 +158,8 @@ var He, In, pe, Ke, it, mt, Nt = Bt((() => {
|
|
|
154
158
|
}
|
|
155
159
|
_cloneInto(t) {
|
|
156
160
|
t ||= Object.create(Object.getPrototypeOf(this), {});
|
|
157
|
-
const { oHash: e, iHash: r, finished: n, destroyed: o, blockLen:
|
|
158
|
-
return t = t, t.finished = n, t.destroyed = o, t.blockLen =
|
|
161
|
+
const { oHash: e, iHash: r, finished: n, destroyed: o, blockLen: i, outputLen: c } = this;
|
|
162
|
+
return t = t, t.finished = n, t.destroyed = o, t.blockLen = i, t.outputLen = c, t.oHash = e._cloneInto(t.oHash), t.iHash = r._cloneInto(t.iHash), t;
|
|
159
163
|
}
|
|
160
164
|
clone() {
|
|
161
165
|
return this._cloneInto();
|
|
@@ -163,18 +167,22 @@ var He, In, pe, Ke, it, mt, Nt = Bt((() => {
|
|
|
163
167
|
destroy() {
|
|
164
168
|
this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
|
|
165
169
|
}
|
|
166
|
-
},
|
|
170
|
+
}, de = /* @__PURE__ */ (() => {
|
|
171
|
+
const t = ((e, r, n) => new Ut(e, r).update(n).digest());
|
|
172
|
+
return t.create = (e, r) => new Ut(e, r), t;
|
|
173
|
+
})();
|
|
167
174
|
}));
|
|
168
|
-
function
|
|
175
|
+
function Nn(t, e, r) {
|
|
169
176
|
return t & e ^ ~t & r;
|
|
170
177
|
}
|
|
171
|
-
function
|
|
178
|
+
function Tn(t, e, r) {
|
|
172
179
|
return t & e ^ t & r ^ e & r;
|
|
173
180
|
}
|
|
174
|
-
var
|
|
175
|
-
|
|
181
|
+
var Wt, at, ut, M, G, Un = dt((() => {
|
|
182
|
+
It(), Wt = class {
|
|
176
183
|
blockLen;
|
|
177
184
|
outputLen;
|
|
185
|
+
canXOF = !1;
|
|
178
186
|
padOffset;
|
|
179
187
|
isLE;
|
|
180
188
|
buffer;
|
|
@@ -184,34 +192,34 @@ var ae, dt, ht, K, X, Nn = Bt((() => {
|
|
|
184
192
|
pos = 0;
|
|
185
193
|
destroyed = !1;
|
|
186
194
|
constructor(t, e, r, n) {
|
|
187
|
-
this.blockLen = t, this.outputLen = e, this.padOffset = r, this.isLE = n, this.buffer = new Uint8Array(t), this.view =
|
|
195
|
+
this.blockLen = t, this.outputLen = e, this.padOffset = r, this.isLE = n, this.buffer = new Uint8Array(t), this.view = Vt(this.buffer);
|
|
188
196
|
}
|
|
189
197
|
update(t) {
|
|
190
|
-
|
|
198
|
+
Dt(this), mt(t);
|
|
191
199
|
const { view: e, buffer: r, blockLen: n } = this, o = t.length;
|
|
192
|
-
for (let
|
|
193
|
-
const
|
|
194
|
-
if (
|
|
195
|
-
const
|
|
196
|
-
for (; n <= o -
|
|
200
|
+
for (let i = 0; i < o; ) {
|
|
201
|
+
const c = Math.min(n - this.pos, o - i);
|
|
202
|
+
if (c === n) {
|
|
203
|
+
const s = Vt(t);
|
|
204
|
+
for (; n <= o - i; i += n) this.process(s, i);
|
|
197
205
|
continue;
|
|
198
206
|
}
|
|
199
|
-
r.set(t.subarray(
|
|
207
|
+
r.set(t.subarray(i, i + c), this.pos), this.pos += c, i += c, this.pos === n && (this.process(e, 0), this.pos = 0);
|
|
200
208
|
}
|
|
201
209
|
return this.length += t.length, this.roundClean(), this;
|
|
202
210
|
}
|
|
203
211
|
digestInto(t) {
|
|
204
|
-
|
|
212
|
+
Dt(this), je(t, this), this.finished = !0;
|
|
205
213
|
const { buffer: e, view: r, blockLen: n, isLE: o } = this;
|
|
206
|
-
let { pos:
|
|
207
|
-
e[
|
|
208
|
-
for (let
|
|
214
|
+
let { pos: i } = this;
|
|
215
|
+
e[i++] = 128, Bt(this.buffer.subarray(i)), this.padOffset > n - i && (this.process(r, 0), i = 0);
|
|
216
|
+
for (let f = i; f < n; f++) e[f] = 0;
|
|
209
217
|
r.setBigUint64(n - 8, BigInt(this.length * 8), o), this.process(r, 0);
|
|
210
|
-
const
|
|
211
|
-
if (
|
|
212
|
-
const
|
|
213
|
-
if (
|
|
214
|
-
for (let
|
|
218
|
+
const c = Vt(t), s = this.outputLen;
|
|
219
|
+
if (s % 4) throw new Error("_sha2: outputLen must be aligned to 32bit");
|
|
220
|
+
const a = s / 4, u = this.get();
|
|
221
|
+
if (a > u.length) throw new Error("_sha2: outputLen bigger than state");
|
|
222
|
+
for (let f = 0; f < a; f++) c.setUint32(4 * f, u[f], o);
|
|
215
223
|
}
|
|
216
224
|
digest() {
|
|
217
225
|
const { buffer: t, outputLen: e } = this;
|
|
@@ -221,13 +229,13 @@ var ae, dt, ht, K, X, Nn = Bt((() => {
|
|
|
221
229
|
}
|
|
222
230
|
_cloneInto(t) {
|
|
223
231
|
t ||= new this.constructor(), t.set(...this.get());
|
|
224
|
-
const { blockLen: e, buffer: r, length: n, finished: o, destroyed:
|
|
225
|
-
return t.destroyed =
|
|
232
|
+
const { blockLen: e, buffer: r, length: n, finished: o, destroyed: i, pos: c } = this;
|
|
233
|
+
return t.destroyed = i, t.finished = o, t.length = n, t.pos = c, n % e && t.buffer.set(r), t;
|
|
226
234
|
}
|
|
227
235
|
clone() {
|
|
228
236
|
return this._cloneInto();
|
|
229
237
|
}
|
|
230
|
-
},
|
|
238
|
+
}, at = /* @__PURE__ */ Uint32Array.from([
|
|
231
239
|
1779033703,
|
|
232
240
|
3144134277,
|
|
233
241
|
1013904242,
|
|
@@ -236,7 +244,7 @@ var ae, dt, ht, K, X, Nn = Bt((() => {
|
|
|
236
244
|
2600822924,
|
|
237
245
|
528734635,
|
|
238
246
|
1541459225
|
|
239
|
-
]),
|
|
247
|
+
]), ut = /* @__PURE__ */ Uint32Array.from([
|
|
240
248
|
3238371032,
|
|
241
249
|
914150663,
|
|
242
250
|
812702999,
|
|
@@ -245,7 +253,7 @@ var ae, dt, ht, K, X, Nn = Bt((() => {
|
|
|
245
253
|
1750603025,
|
|
246
254
|
1694076839,
|
|
247
255
|
3204075428
|
|
248
|
-
]),
|
|
256
|
+
]), M = /* @__PURE__ */ Uint32Array.from([
|
|
249
257
|
3418070365,
|
|
250
258
|
3238371032,
|
|
251
259
|
1654270250,
|
|
@@ -262,7 +270,7 @@ var ae, dt, ht, K, X, Nn = Bt((() => {
|
|
|
262
270
|
1694076839,
|
|
263
271
|
1203062813,
|
|
264
272
|
3204075428
|
|
265
|
-
]),
|
|
273
|
+
]), G = /* @__PURE__ */ Uint32Array.from([
|
|
266
274
|
1779033703,
|
|
267
275
|
4089235720,
|
|
268
276
|
3144134277,
|
|
@@ -281,48 +289,48 @@ var ae, dt, ht, K, X, Nn = Bt((() => {
|
|
|
281
289
|
327033209
|
|
282
290
|
]);
|
|
283
291
|
}));
|
|
284
|
-
function
|
|
292
|
+
function $n(t, e = !1) {
|
|
285
293
|
return e ? {
|
|
286
|
-
h: Number(t &
|
|
287
|
-
l: Number(t >>
|
|
294
|
+
h: Number(t & St),
|
|
295
|
+
l: Number(t >> Qt & St)
|
|
288
296
|
} : {
|
|
289
|
-
h: Number(t >>
|
|
290
|
-
l: Number(t &
|
|
297
|
+
h: Number(t >> Qt & St) | 0,
|
|
298
|
+
l: Number(t & St) | 0
|
|
291
299
|
};
|
|
292
300
|
}
|
|
293
|
-
function
|
|
301
|
+
function Dn(t, e = !1) {
|
|
294
302
|
const r = t.length;
|
|
295
303
|
let n = new Uint32Array(r), o = new Uint32Array(r);
|
|
296
|
-
for (let
|
|
297
|
-
const { h:
|
|
298
|
-
[n[
|
|
304
|
+
for (let i = 0; i < r; i++) {
|
|
305
|
+
const { h: c, l: s } = $n(t[i], e);
|
|
306
|
+
[n[i], o[i]] = [c, s];
|
|
299
307
|
}
|
|
300
308
|
return [n, o];
|
|
301
309
|
}
|
|
302
|
-
function
|
|
310
|
+
function it(t, e, r, n) {
|
|
303
311
|
const o = (e >>> 0) + (n >>> 0);
|
|
304
312
|
return {
|
|
305
313
|
h: t + r + (o / 2 ** 32 | 0) | 0,
|
|
306
314
|
l: o | 0
|
|
307
315
|
};
|
|
308
316
|
}
|
|
309
|
-
var
|
|
310
|
-
|
|
311
|
-
})),
|
|
312
|
-
_SHA224: () =>
|
|
313
|
-
_SHA256: () =>
|
|
314
|
-
_SHA384: () =>
|
|
315
|
-
_SHA512: () =>
|
|
316
|
-
_SHA512_224: () =>
|
|
317
|
-
_SHA512_256: () =>
|
|
318
|
-
sha224: () =>
|
|
319
|
-
sha256: () =>
|
|
320
|
-
sha384: () =>
|
|
321
|
-
sha512: () =>
|
|
322
|
-
sha512_224: () =>
|
|
323
|
-
sha512_256: () =>
|
|
324
|
-
}),
|
|
325
|
-
|
|
317
|
+
var St, Qt, Jt, Pt, bt, wt, _t, Ht, ze, Me, Ge, Ke, Xe, We, qn = dt((() => {
|
|
318
|
+
St = /* @__PURE__ */ BigInt(2 ** 32 - 1), Qt = /* @__PURE__ */ BigInt(32), Jt = (t, e, r) => t >>> r, Pt = (t, e, r) => t << 32 - r | e >>> r, bt = (t, e, r) => t >>> r | e << 32 - r, wt = (t, e, r) => t << 32 - r | e >>> r, _t = (t, e, r) => t << 64 - r | e >>> r - 32, Ht = (t, e, r) => t >>> r - 32 | e << 64 - r, ze = (t, e, r) => (t >>> 0) + (e >>> 0) + (r >>> 0), Me = (t, e, r, n) => e + r + n + (t / 2 ** 32 | 0) | 0, Ge = (t, e, r, n) => (t >>> 0) + (e >>> 0) + (r >>> 0) + (n >>> 0), Ke = (t, e, r, n, o) => e + r + n + o + (t / 2 ** 32 | 0) | 0, Xe = (t, e, r, n, o) => (t >>> 0) + (e >>> 0) + (r >>> 0) + (n >>> 0) + (o >>> 0), We = (t, e, r, n, o, i) => e + r + n + o + i + (t / 2 ** 32 | 0) | 0;
|
|
319
|
+
})), Br = /* @__PURE__ */ Ze({
|
|
320
|
+
_SHA224: () => ee,
|
|
321
|
+
_SHA256: () => te,
|
|
322
|
+
_SHA384: () => re,
|
|
323
|
+
_SHA512: () => ne,
|
|
324
|
+
_SHA512_224: () => oe,
|
|
325
|
+
_SHA512_256: () => ie,
|
|
326
|
+
sha224: () => Qe,
|
|
327
|
+
sha256: () => ge,
|
|
328
|
+
sha384: () => Pe,
|
|
329
|
+
sha512: () => Je,
|
|
330
|
+
sha512_224: () => en,
|
|
331
|
+
sha512_256: () => tn
|
|
332
|
+
}), Re, st, Yt, te, ee, zt, Se, _e, ct, ft, Rt, ne, re, Y, z, oe, ie, ge, Qe, Je, Pe, tn, en, Zn = dt((() => {
|
|
333
|
+
Un(), qn(), It(), Re = /* @__PURE__ */ Uint32Array.from([
|
|
326
334
|
1116352408,
|
|
327
335
|
1899447441,
|
|
328
336
|
3049323471,
|
|
@@ -387,70 +395,70 @@ var It, le, ue, de, yt, Et, Lt, qt, Zn, kn, Tn, Vn, Xe, ze, We, Qe, Je, Pe, Mn =
|
|
|
387
395
|
2756734187,
|
|
388
396
|
3204031479,
|
|
389
397
|
3329325298
|
|
390
|
-
]),
|
|
398
|
+
]), st = /* @__PURE__ */ new Uint32Array(64), Yt = class extends Wt {
|
|
391
399
|
constructor(t) {
|
|
392
400
|
super(64, t, 8, !1);
|
|
393
401
|
}
|
|
394
402
|
get() {
|
|
395
|
-
const { A: t, B: e, C: r, D: n, E: o, F:
|
|
403
|
+
const { A: t, B: e, C: r, D: n, E: o, F: i, G: c, H: s } = this;
|
|
396
404
|
return [
|
|
397
405
|
t,
|
|
398
406
|
e,
|
|
399
407
|
r,
|
|
400
408
|
n,
|
|
401
409
|
o,
|
|
402
|
-
s,
|
|
403
410
|
i,
|
|
404
|
-
c
|
|
411
|
+
c,
|
|
412
|
+
s
|
|
405
413
|
];
|
|
406
414
|
}
|
|
407
|
-
set(t, e, r, n, o,
|
|
408
|
-
this.A = t | 0, this.B = e | 0, this.C = r | 0, this.D = n | 0, this.E = o | 0, this.F =
|
|
415
|
+
set(t, e, r, n, o, i, c, s) {
|
|
416
|
+
this.A = t | 0, this.B = e | 0, this.C = r | 0, this.D = n | 0, this.E = o | 0, this.F = i | 0, this.G = c | 0, this.H = s | 0;
|
|
409
417
|
}
|
|
410
418
|
process(t, e) {
|
|
411
|
-
for (let
|
|
412
|
-
for (let
|
|
413
|
-
const g =
|
|
414
|
-
|
|
419
|
+
for (let f = 0; f < 16; f++, e += 4) st[f] = t.getUint32(e, !1);
|
|
420
|
+
for (let f = 16; f < 64; f++) {
|
|
421
|
+
const g = st[f - 15], m = st[f - 2], w = nt(g, 7) ^ nt(g, 18) ^ g >>> 3;
|
|
422
|
+
st[f] = (nt(m, 17) ^ nt(m, 19) ^ m >>> 10) + st[f - 7] + w + st[f - 16] | 0;
|
|
415
423
|
}
|
|
416
|
-
let { A: r, B: n, C: o, D:
|
|
417
|
-
for (let
|
|
418
|
-
const g =
|
|
419
|
-
|
|
424
|
+
let { A: r, B: n, C: o, D: i, E: c, F: s, G: a, H: u } = this;
|
|
425
|
+
for (let f = 0; f < 64; f++) {
|
|
426
|
+
const g = nt(c, 6) ^ nt(c, 11) ^ nt(c, 25), m = u + g + Nn(c, s, a) + Re[f] + st[f] | 0, w = (nt(r, 2) ^ nt(r, 13) ^ nt(r, 22)) + Tn(r, n, o) | 0;
|
|
427
|
+
u = a, a = s, s = c, c = i + m | 0, i = o, o = n, n = r, r = m + w | 0;
|
|
420
428
|
}
|
|
421
|
-
r = r + this.A | 0, n = n + this.B | 0, o = o + this.C | 0,
|
|
429
|
+
r = r + this.A | 0, n = n + this.B | 0, o = o + this.C | 0, i = i + this.D | 0, c = c + this.E | 0, s = s + this.F | 0, a = a + this.G | 0, u = u + this.H | 0, this.set(r, n, o, i, c, s, a, u);
|
|
422
430
|
}
|
|
423
431
|
roundClean() {
|
|
424
|
-
|
|
432
|
+
Bt(st);
|
|
425
433
|
}
|
|
426
434
|
destroy() {
|
|
427
|
-
this.set(0, 0, 0, 0, 0, 0, 0, 0),
|
|
428
|
-
}
|
|
429
|
-
},
|
|
430
|
-
A =
|
|
431
|
-
B =
|
|
432
|
-
C =
|
|
433
|
-
D =
|
|
434
|
-
E =
|
|
435
|
-
F =
|
|
436
|
-
G =
|
|
437
|
-
H =
|
|
435
|
+
this.destroyed = !0, this.set(0, 0, 0, 0, 0, 0, 0, 0), Bt(this.buffer);
|
|
436
|
+
}
|
|
437
|
+
}, te = class extends Yt {
|
|
438
|
+
A = at[0] | 0;
|
|
439
|
+
B = at[1] | 0;
|
|
440
|
+
C = at[2] | 0;
|
|
441
|
+
D = at[3] | 0;
|
|
442
|
+
E = at[4] | 0;
|
|
443
|
+
F = at[5] | 0;
|
|
444
|
+
G = at[6] | 0;
|
|
445
|
+
H = at[7] | 0;
|
|
438
446
|
constructor() {
|
|
439
447
|
super(32);
|
|
440
448
|
}
|
|
441
|
-
},
|
|
442
|
-
A =
|
|
443
|
-
B =
|
|
444
|
-
C =
|
|
445
|
-
D =
|
|
446
|
-
E =
|
|
447
|
-
F =
|
|
448
|
-
G =
|
|
449
|
-
H =
|
|
449
|
+
}, ee = class extends Yt {
|
|
450
|
+
A = ut[0] | 0;
|
|
451
|
+
B = ut[1] | 0;
|
|
452
|
+
C = ut[2] | 0;
|
|
453
|
+
D = ut[3] | 0;
|
|
454
|
+
E = ut[4] | 0;
|
|
455
|
+
F = ut[5] | 0;
|
|
456
|
+
G = ut[6] | 0;
|
|
457
|
+
H = ut[7] | 0;
|
|
450
458
|
constructor() {
|
|
451
459
|
super(28);
|
|
452
460
|
}
|
|
453
|
-
},
|
|
461
|
+
}, zt = Dn([
|
|
454
462
|
"0x428a2f98d728ae22",
|
|
455
463
|
"0x7137449123ef65cd",
|
|
456
464
|
"0xb5c0fbcfec4d3b2f",
|
|
@@ -531,93 +539,93 @@ var It, le, ue, de, yt, Et, Lt, qt, Zn, kn, Tn, Vn, Xe, ze, We, Qe, Je, Pe, Mn =
|
|
|
531
539
|
"0x597f299cfc657e2a",
|
|
532
540
|
"0x5fcb6fab3ad6faec",
|
|
533
541
|
"0x6c44198c4a475817"
|
|
534
|
-
].map((t) => BigInt(t))),
|
|
542
|
+
].map((t) => BigInt(t))), Se = zt[0], _e = zt[1], ct = /* @__PURE__ */ new Uint32Array(80), ft = /* @__PURE__ */ new Uint32Array(80), Rt = class extends Wt {
|
|
535
543
|
constructor(t) {
|
|
536
544
|
super(128, t, 16, !1);
|
|
537
545
|
}
|
|
538
546
|
get() {
|
|
539
|
-
const { Ah: t, Al: e, Bh: r, Bl: n, Ch: o, Cl:
|
|
547
|
+
const { Ah: t, Al: e, Bh: r, Bl: n, Ch: o, Cl: i, Dh: c, Dl: s, Eh: a, El: u, Fh: f, Fl: g, Gh: m, Gl: w, Hh: A, Hl: _ } = this;
|
|
540
548
|
return [
|
|
541
549
|
t,
|
|
542
550
|
e,
|
|
543
551
|
r,
|
|
544
552
|
n,
|
|
545
553
|
o,
|
|
546
|
-
s,
|
|
547
554
|
i,
|
|
548
555
|
c,
|
|
549
|
-
|
|
550
|
-
l,
|
|
556
|
+
s,
|
|
551
557
|
a,
|
|
558
|
+
u,
|
|
559
|
+
f,
|
|
552
560
|
g,
|
|
553
|
-
b,
|
|
554
|
-
w,
|
|
555
561
|
m,
|
|
556
|
-
|
|
562
|
+
w,
|
|
563
|
+
A,
|
|
564
|
+
_
|
|
557
565
|
];
|
|
558
566
|
}
|
|
559
|
-
set(t, e, r, n, o,
|
|
560
|
-
this.Ah = t | 0, this.Al = e | 0, this.Bh = r | 0, this.Bl = n | 0, this.Ch = o | 0, this.Cl =
|
|
567
|
+
set(t, e, r, n, o, i, c, s, a, u, f, g, m, w, A, _) {
|
|
568
|
+
this.Ah = t | 0, this.Al = e | 0, this.Bh = r | 0, this.Bl = n | 0, this.Ch = o | 0, this.Cl = i | 0, this.Dh = c | 0, this.Dl = s | 0, this.Eh = a | 0, this.El = u | 0, this.Fh = f | 0, this.Fl = g | 0, this.Gh = m | 0, this.Gl = w | 0, this.Hh = A | 0, this.Hl = _ | 0;
|
|
561
569
|
}
|
|
562
570
|
process(t, e) {
|
|
563
|
-
for (let
|
|
564
|
-
|
|
565
|
-
for (let
|
|
566
|
-
const
|
|
567
|
-
|
|
571
|
+
for (let x = 0; x < 16; x++, e += 4)
|
|
572
|
+
ct[x] = t.getUint32(e), ft[x] = t.getUint32(e += 4);
|
|
573
|
+
for (let x = 16; x < 80; x++) {
|
|
574
|
+
const q = ct[x - 15] | 0, Z = ft[x - 15] | 0, T = bt(q, Z, 1) ^ bt(q, Z, 8) ^ Jt(q, Z, 7), Q = wt(q, Z, 1) ^ wt(q, Z, 8) ^ Pt(q, Z, 7), $ = ct[x - 2] | 0, R = ft[x - 2] | 0, C = bt($, R, 19) ^ _t($, R, 61) ^ Jt($, R, 6), X = wt($, R, 19) ^ Ht($, R, 61) ^ Pt($, R, 6), F = Ge(Q, X, ft[x - 7], ft[x - 16]);
|
|
575
|
+
ct[x] = Ke(F, T, C, ct[x - 7], ct[x - 16]) | 0, ft[x] = F | 0;
|
|
568
576
|
}
|
|
569
|
-
let { Ah: r, Al: n, Bh: o, Bl:
|
|
570
|
-
for (let
|
|
571
|
-
const
|
|
572
|
-
|
|
573
|
-
const
|
|
574
|
-
r =
|
|
577
|
+
let { Ah: r, Al: n, Bh: o, Bl: i, Ch: c, Cl: s, Dh: a, Dl: u, Eh: f, El: g, Fh: m, Fl: w, Gh: A, Gl: _, Hh: H, Hl: O } = this;
|
|
578
|
+
for (let x = 0; x < 80; x++) {
|
|
579
|
+
const q = bt(f, g, 14) ^ bt(f, g, 18) ^ _t(f, g, 41), Z = wt(f, g, 14) ^ wt(f, g, 18) ^ Ht(f, g, 41), T = f & m ^ ~f & A, Q = g & w ^ ~g & _, $ = Xe(O, Z, Q, _e[x], ft[x]), R = We($, H, q, T, Se[x], ct[x]), C = $ | 0, X = bt(r, n, 28) ^ _t(r, n, 34) ^ _t(r, n, 39), F = wt(r, n, 28) ^ Ht(r, n, 34) ^ Ht(r, n, 39), h = r & o ^ r & c ^ o & c, y = n & i ^ n & s ^ i & s;
|
|
580
|
+
H = A | 0, O = _ | 0, A = m | 0, _ = w | 0, m = f | 0, w = g | 0, { h: f, l: g } = it(a | 0, u | 0, R | 0, C | 0), a = c | 0, u = s | 0, c = o | 0, s = i | 0, o = r | 0, i = n | 0;
|
|
581
|
+
const B = ze(C, F, y);
|
|
582
|
+
r = Me(B, R, X, h), n = B | 0;
|
|
575
583
|
}
|
|
576
|
-
({ h: r, l: n } =
|
|
584
|
+
({ h: r, l: n } = it(this.Ah | 0, this.Al | 0, r | 0, n | 0)), { h: o, l: i } = it(this.Bh | 0, this.Bl | 0, o | 0, i | 0), { h: c, l: s } = it(this.Ch | 0, this.Cl | 0, c | 0, s | 0), { h: a, l: u } = it(this.Dh | 0, this.Dl | 0, a | 0, u | 0), { h: f, l: g } = it(this.Eh | 0, this.El | 0, f | 0, g | 0), { h: m, l: w } = it(this.Fh | 0, this.Fl | 0, m | 0, w | 0), { h: A, l: _ } = it(this.Gh | 0, this.Gl | 0, A | 0, _ | 0), { h: H, l: O } = it(this.Hh | 0, this.Hl | 0, H | 0, O | 0), this.set(r, n, o, i, c, s, a, u, f, g, m, w, A, _, H, O);
|
|
577
585
|
}
|
|
578
586
|
roundClean() {
|
|
579
|
-
|
|
587
|
+
Bt(ct, ft);
|
|
580
588
|
}
|
|
581
589
|
destroy() {
|
|
582
|
-
|
|
583
|
-
}
|
|
584
|
-
},
|
|
585
|
-
Ah =
|
|
586
|
-
Al =
|
|
587
|
-
Bh =
|
|
588
|
-
Bl =
|
|
589
|
-
Ch =
|
|
590
|
-
Cl =
|
|
591
|
-
Dh =
|
|
592
|
-
Dl =
|
|
593
|
-
Eh =
|
|
594
|
-
El =
|
|
595
|
-
Fh =
|
|
596
|
-
Fl =
|
|
597
|
-
Gh =
|
|
598
|
-
Gl =
|
|
599
|
-
Hh =
|
|
600
|
-
Hl =
|
|
590
|
+
this.destroyed = !0, Bt(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
591
|
+
}
|
|
592
|
+
}, ne = class extends Rt {
|
|
593
|
+
Ah = G[0] | 0;
|
|
594
|
+
Al = G[1] | 0;
|
|
595
|
+
Bh = G[2] | 0;
|
|
596
|
+
Bl = G[3] | 0;
|
|
597
|
+
Ch = G[4] | 0;
|
|
598
|
+
Cl = G[5] | 0;
|
|
599
|
+
Dh = G[6] | 0;
|
|
600
|
+
Dl = G[7] | 0;
|
|
601
|
+
Eh = G[8] | 0;
|
|
602
|
+
El = G[9] | 0;
|
|
603
|
+
Fh = G[10] | 0;
|
|
604
|
+
Fl = G[11] | 0;
|
|
605
|
+
Gh = G[12] | 0;
|
|
606
|
+
Gl = G[13] | 0;
|
|
607
|
+
Hh = G[14] | 0;
|
|
608
|
+
Hl = G[15] | 0;
|
|
601
609
|
constructor() {
|
|
602
610
|
super(64);
|
|
603
611
|
}
|
|
604
|
-
},
|
|
605
|
-
Ah =
|
|
606
|
-
Al =
|
|
607
|
-
Bh =
|
|
608
|
-
Bl =
|
|
609
|
-
Ch =
|
|
610
|
-
Cl =
|
|
611
|
-
Dh =
|
|
612
|
-
Dl =
|
|
613
|
-
Eh =
|
|
614
|
-
El =
|
|
615
|
-
Fh =
|
|
616
|
-
Fl =
|
|
617
|
-
Gh =
|
|
618
|
-
Gl =
|
|
619
|
-
Hh =
|
|
620
|
-
Hl =
|
|
612
|
+
}, re = class extends Rt {
|
|
613
|
+
Ah = M[0] | 0;
|
|
614
|
+
Al = M[1] | 0;
|
|
615
|
+
Bh = M[2] | 0;
|
|
616
|
+
Bl = M[3] | 0;
|
|
617
|
+
Ch = M[4] | 0;
|
|
618
|
+
Cl = M[5] | 0;
|
|
619
|
+
Dh = M[6] | 0;
|
|
620
|
+
Dl = M[7] | 0;
|
|
621
|
+
Eh = M[8] | 0;
|
|
622
|
+
El = M[9] | 0;
|
|
623
|
+
Fh = M[10] | 0;
|
|
624
|
+
Fl = M[11] | 0;
|
|
625
|
+
Gh = M[12] | 0;
|
|
626
|
+
Gl = M[13] | 0;
|
|
627
|
+
Hh = M[14] | 0;
|
|
628
|
+
Hl = M[15] | 0;
|
|
621
629
|
constructor() {
|
|
622
630
|
super(48);
|
|
623
631
|
}
|
|
@@ -638,7 +646,7 @@ var It, le, ue, de, yt, Et, Lt, qt, Zn, kn, Tn, Vn, Xe, ze, We, Qe, Je, Pe, Mn =
|
|
|
638
646
|
1780299464,
|
|
639
647
|
286451373,
|
|
640
648
|
2446758561
|
|
641
|
-
]),
|
|
649
|
+
]), z = /* @__PURE__ */ Uint32Array.from([
|
|
642
650
|
573645204,
|
|
643
651
|
4230739756,
|
|
644
652
|
2673172387,
|
|
@@ -655,7 +663,7 @@ var It, le, ue, de, yt, Et, Lt, qt, Zn, kn, Tn, Vn, Xe, ze, We, Qe, Je, Pe, Mn =
|
|
|
655
663
|
746961066,
|
|
656
664
|
246885852,
|
|
657
665
|
2177182882
|
|
658
|
-
]),
|
|
666
|
+
]), oe = class extends Rt {
|
|
659
667
|
Ah = Y[0] | 0;
|
|
660
668
|
Al = Y[1] | 0;
|
|
661
669
|
Bh = Y[2] | 0;
|
|
@@ -675,265 +683,348 @@ var It, le, ue, de, yt, Et, Lt, qt, Zn, kn, Tn, Vn, Xe, ze, We, Qe, Je, Pe, Mn =
|
|
|
675
683
|
constructor() {
|
|
676
684
|
super(28);
|
|
677
685
|
}
|
|
678
|
-
},
|
|
679
|
-
Ah =
|
|
680
|
-
Al =
|
|
681
|
-
Bh =
|
|
682
|
-
Bl =
|
|
683
|
-
Ch =
|
|
684
|
-
Cl =
|
|
685
|
-
Dh =
|
|
686
|
-
Dl =
|
|
687
|
-
Eh =
|
|
688
|
-
El =
|
|
689
|
-
Fh =
|
|
690
|
-
Fl =
|
|
691
|
-
Gh =
|
|
692
|
-
Gl =
|
|
693
|
-
Hh =
|
|
694
|
-
Hl =
|
|
686
|
+
}, ie = class extends Rt {
|
|
687
|
+
Ah = z[0] | 0;
|
|
688
|
+
Al = z[1] | 0;
|
|
689
|
+
Bh = z[2] | 0;
|
|
690
|
+
Bl = z[3] | 0;
|
|
691
|
+
Ch = z[4] | 0;
|
|
692
|
+
Cl = z[5] | 0;
|
|
693
|
+
Dh = z[6] | 0;
|
|
694
|
+
Dl = z[7] | 0;
|
|
695
|
+
Eh = z[8] | 0;
|
|
696
|
+
El = z[9] | 0;
|
|
697
|
+
Fh = z[10] | 0;
|
|
698
|
+
Fl = z[11] | 0;
|
|
699
|
+
Gh = z[12] | 0;
|
|
700
|
+
Gl = z[13] | 0;
|
|
701
|
+
Hh = z[14] | 0;
|
|
702
|
+
Hl = z[15] | 0;
|
|
695
703
|
constructor() {
|
|
696
704
|
super(32);
|
|
697
705
|
}
|
|
698
|
-
},
|
|
706
|
+
}, ge = /* @__PURE__ */ xt(() => new te(), /* @__PURE__ */ gt(1)), Qe = /* @__PURE__ */ xt(() => new ee(), /* @__PURE__ */ gt(4)), Je = /* @__PURE__ */ xt(() => new ne(), /* @__PURE__ */ gt(3)), Pe = /* @__PURE__ */ xt(() => new re(), /* @__PURE__ */ gt(2)), tn = /* @__PURE__ */ xt(() => new ie(), /* @__PURE__ */ gt(6)), en = /* @__PURE__ */ xt(() => new oe(), /* @__PURE__ */ gt(5));
|
|
699
707
|
}));
|
|
700
|
-
function
|
|
701
|
-
|
|
702
|
-
const r = e && `"${e}" `;
|
|
703
|
-
throw new Error(r + "expected boolean, got type=" + typeof t);
|
|
704
|
-
}
|
|
705
|
-
return t;
|
|
706
|
-
}
|
|
707
|
-
function on(t) {
|
|
708
|
-
if (typeof t == "bigint") {
|
|
709
|
-
if (!Ut(t)) throw new Error("positive bigint expected, got " + t);
|
|
710
|
-
} else xt(t);
|
|
711
|
-
return t;
|
|
708
|
+
function Cn(t) {
|
|
709
|
+
return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
|
|
712
710
|
}
|
|
713
|
-
function
|
|
714
|
-
if (!Number.isSafeInteger(t)) {
|
|
711
|
+
function Ar(t, e = "") {
|
|
712
|
+
if (!Number.isSafeInteger(t) || t < 0) {
|
|
715
713
|
const r = e && `"${e}" `;
|
|
716
|
-
throw new Error(r
|
|
714
|
+
throw new Error(`${r}expected integer >= 0, got ${t}`);
|
|
717
715
|
}
|
|
718
716
|
}
|
|
719
|
-
function
|
|
720
|
-
const
|
|
721
|
-
|
|
717
|
+
function nn(t, e, r = "") {
|
|
718
|
+
const n = Cn(t), o = t?.length, i = e !== void 0;
|
|
719
|
+
if (!n || i && o !== e) {
|
|
720
|
+
const c = r && `"${r}" `, s = i ? ` of length ${e}` : "", a = n ? `length=${o}` : `type=${typeof t}`;
|
|
721
|
+
throw new Error(c + "expected Uint8Array" + s + ", got " + a);
|
|
722
|
+
}
|
|
723
|
+
return t;
|
|
722
724
|
}
|
|
723
|
-
function
|
|
724
|
-
if (
|
|
725
|
-
|
|
725
|
+
function Rr(t, e = !0) {
|
|
726
|
+
if (t.destroyed) throw new Error("Hash instance has been destroyed");
|
|
727
|
+
if (e && t.finished) throw new Error("Hash#digest() has already been called");
|
|
726
728
|
}
|
|
727
|
-
function
|
|
728
|
-
|
|
729
|
+
function Sr(t, e) {
|
|
730
|
+
nn(t, void 0, "digestInto() output");
|
|
731
|
+
const r = e.outputLen;
|
|
732
|
+
if (t.length < r) throw new Error('"digestInto() output" expected to be of length >=' + r);
|
|
729
733
|
}
|
|
730
|
-
function
|
|
731
|
-
return
|
|
734
|
+
function _r(t) {
|
|
735
|
+
return new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
|
|
732
736
|
}
|
|
733
|
-
function
|
|
734
|
-
|
|
735
|
-
const r = Mt(t.toString(16).padStart(e * 2, "0"));
|
|
736
|
-
if (r.length !== e) throw new Error("number too large");
|
|
737
|
-
return r;
|
|
737
|
+
function Hr(...t) {
|
|
738
|
+
for (let e = 0; e < t.length; e++) t[e].fill(0);
|
|
738
739
|
}
|
|
739
|
-
function
|
|
740
|
-
return
|
|
740
|
+
function kn(t) {
|
|
741
|
+
return t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
|
|
741
742
|
}
|
|
742
743
|
function jn(t) {
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
function Wt(t) {
|
|
746
|
-
return Uint8Array.from(t, (e, r) => {
|
|
747
|
-
const n = e.charCodeAt(0);
|
|
748
|
-
if (e.length !== 1 || n > 127) throw new Error(`string contains non-ASCII character "${t[r]}" with code ${n} at position ${r}`);
|
|
749
|
-
return n;
|
|
750
|
-
});
|
|
751
|
-
}
|
|
752
|
-
function Yn(t, e, r) {
|
|
753
|
-
return Ut(t) && Ut(e) && Ut(r) && e <= t && t < r;
|
|
744
|
+
for (let e = 0; e < t.length; e++) t[e] = kn(t[e]);
|
|
745
|
+
return t;
|
|
754
746
|
}
|
|
755
|
-
function
|
|
756
|
-
|
|
747
|
+
function Or(...t) {
|
|
748
|
+
let e = 0;
|
|
749
|
+
for (let n = 0; n < t.length; n++) {
|
|
750
|
+
const o = t[n];
|
|
751
|
+
nn(o), e += o.length;
|
|
752
|
+
}
|
|
753
|
+
const r = new Uint8Array(e);
|
|
754
|
+
for (let n = 0, o = 0; n < t.length; n++) {
|
|
755
|
+
const i = t[n];
|
|
756
|
+
r.set(i, o), o += i.length;
|
|
757
|
+
}
|
|
758
|
+
return r;
|
|
757
759
|
}
|
|
758
|
-
function
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
return e;
|
|
760
|
+
function Ir(t, e = {}) {
|
|
761
|
+
const r = (o, i) => t(i).update(o).digest(), n = t(void 0);
|
|
762
|
+
return r.outputLen = n.outputLen, r.blockLen = n.blockLen, r.create = (o) => t(o), Object.assign(r, e), Object.freeze(r);
|
|
762
763
|
}
|
|
763
|
-
function
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
const g = () => {
|
|
768
|
-
f.fill(1), l.fill(0), a = 0;
|
|
769
|
-
}, b = (...v) => r(l, P(f, ...v)), w = (v = o) => {
|
|
770
|
-
l = b(s, v), f = b(), v.length !== 0 && (l = b(i, v), f = b());
|
|
771
|
-
}, m = () => {
|
|
772
|
-
if (a++ >= c) throw new Error("drbg: tried max amount of iterations");
|
|
773
|
-
let v = 0;
|
|
774
|
-
const B = [];
|
|
775
|
-
for (; v < e; ) {
|
|
776
|
-
f = b();
|
|
777
|
-
const E = f.slice();
|
|
778
|
-
B.push(E), v += f.length;
|
|
779
|
-
}
|
|
780
|
-
return P(...B);
|
|
781
|
-
};
|
|
782
|
-
return (v, B) => {
|
|
783
|
-
g(), w(v);
|
|
784
|
-
let E;
|
|
785
|
-
for (; !(E = B(m())); ) w();
|
|
786
|
-
return g(), E;
|
|
787
|
-
};
|
|
764
|
+
function Fr(t = 32) {
|
|
765
|
+
const e = typeof globalThis == "object" ? globalThis.crypto : null;
|
|
766
|
+
if (typeof e?.getRandomValues != "function") throw new Error("crypto.getRandomValues must be defined");
|
|
767
|
+
return e.getRandomValues(new Uint8Array(t));
|
|
788
768
|
}
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
769
|
+
var He, Vn, Yn, zn = dt((() => {
|
|
770
|
+
He = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68, Vn = He ? (t) => t : jn, Yn = (t) => ({ oid: Uint8Array.from([
|
|
771
|
+
6,
|
|
772
|
+
9,
|
|
773
|
+
96,
|
|
774
|
+
134,
|
|
775
|
+
72,
|
|
776
|
+
1,
|
|
777
|
+
101,
|
|
778
|
+
3,
|
|
779
|
+
4,
|
|
780
|
+
2,
|
|
781
|
+
t
|
|
782
|
+
]) });
|
|
783
|
+
}));
|
|
784
|
+
function Lr(t, e = "") {
|
|
785
|
+
if (typeof t != "boolean") {
|
|
786
|
+
const r = e && `"${e}" `;
|
|
787
|
+
throw new Error(r + "expected boolean, got type=" + typeof t);
|
|
796
788
|
}
|
|
797
|
-
|
|
798
|
-
o(e, !1), o(r, !0);
|
|
799
|
-
}
|
|
800
|
-
function Ue(t) {
|
|
801
|
-
const e = /* @__PURE__ */ new WeakMap();
|
|
802
|
-
return (r, ...n) => {
|
|
803
|
-
const o = e.get(r);
|
|
804
|
-
if (o !== void 0) return o;
|
|
805
|
-
const s = t(r, ...n);
|
|
806
|
-
return e.set(r, s), s;
|
|
807
|
-
};
|
|
789
|
+
return t;
|
|
808
790
|
}
|
|
809
|
-
var
|
|
810
|
-
|
|
791
|
+
var Nr = dt((() => {
|
|
792
|
+
zn();
|
|
811
793
|
}));
|
|
812
|
-
function
|
|
794
|
+
function be(t) {
|
|
813
795
|
if (!Number.isSafeInteger(t) || t < 0 || t > 4294967295) throw new Error("wrong u32 integer:" + t);
|
|
814
796
|
return t;
|
|
815
797
|
}
|
|
816
|
-
function
|
|
817
|
-
return
|
|
798
|
+
function rn(t) {
|
|
799
|
+
return be(t), (t & t - 1) === 0 && t !== 0;
|
|
818
800
|
}
|
|
819
|
-
function
|
|
820
|
-
|
|
801
|
+
function Mn(t, e) {
|
|
802
|
+
be(t);
|
|
821
803
|
let r = 0;
|
|
822
804
|
for (let n = 0; n < e; n++, t >>>= 1) r = r << 1 | t & 1;
|
|
823
805
|
return r;
|
|
824
806
|
}
|
|
825
|
-
function
|
|
826
|
-
return
|
|
807
|
+
function on(t) {
|
|
808
|
+
return be(t), 31 - Math.clz32(t);
|
|
827
809
|
}
|
|
828
|
-
function
|
|
810
|
+
function Oe(t) {
|
|
829
811
|
const e = t.length;
|
|
830
|
-
if (e < 2 || !
|
|
831
|
-
const r =
|
|
812
|
+
if (e < 2 || !rn(e)) throw new Error("n must be a power of 2 and greater than 1. Got " + e);
|
|
813
|
+
const r = on(e);
|
|
832
814
|
for (let n = 0; n < e; n++) {
|
|
833
|
-
const o =
|
|
815
|
+
const o = Mn(n, r);
|
|
834
816
|
if (n < o) {
|
|
835
|
-
const
|
|
836
|
-
t[n] = t[o], t[o] =
|
|
817
|
+
const i = t[n];
|
|
818
|
+
t[n] = t[o], t[o] = i;
|
|
837
819
|
}
|
|
838
820
|
}
|
|
839
821
|
return t;
|
|
840
822
|
}
|
|
841
|
-
var
|
|
842
|
-
|
|
843
|
-
const { N: r, roots: n, dit: o, invertButterflies:
|
|
844
|
-
if (!
|
|
845
|
-
const
|
|
846
|
-
return (
|
|
847
|
-
if (
|
|
848
|
-
o &&
|
|
849
|
-
for (let g = 0,
|
|
850
|
-
const w = o ? g + 1 +
|
|
851
|
-
for (let
|
|
852
|
-
const
|
|
853
|
-
if (
|
|
854
|
-
const
|
|
855
|
-
|
|
856
|
-
} else
|
|
823
|
+
var Gn, Tr = dt((() => {
|
|
824
|
+
Gn = (t, e) => {
|
|
825
|
+
const { N: r, roots: n, dit: o, invertButterflies: i = !1, skipStages: c = 0, brp: s = !0 } = e, a = on(r);
|
|
826
|
+
if (!rn(r)) throw new Error("FFT: Polynomial size should be power of two");
|
|
827
|
+
const u = o !== i;
|
|
828
|
+
return (f) => {
|
|
829
|
+
if (f.length !== r) throw new Error("FFT: wrong Polynomial length");
|
|
830
|
+
o && s && Oe(f);
|
|
831
|
+
for (let g = 0, m = 1; g < a - c; g++) {
|
|
832
|
+
const w = o ? g + 1 + c : a - g, A = 1 << w, _ = A >> 1, H = r >> w;
|
|
833
|
+
for (let O = 0; O < r; O += A) for (let x = 0, q = m++; x < _; x++) {
|
|
834
|
+
const Z = i ? o ? r - q : q : x * H, T = O + x, Q = O + x + _, $ = n[Z], R = f[Q], C = f[T];
|
|
835
|
+
if (u) {
|
|
836
|
+
const X = t.mul(R, $);
|
|
837
|
+
f[T] = t.add(C, X), f[Q] = t.sub(C, X);
|
|
838
|
+
} else i ? (f[T] = t.add(R, C), f[Q] = t.mul(t.sub(R, C), $)) : (f[T] = t.add(C, R), f[Q] = t.mul(t.sub(C, R), $));
|
|
857
839
|
}
|
|
858
840
|
}
|
|
859
|
-
return !o &&
|
|
841
|
+
return !o && s && Oe(f), f;
|
|
860
842
|
};
|
|
861
843
|
};
|
|
862
844
|
}));
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
845
|
+
Zn();
|
|
846
|
+
It();
|
|
847
|
+
var W = (t, e, r) => mt(t, e, r), sn = Et, cn = le, lt = (...t) => In(...t), se = (t) => Ve(t), fn = Ce, an = (t) => Fn(t), qt = /* @__PURE__ */ BigInt(0), ce = /* @__PURE__ */ BigInt(1);
|
|
848
|
+
function Ot(t, e = "") {
|
|
849
|
+
if (typeof t != "boolean") {
|
|
850
|
+
const r = e && `"${e}" `;
|
|
851
|
+
throw new TypeError(r + "expected boolean, got type=" + typeof t);
|
|
852
|
+
}
|
|
853
|
+
return t;
|
|
854
|
+
}
|
|
855
|
+
function we(t) {
|
|
856
|
+
if (typeof t == "bigint") {
|
|
857
|
+
if (!$t(t)) throw new RangeError("positive bigint expected, got " + t);
|
|
858
|
+
} else sn(t);
|
|
859
|
+
return t;
|
|
860
|
+
}
|
|
861
|
+
function fe(t, e = "") {
|
|
862
|
+
if (typeof t != "number") {
|
|
863
|
+
const r = e && `"${e}" `;
|
|
864
|
+
throw new TypeError(r + "expected number, got type=" + typeof t);
|
|
865
|
+
}
|
|
866
|
+
if (!Number.isSafeInteger(t)) {
|
|
867
|
+
const r = e && `"${e}" `;
|
|
868
|
+
throw new RangeError(r + "expected safe integer, got " + t);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
function Nt(t) {
|
|
872
|
+
const e = we(t).toString(16);
|
|
873
|
+
return e.length & 1 ? "0" + e : e;
|
|
874
|
+
}
|
|
875
|
+
function un(t) {
|
|
876
|
+
if (typeof t != "string") throw new TypeError("hex string expected, got " + typeof t);
|
|
877
|
+
return t === "" ? qt : BigInt("0x" + t);
|
|
878
|
+
}
|
|
879
|
+
function Ct(t) {
|
|
880
|
+
return un(le(t));
|
|
881
|
+
}
|
|
882
|
+
function ln(t) {
|
|
883
|
+
return un(le(Kn(mt(t)).reverse()));
|
|
884
|
+
}
|
|
885
|
+
function pe(t, e) {
|
|
886
|
+
if (Et(e), e === 0) throw new RangeError("zero length");
|
|
887
|
+
t = we(t);
|
|
888
|
+
const r = t.toString(16);
|
|
889
|
+
if (r.length > e * 2) throw new RangeError("number too large");
|
|
890
|
+
return Ve(r.padStart(e * 2, "0"));
|
|
891
|
+
}
|
|
892
|
+
function hn(t, e) {
|
|
893
|
+
return pe(t, e).reverse();
|
|
894
|
+
}
|
|
895
|
+
function Kn(t) {
|
|
896
|
+
return Uint8Array.from(W(t));
|
|
897
|
+
}
|
|
898
|
+
var $t = (t) => typeof t == "bigint" && qt <= t;
|
|
899
|
+
function Xn(t, e, r) {
|
|
900
|
+
return $t(t) && $t(e) && $t(r) && e <= t && t < r;
|
|
901
|
+
}
|
|
902
|
+
function dn(t, e, r, n) {
|
|
903
|
+
if (!Xn(e, r, n)) throw new RangeError("expected valid " + t + ": " + r + " <= n < " + n + ", got " + e);
|
|
904
|
+
}
|
|
905
|
+
function ye(t) {
|
|
906
|
+
if (t < qt) throw new Error("expected non-negative bigint, got " + t);
|
|
907
|
+
let e;
|
|
908
|
+
for (e = 0; t > qt; t >>= ce, e += 1) ;
|
|
909
|
+
return e;
|
|
910
|
+
}
|
|
911
|
+
var Ee = (t) => (ce << BigInt(t)) - ce;
|
|
912
|
+
function Wn(t, e, r) {
|
|
913
|
+
if (Et(t, "hashLen"), Et(e, "qByteLen"), typeof r != "function") throw new TypeError("hmacFn must be a function");
|
|
914
|
+
const n = (H) => new Uint8Array(H), o = Uint8Array.of(), i = Uint8Array.of(0), c = Uint8Array.of(1), s = 1e3;
|
|
915
|
+
let a = n(t), u = n(t), f = 0;
|
|
916
|
+
const g = () => {
|
|
917
|
+
a.fill(1), u.fill(0), f = 0;
|
|
918
|
+
}, m = (...H) => r(u, lt(a, ...H)), w = (H = o) => {
|
|
919
|
+
u = m(i, H), a = m(), H.length !== 0 && (u = m(c, H), a = m());
|
|
920
|
+
}, A = () => {
|
|
921
|
+
if (f++ >= s) throw new Error("drbg: tried max amount of iterations");
|
|
922
|
+
let H = 0;
|
|
923
|
+
const O = [];
|
|
924
|
+
for (; H < e; ) {
|
|
925
|
+
a = m();
|
|
926
|
+
const x = a.slice();
|
|
927
|
+
O.push(x), H += a.length;
|
|
928
|
+
}
|
|
929
|
+
return lt(...O);
|
|
930
|
+
};
|
|
931
|
+
return (H, O) => {
|
|
932
|
+
g(), w(H);
|
|
933
|
+
let x;
|
|
934
|
+
for (; (x = O(A())) === void 0; ) w();
|
|
935
|
+
return g(), x;
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
function kt(t, e = {}, r = {}) {
|
|
939
|
+
if (Object.prototype.toString.call(t) !== "[object Object]") throw new TypeError("expected valid options object");
|
|
940
|
+
function n(i, c, s) {
|
|
941
|
+
if (!s && c !== "function" && !Object.hasOwn(t, i)) throw new TypeError(`param "${i}" is invalid: expected own property`);
|
|
942
|
+
const a = t[i];
|
|
943
|
+
if (s && a === void 0) return;
|
|
944
|
+
const u = typeof a;
|
|
945
|
+
if (u !== c || a === null) throw new TypeError(`param "${i}" is invalid: expected ${c}, got ${u}`);
|
|
946
|
+
}
|
|
947
|
+
const o = (i, c) => Object.entries(i).forEach(([s, a]) => n(s, a, c));
|
|
948
|
+
o(e, !1), o(r, !0);
|
|
949
|
+
}
|
|
950
|
+
var K = /* @__PURE__ */ BigInt(0), D = /* @__PURE__ */ BigInt(1), pt = /* @__PURE__ */ BigInt(2), gn = /* @__PURE__ */ BigInt(3), bn = /* @__PURE__ */ BigInt(4), wn = /* @__PURE__ */ BigInt(5), Qn = /* @__PURE__ */ BigInt(7), pn = /* @__PURE__ */ BigInt(8), Jn = /* @__PURE__ */ BigInt(9), yn = /* @__PURE__ */ BigInt(16);
|
|
951
|
+
function tt(t, e) {
|
|
952
|
+
if (e <= K) throw new Error("mod: expected positive modulus, got " + e);
|
|
866
953
|
const r = t % e;
|
|
867
|
-
return r >=
|
|
954
|
+
return r >= K ? r : e + r;
|
|
868
955
|
}
|
|
869
|
-
function
|
|
956
|
+
function P(t, e, r) {
|
|
957
|
+
if (e < K) throw new Error("pow2: expected non-negative exponent, got " + e);
|
|
870
958
|
let n = t;
|
|
871
|
-
for (; e-- >
|
|
959
|
+
for (; e-- > K; )
|
|
872
960
|
n *= n, n %= r;
|
|
873
961
|
return n;
|
|
874
962
|
}
|
|
875
|
-
function
|
|
876
|
-
if (t ===
|
|
877
|
-
if (e <=
|
|
878
|
-
let r =
|
|
879
|
-
for (; r !==
|
|
880
|
-
const
|
|
881
|
-
n = r, r =
|
|
963
|
+
function Ie(t, e) {
|
|
964
|
+
if (t === K) throw new Error("invert: expected non-zero number");
|
|
965
|
+
if (e <= K) throw new Error("invert: expected positive modulus, got " + e);
|
|
966
|
+
let r = tt(t, e), n = e, o = K, i = D, c = D, s = K;
|
|
967
|
+
for (; r !== K; ) {
|
|
968
|
+
const a = n / r, u = n - r * a, f = o - c * a, g = i - s * a;
|
|
969
|
+
n = r, r = u, o = c, i = s, c = f, s = g;
|
|
882
970
|
}
|
|
883
|
-
if (n !==
|
|
884
|
-
return
|
|
971
|
+
if (n !== D) throw new Error("invert: does not exist");
|
|
972
|
+
return tt(o, e);
|
|
885
973
|
}
|
|
886
|
-
function
|
|
887
|
-
|
|
974
|
+
function me(t, e, r) {
|
|
975
|
+
const n = t;
|
|
976
|
+
if (!n.eql(n.sqr(e), r)) throw new Error("Cannot find square root");
|
|
888
977
|
}
|
|
889
|
-
function
|
|
890
|
-
const r = (
|
|
891
|
-
return
|
|
978
|
+
function En(t, e) {
|
|
979
|
+
const r = t, n = (r.ORDER + D) / bn, o = r.pow(e, n);
|
|
980
|
+
return me(r, o, e), o;
|
|
892
981
|
}
|
|
893
982
|
function Pn(t, e) {
|
|
894
|
-
const r = (
|
|
895
|
-
return
|
|
896
|
-
}
|
|
897
|
-
function
|
|
898
|
-
const e =
|
|
899
|
-
return (
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
983
|
+
const r = t, n = (r.ORDER - wn) / pn, o = r.mul(e, pt), i = r.pow(o, n), c = r.mul(e, i), s = r.mul(r.mul(c, pt), i), a = r.mul(c, r.sub(s, r.ONE));
|
|
984
|
+
return me(r, a, e), a;
|
|
985
|
+
}
|
|
986
|
+
function tr(t) {
|
|
987
|
+
const e = jt(t), r = mn(t), n = r(e, e.neg(e.ONE)), o = r(e, n), i = r(e, e.neg(n)), c = (t + Qn) / yn;
|
|
988
|
+
return ((s, a) => {
|
|
989
|
+
const u = s;
|
|
990
|
+
let f = u.pow(a, c), g = u.mul(f, n);
|
|
991
|
+
const m = u.mul(f, o), w = u.mul(f, i), A = u.eql(u.sqr(g), a), _ = u.eql(u.sqr(m), a);
|
|
992
|
+
f = u.cmov(f, g, A), g = u.cmov(w, m, _);
|
|
993
|
+
const H = u.eql(u.sqr(g), a), O = u.cmov(f, g, H);
|
|
994
|
+
return me(u, O, a), O;
|
|
995
|
+
});
|
|
906
996
|
}
|
|
907
997
|
function mn(t) {
|
|
908
|
-
if (t <
|
|
909
|
-
let e = t -
|
|
910
|
-
for (; e %
|
|
911
|
-
e /=
|
|
912
|
-
let n =
|
|
913
|
-
const o =
|
|
914
|
-
for (;
|
|
915
|
-
if (r === 1) return
|
|
916
|
-
let
|
|
917
|
-
const
|
|
918
|
-
return function(
|
|
919
|
-
|
|
920
|
-
if (
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
998
|
+
if (t < gn) throw new Error("sqrt is not defined for small field");
|
|
999
|
+
let e = t - D, r = 0;
|
|
1000
|
+
for (; e % pt === K; )
|
|
1001
|
+
e /= pt, r++;
|
|
1002
|
+
let n = pt;
|
|
1003
|
+
const o = jt(t);
|
|
1004
|
+
for (; Fe(o, n) === 1; ) if (n++ > 1e3) throw new Error("Cannot find square root: probably non-prime P");
|
|
1005
|
+
if (r === 1) return En;
|
|
1006
|
+
let i = o.pow(n, e);
|
|
1007
|
+
const c = (e + D) / pt;
|
|
1008
|
+
return function(a, u) {
|
|
1009
|
+
const f = a;
|
|
1010
|
+
if (f.is0(u)) return u;
|
|
1011
|
+
if (Fe(f, u) !== 1) throw new Error("Cannot find square root");
|
|
1012
|
+
let g = r, m = f.mul(f.ONE, i), w = f.pow(u, e), A = f.pow(u, c);
|
|
1013
|
+
for (; !f.eql(w, f.ONE); ) {
|
|
1014
|
+
if (f.is0(w)) return f.ZERO;
|
|
1015
|
+
let _ = 1, H = f.sqr(w);
|
|
1016
|
+
for (; !f.eql(H, f.ONE); )
|
|
1017
|
+
if (_++, H = f.sqr(H), _ === g) throw new Error("Cannot find square root");
|
|
1018
|
+
const O = D << BigInt(g - _ - 1), x = f.pow(m, O);
|
|
1019
|
+
g = _, m = f.sqr(x), w = f.mul(w, m), A = f.mul(A, x);
|
|
1020
|
+
}
|
|
1021
|
+
return A;
|
|
931
1022
|
};
|
|
932
1023
|
}
|
|
933
|
-
function
|
|
934
|
-
return t %
|
|
1024
|
+
function er(t) {
|
|
1025
|
+
return t % bn === gn ? En : t % pn === wn ? Pn : t % yn === Jn ? tr(t) : mn(t);
|
|
935
1026
|
}
|
|
936
|
-
var
|
|
1027
|
+
var nr = [
|
|
937
1028
|
"create",
|
|
938
1029
|
"isValid",
|
|
939
1030
|
"is0",
|
|
@@ -952,96 +1043,104 @@ var er = [
|
|
|
952
1043
|
"mulN",
|
|
953
1044
|
"sqrN"
|
|
954
1045
|
];
|
|
955
|
-
function
|
|
956
|
-
|
|
1046
|
+
function rr(t) {
|
|
1047
|
+
if (kt(t, nr.reduce((e, r) => (e[r] = "function", e), {
|
|
957
1048
|
ORDER: "bigint",
|
|
958
1049
|
BYTES: "number",
|
|
959
1050
|
BITS: "number"
|
|
960
|
-
})), t;
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
if (r < J) throw new Error("invalid exponent, negatives unsupported");
|
|
964
|
-
if (r === J) return t.ONE;
|
|
965
|
-
if (r === W) return e;
|
|
966
|
-
let n = t.ONE, o = e;
|
|
967
|
-
for (; r > J; )
|
|
968
|
-
r & W && (n = t.mul(n, o)), o = t.sqr(o), r >>= W;
|
|
969
|
-
return n;
|
|
970
|
-
}
|
|
971
|
-
function Ft(t, e, r = !1) {
|
|
972
|
-
const n = new Array(e.length).fill(r ? t.ZERO : void 0), o = e.reduce((i, c, f) => t.is0(c) ? i : (n[f] = i, t.mul(i, c)), t.ONE), s = t.inv(o);
|
|
973
|
-
return e.reduceRight((i, c, f) => t.is0(c) ? i : (n[f] = t.mul(i, n[f]), t.mul(i, c)), s), n;
|
|
974
|
-
}
|
|
975
|
-
function Ce(t, e) {
|
|
976
|
-
const r = (t.ORDER - W) / vt, n = t.pow(e, r), o = t.eql(n, t.ONE), s = t.eql(n, t.ZERO), i = t.eql(n, t.neg(t.ONE));
|
|
977
|
-
if (!o && !s && !i) throw new Error("invalid Legendre symbol result");
|
|
978
|
-
return o ? 1 : s ? 0 : -1;
|
|
1051
|
+
})), fe(t.BYTES, "BYTES"), fe(t.BITS, "BITS"), t.BYTES < 1 || t.BITS < 1) throw new Error("invalid field: expected BYTES/BITS > 0");
|
|
1052
|
+
if (t.ORDER <= D) throw new Error("invalid field: expected ORDER > 1, got " + t.ORDER);
|
|
1053
|
+
return t;
|
|
979
1054
|
}
|
|
980
|
-
function
|
|
981
|
-
|
|
982
|
-
|
|
1055
|
+
function or(t, e, r) {
|
|
1056
|
+
const n = t;
|
|
1057
|
+
if (r < K) throw new Error("invalid exponent, negatives unsupported");
|
|
1058
|
+
if (r === K) return n.ONE;
|
|
1059
|
+
if (r === D) return e;
|
|
1060
|
+
let o = n.ONE, i = e;
|
|
1061
|
+
for (; r > K; )
|
|
1062
|
+
r & D && (o = n.mul(o, i)), i = n.sqr(i), r >>= D;
|
|
1063
|
+
return o;
|
|
1064
|
+
}
|
|
1065
|
+
function vn(t, e, r = !1) {
|
|
1066
|
+
const n = t, o = new Array(e.length).fill(r ? n.ZERO : void 0), i = e.reduce((s, a, u) => n.is0(a) ? s : (o[u] = s, n.mul(s, a)), n.ONE), c = n.inv(i);
|
|
1067
|
+
return e.reduceRight((s, a, u) => n.is0(a) ? s : (o[u] = n.mul(s, o[u]), n.mul(s, a)), c), o;
|
|
1068
|
+
}
|
|
1069
|
+
function Fe(t, e) {
|
|
1070
|
+
const r = t, n = (r.ORDER - D) / pt, o = r.pow(e, n), i = r.eql(o, r.ONE), c = r.eql(o, r.ZERO), s = r.eql(o, r.neg(r.ONE));
|
|
1071
|
+
if (!i && !c && !s) throw new Error("invalid Legendre symbol result");
|
|
1072
|
+
return i ? 1 : c ? 0 : -1;
|
|
1073
|
+
}
|
|
1074
|
+
function ir(t, e) {
|
|
1075
|
+
if (e !== void 0 && sn(e), t <= K) throw new Error("invalid n length: expected positive n, got " + t);
|
|
1076
|
+
if (e !== void 0 && e < 1) throw new Error("invalid n length: expected positive bit length, got " + e);
|
|
1077
|
+
const r = ye(t);
|
|
1078
|
+
if (e !== void 0 && e < r) throw new Error(`invalid n length: expected bit length (${r}) >= n.length (${e})`);
|
|
1079
|
+
const n = e !== void 0 ? e : r;
|
|
983
1080
|
return {
|
|
984
|
-
nBitLength:
|
|
985
|
-
nByteLength: Math.ceil(
|
|
1081
|
+
nBitLength: n,
|
|
1082
|
+
nByteLength: Math.ceil(n / 8)
|
|
986
1083
|
};
|
|
987
1084
|
}
|
|
988
|
-
var
|
|
1085
|
+
var Le = /* @__PURE__ */ new WeakMap(), xn = class {
|
|
989
1086
|
ORDER;
|
|
990
1087
|
BITS;
|
|
991
1088
|
BYTES;
|
|
992
1089
|
isLE;
|
|
993
|
-
ZERO =
|
|
994
|
-
ONE =
|
|
1090
|
+
ZERO = K;
|
|
1091
|
+
ONE = D;
|
|
995
1092
|
_lengths;
|
|
996
|
-
_sqrt;
|
|
997
1093
|
_mod;
|
|
998
1094
|
constructor(t, e = {}) {
|
|
999
|
-
if (t <=
|
|
1095
|
+
if (t <= D) throw new Error("invalid field: expected ORDER > 1, got " + t);
|
|
1000
1096
|
let r;
|
|
1001
|
-
this.isLE = !1, e != null && typeof e == "object" && (typeof e.BITS == "number" && (r = e.BITS), typeof e.sqrt == "function" && (this
|
|
1002
|
-
|
|
1097
|
+
this.isLE = !1, e != null && typeof e == "object" && (typeof e.BITS == "number" && (r = e.BITS), typeof e.sqrt == "function" && Object.defineProperty(this, "sqrt", {
|
|
1098
|
+
value: e.sqrt,
|
|
1099
|
+
enumerable: !0
|
|
1100
|
+
}), typeof e.isLE == "boolean" && (this.isLE = e.isLE), e.allowedLengths && (this._lengths = Object.freeze(e.allowedLengths.slice())), typeof e.modFromBytes == "boolean" && (this._mod = e.modFromBytes));
|
|
1101
|
+
const { nBitLength: n, nByteLength: o } = ir(t, r);
|
|
1003
1102
|
if (o > 2048) throw new Error("invalid field: expected ORDER of <= 2048 bytes");
|
|
1004
|
-
this.ORDER = t, this.BITS = n, this.BYTES = o,
|
|
1103
|
+
this.ORDER = t, this.BITS = n, this.BYTES = o, Object.freeze(this);
|
|
1005
1104
|
}
|
|
1006
1105
|
create(t) {
|
|
1007
|
-
return
|
|
1106
|
+
return tt(t, this.ORDER);
|
|
1008
1107
|
}
|
|
1009
1108
|
isValid(t) {
|
|
1010
|
-
if (typeof t != "bigint") throw new
|
|
1011
|
-
return
|
|
1109
|
+
if (typeof t != "bigint") throw new TypeError("invalid field element: expected bigint, got " + typeof t);
|
|
1110
|
+
return K <= t && t < this.ORDER;
|
|
1012
1111
|
}
|
|
1013
1112
|
is0(t) {
|
|
1014
|
-
return t ===
|
|
1113
|
+
return t === K;
|
|
1015
1114
|
}
|
|
1016
1115
|
isValidNot0(t) {
|
|
1017
1116
|
return !this.is0(t) && this.isValid(t);
|
|
1018
1117
|
}
|
|
1019
1118
|
isOdd(t) {
|
|
1020
|
-
return (t &
|
|
1119
|
+
return (t & D) === D;
|
|
1021
1120
|
}
|
|
1022
1121
|
neg(t) {
|
|
1023
|
-
return
|
|
1122
|
+
return tt(-t, this.ORDER);
|
|
1024
1123
|
}
|
|
1025
1124
|
eql(t, e) {
|
|
1026
1125
|
return t === e;
|
|
1027
1126
|
}
|
|
1028
1127
|
sqr(t) {
|
|
1029
|
-
return
|
|
1128
|
+
return tt(t * t, this.ORDER);
|
|
1030
1129
|
}
|
|
1031
1130
|
add(t, e) {
|
|
1032
|
-
return
|
|
1131
|
+
return tt(t + e, this.ORDER);
|
|
1033
1132
|
}
|
|
1034
1133
|
sub(t, e) {
|
|
1035
|
-
return
|
|
1134
|
+
return tt(t - e, this.ORDER);
|
|
1036
1135
|
}
|
|
1037
1136
|
mul(t, e) {
|
|
1038
|
-
return
|
|
1137
|
+
return tt(t * e, this.ORDER);
|
|
1039
1138
|
}
|
|
1040
1139
|
pow(t, e) {
|
|
1041
|
-
return
|
|
1140
|
+
return or(this, t, e);
|
|
1042
1141
|
}
|
|
1043
1142
|
div(t, e) {
|
|
1044
|
-
return
|
|
1143
|
+
return tt(t * Ie(e, this.ORDER), this.ORDER);
|
|
1045
1144
|
}
|
|
1046
1145
|
sqrN(t) {
|
|
1047
1146
|
return t * t;
|
|
@@ -1056,100 +1155,102 @@ var or = class {
|
|
|
1056
1155
|
return t * e;
|
|
1057
1156
|
}
|
|
1058
1157
|
inv(t) {
|
|
1059
|
-
return
|
|
1158
|
+
return Ie(t, this.ORDER);
|
|
1060
1159
|
}
|
|
1061
1160
|
sqrt(t) {
|
|
1062
|
-
|
|
1161
|
+
let e = Le.get(this);
|
|
1162
|
+
return e || Le.set(this, e = er(this.ORDER)), e(this, t);
|
|
1063
1163
|
}
|
|
1064
1164
|
toBytes(t) {
|
|
1065
|
-
return this.isLE ?
|
|
1165
|
+
return this.isLE ? hn(t, this.BYTES) : pe(t, this.BYTES);
|
|
1066
1166
|
}
|
|
1067
1167
|
fromBytes(t, e = !1) {
|
|
1068
|
-
|
|
1069
|
-
const { _lengths: r, BYTES: n, isLE: o, ORDER:
|
|
1168
|
+
W(t);
|
|
1169
|
+
const { _lengths: r, BYTES: n, isLE: o, ORDER: i, _mod: c } = this;
|
|
1070
1170
|
if (r) {
|
|
1071
|
-
if (!r.includes(t.length) || t.length > n) throw new Error("Field.fromBytes: expected " + r + " bytes, got " + t.length);
|
|
1072
|
-
const
|
|
1073
|
-
|
|
1171
|
+
if (t.length < 1 || !r.includes(t.length) || t.length > n) throw new Error("Field.fromBytes: expected " + r + " bytes, got " + t.length);
|
|
1172
|
+
const a = new Uint8Array(n);
|
|
1173
|
+
a.set(t, o ? 0 : a.length - t.length), t = a;
|
|
1074
1174
|
}
|
|
1075
1175
|
if (t.length !== n) throw new Error("Field.fromBytes: expected " + n + " bytes, got " + t.length);
|
|
1076
|
-
let
|
|
1077
|
-
if (
|
|
1176
|
+
let s = o ? ln(t) : Ct(t);
|
|
1177
|
+
if (c && (s = tt(s, i)), !e && !this.isValid(s))
|
|
1078
1178
|
throw new Error("invalid field element: outside of range 0..ORDER");
|
|
1079
|
-
return
|
|
1179
|
+
return s;
|
|
1080
1180
|
}
|
|
1081
1181
|
invertBatch(t) {
|
|
1082
|
-
return
|
|
1182
|
+
return vn(this, t);
|
|
1083
1183
|
}
|
|
1084
1184
|
cmov(t, e, r) {
|
|
1085
|
-
return r ? e : t;
|
|
1185
|
+
return Ot(r, "condition"), r ? e : t;
|
|
1086
1186
|
}
|
|
1087
1187
|
};
|
|
1088
|
-
|
|
1089
|
-
|
|
1188
|
+
Object.freeze(xn.prototype);
|
|
1189
|
+
function jt(t, e = {}) {
|
|
1190
|
+
return new xn(t, e);
|
|
1090
1191
|
}
|
|
1091
|
-
function
|
|
1192
|
+
function Bn(t) {
|
|
1092
1193
|
if (typeof t != "bigint") throw new Error("field order must be bigint");
|
|
1093
|
-
|
|
1194
|
+
if (t <= D) throw new Error("field order must be greater than 1");
|
|
1195
|
+
const e = ye(t - D);
|
|
1094
1196
|
return Math.ceil(e / 8);
|
|
1095
1197
|
}
|
|
1096
|
-
function
|
|
1097
|
-
const e =
|
|
1198
|
+
function An(t) {
|
|
1199
|
+
const e = Bn(t);
|
|
1098
1200
|
return e + Math.ceil(e / 2);
|
|
1099
1201
|
}
|
|
1100
1202
|
function sr(t, e, r = !1) {
|
|
1101
|
-
|
|
1102
|
-
const n = t.length, o =
|
|
1103
|
-
if (n <
|
|
1104
|
-
const
|
|
1105
|
-
return r ?
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
function Gt(t, e) {
|
|
1203
|
+
W(t);
|
|
1204
|
+
const n = t.length, o = Bn(e), i = Math.max(An(e), 16);
|
|
1205
|
+
if (n < i || n > 1024) throw new Error("expected " + i + "-1024 bytes of input, got " + n);
|
|
1206
|
+
const c = tt(r ? ln(t) : Ct(t), e - D) + D;
|
|
1207
|
+
return r ? hn(c, o) : pe(c, o);
|
|
1208
|
+
}
|
|
1209
|
+
var At = /* @__PURE__ */ BigInt(0), yt = /* @__PURE__ */ BigInt(1);
|
|
1210
|
+
function Zt(t, e) {
|
|
1110
1211
|
const r = e.negate();
|
|
1111
1212
|
return t ? r : e;
|
|
1112
1213
|
}
|
|
1113
|
-
function
|
|
1114
|
-
const r =
|
|
1214
|
+
function Ne(t, e) {
|
|
1215
|
+
const r = vn(t.Fp, e.map((n) => n.Z));
|
|
1115
1216
|
return e.map((n, o) => t.fromAffine(n.toAffine(r[o])));
|
|
1116
1217
|
}
|
|
1117
|
-
function
|
|
1218
|
+
function Rn(t, e) {
|
|
1118
1219
|
if (!Number.isSafeInteger(t) || t <= 0 || t > e) throw new Error("invalid window size, expected [1.." + e + "], got W=" + t);
|
|
1119
1220
|
}
|
|
1120
|
-
function
|
|
1121
|
-
|
|
1221
|
+
function Mt(t, e) {
|
|
1222
|
+
Rn(t, e);
|
|
1122
1223
|
const r = Math.ceil(e / t) + 1, n = 2 ** (t - 1), o = 2 ** t;
|
|
1123
1224
|
return {
|
|
1124
1225
|
windows: r,
|
|
1125
1226
|
windowSize: n,
|
|
1126
|
-
mask:
|
|
1227
|
+
mask: Ee(t),
|
|
1127
1228
|
maxNumber: o,
|
|
1128
1229
|
shiftBy: BigInt(t)
|
|
1129
1230
|
};
|
|
1130
1231
|
}
|
|
1131
|
-
function
|
|
1132
|
-
const { windowSize: n, mask: o, maxNumber:
|
|
1133
|
-
let
|
|
1134
|
-
|
|
1135
|
-
const
|
|
1232
|
+
function Te(t, e, r) {
|
|
1233
|
+
const { windowSize: n, mask: o, maxNumber: i, shiftBy: c } = r;
|
|
1234
|
+
let s = Number(t & o), a = t >> c;
|
|
1235
|
+
s > n && (s -= i, a += yt);
|
|
1236
|
+
const u = e * n, f = u + Math.abs(s) - 1, g = s === 0, m = s < 0, w = e % 2 !== 0;
|
|
1136
1237
|
return {
|
|
1137
|
-
nextN:
|
|
1138
|
-
offset:
|
|
1238
|
+
nextN: a,
|
|
1239
|
+
offset: f,
|
|
1139
1240
|
isZero: g,
|
|
1140
|
-
isNeg:
|
|
1241
|
+
isNeg: m,
|
|
1141
1242
|
isNegF: w,
|
|
1142
|
-
offsetF:
|
|
1243
|
+
offsetF: u
|
|
1143
1244
|
};
|
|
1144
1245
|
}
|
|
1145
|
-
var
|
|
1146
|
-
function
|
|
1147
|
-
return
|
|
1246
|
+
var Gt = /* @__PURE__ */ new WeakMap(), Sn = /* @__PURE__ */ new WeakMap();
|
|
1247
|
+
function Kt(t) {
|
|
1248
|
+
return Sn.get(t) || 1;
|
|
1148
1249
|
}
|
|
1149
|
-
function
|
|
1150
|
-
if (t !==
|
|
1250
|
+
function Ue(t) {
|
|
1251
|
+
if (t !== At) throw new Error("invalid wNAF");
|
|
1151
1252
|
}
|
|
1152
|
-
var
|
|
1253
|
+
var cr = class {
|
|
1153
1254
|
BASE;
|
|
1154
1255
|
ZERO;
|
|
1155
1256
|
Fn;
|
|
@@ -1159,103 +1260,103 @@ var ir = class {
|
|
|
1159
1260
|
}
|
|
1160
1261
|
_unsafeLadder(t, e, r = this.ZERO) {
|
|
1161
1262
|
let n = t;
|
|
1162
|
-
for (; e >
|
|
1163
|
-
e &
|
|
1263
|
+
for (; e > At; )
|
|
1264
|
+
e & yt && (r = r.add(n)), n = n.double(), e >>= yt;
|
|
1164
1265
|
return r;
|
|
1165
1266
|
}
|
|
1166
1267
|
precomputeWindow(t, e) {
|
|
1167
|
-
const { windows: r, windowSize: n } =
|
|
1168
|
-
let
|
|
1169
|
-
for (let
|
|
1170
|
-
|
|
1171
|
-
for (let
|
|
1172
|
-
|
|
1173
|
-
|
|
1268
|
+
const { windows: r, windowSize: n } = Mt(e, this.bits), o = [];
|
|
1269
|
+
let i = t, c = i;
|
|
1270
|
+
for (let s = 0; s < r; s++) {
|
|
1271
|
+
c = i, o.push(c);
|
|
1272
|
+
for (let a = 1; a < n; a++)
|
|
1273
|
+
c = c.add(i), o.push(c);
|
|
1274
|
+
i = c.double();
|
|
1174
1275
|
}
|
|
1175
1276
|
return o;
|
|
1176
1277
|
}
|
|
1177
1278
|
wNAF(t, e, r) {
|
|
1178
1279
|
if (!this.Fn.isValid(r)) throw new Error("invalid scalar");
|
|
1179
1280
|
let n = this.ZERO, o = this.BASE;
|
|
1180
|
-
const
|
|
1181
|
-
for (let
|
|
1182
|
-
const { nextN:
|
|
1183
|
-
r =
|
|
1281
|
+
const i = Mt(t, this.bits);
|
|
1282
|
+
for (let c = 0; c < i.windows; c++) {
|
|
1283
|
+
const { nextN: s, offset: a, isZero: u, isNeg: f, isNegF: g, offsetF: m } = Te(r, c, i);
|
|
1284
|
+
r = s, u ? o = o.add(Zt(g, e[m])) : n = n.add(Zt(f, e[a]));
|
|
1184
1285
|
}
|
|
1185
|
-
return
|
|
1286
|
+
return Ue(r), {
|
|
1186
1287
|
p: n,
|
|
1187
1288
|
f: o
|
|
1188
1289
|
};
|
|
1189
1290
|
}
|
|
1190
1291
|
wNAFUnsafe(t, e, r, n = this.ZERO) {
|
|
1191
|
-
const o =
|
|
1192
|
-
for (let
|
|
1193
|
-
const { nextN:
|
|
1194
|
-
if (r =
|
|
1195
|
-
const
|
|
1196
|
-
n = n.add(
|
|
1292
|
+
const o = Mt(t, this.bits);
|
|
1293
|
+
for (let i = 0; i < o.windows && r !== At; i++) {
|
|
1294
|
+
const { nextN: c, offset: s, isZero: a, isNeg: u } = Te(r, i, o);
|
|
1295
|
+
if (r = c, !a) {
|
|
1296
|
+
const f = e[s];
|
|
1297
|
+
n = n.add(u ? f.negate() : f);
|
|
1197
1298
|
}
|
|
1198
1299
|
}
|
|
1199
|
-
return
|
|
1300
|
+
return Ue(r), n;
|
|
1200
1301
|
}
|
|
1201
1302
|
getPrecomputes(t, e, r) {
|
|
1202
|
-
let n =
|
|
1203
|
-
return n || (n = this.precomputeWindow(e, t), t !== 1 && (typeof r == "function" && (n = r(n)),
|
|
1303
|
+
let n = Gt.get(e);
|
|
1304
|
+
return n || (n = this.precomputeWindow(e, t), t !== 1 && (typeof r == "function" && (n = r(n)), Gt.set(e, n))), n;
|
|
1204
1305
|
}
|
|
1205
1306
|
cached(t, e, r) {
|
|
1206
|
-
const n =
|
|
1307
|
+
const n = Kt(t);
|
|
1207
1308
|
return this.wNAF(n, this.getPrecomputes(n, t, r), e);
|
|
1208
1309
|
}
|
|
1209
1310
|
unsafe(t, e, r, n) {
|
|
1210
|
-
const o =
|
|
1311
|
+
const o = Kt(t);
|
|
1211
1312
|
return o === 1 ? this._unsafeLadder(t, e, n) : this.wNAFUnsafe(o, this.getPrecomputes(o, t, r), e, n);
|
|
1212
1313
|
}
|
|
1213
1314
|
createCache(t, e) {
|
|
1214
|
-
|
|
1315
|
+
Rn(e, this.bits), Sn.set(t, e), Gt.delete(t);
|
|
1215
1316
|
}
|
|
1216
1317
|
hasCache(t) {
|
|
1217
|
-
return
|
|
1318
|
+
return Kt(t) !== 1;
|
|
1218
1319
|
}
|
|
1219
1320
|
};
|
|
1220
|
-
function
|
|
1221
|
-
let o = e,
|
|
1222
|
-
for (; r >
|
|
1223
|
-
r &
|
|
1321
|
+
function fr(t, e, r, n) {
|
|
1322
|
+
let o = e, i = t.ZERO, c = t.ZERO;
|
|
1323
|
+
for (; r > At || n > At; )
|
|
1324
|
+
r & yt && (i = i.add(o)), n & yt && (c = c.add(o)), o = o.double(), r >>= yt, n >>= yt;
|
|
1224
1325
|
return {
|
|
1225
|
-
p1:
|
|
1226
|
-
p2:
|
|
1326
|
+
p1: i,
|
|
1327
|
+
p2: c
|
|
1227
1328
|
};
|
|
1228
1329
|
}
|
|
1229
|
-
function
|
|
1330
|
+
function $e(t, e, r) {
|
|
1230
1331
|
if (e) {
|
|
1231
1332
|
if (e.ORDER !== t) throw new Error("Field.ORDER must match order: Fp == p, Fn == n");
|
|
1232
|
-
return
|
|
1233
|
-
} else return
|
|
1333
|
+
return rr(e), e;
|
|
1334
|
+
} else return jt(t, { isLE: r });
|
|
1234
1335
|
}
|
|
1235
|
-
function
|
|
1336
|
+
function ar(t, e, r = {}, n) {
|
|
1236
1337
|
if (n === void 0 && (n = t === "edwards"), !e || typeof e != "object") throw new Error(`expected valid ${t} CURVE object`);
|
|
1237
|
-
for (const
|
|
1338
|
+
for (const s of [
|
|
1238
1339
|
"p",
|
|
1239
1340
|
"n",
|
|
1240
1341
|
"h"
|
|
1241
1342
|
]) {
|
|
1242
|
-
const
|
|
1243
|
-
if (!(typeof
|
|
1343
|
+
const a = e[s];
|
|
1344
|
+
if (!(typeof a == "bigint" && a > At)) throw new Error(`CURVE.${s} must be positive bigint`);
|
|
1244
1345
|
}
|
|
1245
|
-
const o =
|
|
1346
|
+
const o = $e(e.p, r.Fp, n), i = $e(e.n, r.Fn, n), c = [
|
|
1246
1347
|
"Gx",
|
|
1247
1348
|
"Gy",
|
|
1248
1349
|
"a",
|
|
1249
1350
|
t === "weierstrass" ? "b" : "d"
|
|
1250
1351
|
];
|
|
1251
|
-
for (const
|
|
1352
|
+
for (const s of c) if (!o.isValid(e[s])) throw new Error(`CURVE.${s} must be valid field element of CURVE.Fp`);
|
|
1252
1353
|
return e = Object.freeze(Object.assign({}, e)), {
|
|
1253
1354
|
CURVE: e,
|
|
1254
1355
|
Fp: o,
|
|
1255
|
-
Fn:
|
|
1356
|
+
Fn: i
|
|
1256
1357
|
};
|
|
1257
1358
|
}
|
|
1258
|
-
function
|
|
1359
|
+
function ur(t, e) {
|
|
1259
1360
|
return function(n) {
|
|
1260
1361
|
const o = t(n);
|
|
1261
1362
|
return {
|
|
@@ -1264,136 +1365,25 @@ function ar(t, e) {
|
|
|
1264
1365
|
};
|
|
1265
1366
|
};
|
|
1266
1367
|
}
|
|
1267
|
-
Pt();
|
|
1268
|
-
var lr = Dt;
|
|
1269
|
-
function bt(t, e) {
|
|
1270
|
-
if (Rt(t), Rt(e), t < 0 || t >= 1 << 8 * e) throw new Error("invalid I2OSP input: " + t);
|
|
1271
|
-
const r = Array.from({ length: e }).fill(0);
|
|
1272
|
-
for (let n = e - 1; n >= 0; n--)
|
|
1273
|
-
r[n] = t & 255, t >>>= 8;
|
|
1274
|
-
return new Uint8Array(r);
|
|
1275
|
-
}
|
|
1276
|
-
function ur(t, e) {
|
|
1277
|
-
const r = new Uint8Array(t.length);
|
|
1278
|
-
for (let n = 0; n < t.length; n++) r[n] = t[n] ^ e[n];
|
|
1279
|
-
return r;
|
|
1280
|
-
}
|
|
1281
|
-
function Bn(t) {
|
|
1282
|
-
if (!Kt(t) && typeof t != "string") throw new Error("DST must be Uint8Array or ascii string");
|
|
1283
|
-
return typeof t == "string" ? Wt(t) : t;
|
|
1284
|
-
}
|
|
1285
|
-
function dr(t, e, r, n) {
|
|
1286
|
-
C(t), Rt(r), e = Bn(e), e.length > 255 && (e = n(P(Wt("H2C-OVERSIZE-DST-"), e)));
|
|
1287
|
-
const { outputLen: o, blockLen: s } = n, i = Math.ceil(r / o);
|
|
1288
|
-
if (r > 65535 || i > 255) throw new Error("expand_message_xmd: invalid lenInBytes");
|
|
1289
|
-
const c = P(e, bt(e.length, 1)), f = bt(0, s), l = bt(r, 2), a = new Array(i), g = n(P(f, t, l, bt(0, 1), c));
|
|
1290
|
-
a[0] = n(P(g, bt(1, 1), c));
|
|
1291
|
-
for (let b = 1; b <= i; b++) a[b] = n(P(ur(g, a[b - 1]), bt(b + 1, 1), c));
|
|
1292
|
-
return P(...a).slice(0, r);
|
|
1293
|
-
}
|
|
1294
|
-
function hr(t, e, r, n, o) {
|
|
1295
|
-
if (C(t), Rt(r), e = Bn(e), e.length > 255) {
|
|
1296
|
-
const s = Math.ceil(2 * n / 8);
|
|
1297
|
-
e = o.create({ dkLen: s }).update(Wt("H2C-OVERSIZE-DST-")).update(e).digest();
|
|
1298
|
-
}
|
|
1299
|
-
if (r > 65535 || e.length > 255) throw new Error("expand_message_xof: invalid lenInBytes");
|
|
1300
|
-
return o.create({ dkLen: r }).update(t).update(bt(r, 2)).update(e).update(bt(e.length, 1)).digest();
|
|
1301
|
-
}
|
|
1302
|
-
function ce(t, e, r) {
|
|
1303
|
-
Qt(r, {
|
|
1304
|
-
p: "bigint",
|
|
1305
|
-
m: "number",
|
|
1306
|
-
k: "number",
|
|
1307
|
-
hash: "function"
|
|
1308
|
-
});
|
|
1309
|
-
const { p: n, k: o, m: s, hash: i, expand: c, DST: f } = r;
|
|
1310
|
-
Rt(i.outputLen, "valid hash"), C(t), Rt(e);
|
|
1311
|
-
const l = n.toString(2).length, a = Math.ceil((l + o) / 8), g = e * s * a;
|
|
1312
|
-
let b;
|
|
1313
|
-
if (c === "xmd") b = dr(t, f, g, i);
|
|
1314
|
-
else if (c === "xof") b = hr(t, f, g, o, i);
|
|
1315
|
-
else if (c === "_internal_pass") b = t;
|
|
1316
|
-
else throw new Error('expand must be "xmd" or "xof"');
|
|
1317
|
-
const w = new Array(e);
|
|
1318
|
-
for (let m = 0; m < e; m++) {
|
|
1319
|
-
const x = new Array(s);
|
|
1320
|
-
for (let v = 0; v < s; v++) {
|
|
1321
|
-
const B = a * (v + m * s);
|
|
1322
|
-
x[v] = et(lr(b.subarray(B, B + a)), n);
|
|
1323
|
-
}
|
|
1324
|
-
w[m] = x;
|
|
1325
|
-
}
|
|
1326
|
-
return w;
|
|
1327
|
-
}
|
|
1328
|
-
function br(t, e) {
|
|
1329
|
-
const r = e.map((n) => Array.from(n).reverse());
|
|
1330
|
-
return (n, o) => {
|
|
1331
|
-
const [s, i, c, f] = r.map((g) => g.reduce((b, w) => t.add(t.mul(b, n), w))), [l, a] = Ft(t, [i, f], !0);
|
|
1332
|
-
return n = t.mul(s, l), o = t.mul(o, t.mul(c, a)), {
|
|
1333
|
-
x: n,
|
|
1334
|
-
y: o
|
|
1335
|
-
};
|
|
1336
|
-
};
|
|
1337
|
-
}
|
|
1338
|
-
var wr = Wt("HashToScalar-");
|
|
1339
|
-
function gr(t, e, r) {
|
|
1340
|
-
if (typeof e != "function") throw new Error("mapToCurve() must be defined");
|
|
1341
|
-
function n(s) {
|
|
1342
|
-
return t.fromAffine(e(s));
|
|
1343
|
-
}
|
|
1344
|
-
function o(s) {
|
|
1345
|
-
const i = s.clearCofactor();
|
|
1346
|
-
return i.equals(t.ZERO) ? t.ZERO : (i.assertValidity(), i);
|
|
1347
|
-
}
|
|
1348
|
-
return {
|
|
1349
|
-
defaults: Object.freeze(r),
|
|
1350
|
-
Point: t,
|
|
1351
|
-
hashToCurve(s, i) {
|
|
1352
|
-
const c = ce(s, 2, Object.assign({}, r, i)), f = n(c[0]), l = n(c[1]);
|
|
1353
|
-
return o(f.add(l));
|
|
1354
|
-
},
|
|
1355
|
-
encodeToCurve(s, i) {
|
|
1356
|
-
const c = r.encodeDST ? { DST: r.encodeDST } : {};
|
|
1357
|
-
return o(n(ce(s, 1, Object.assign({}, r, c, i))[0]));
|
|
1358
|
-
},
|
|
1359
|
-
mapToCurve(s) {
|
|
1360
|
-
if (r.m === 1) {
|
|
1361
|
-
if (typeof s != "bigint") throw new Error("expected bigint (m=1)");
|
|
1362
|
-
return o(n([s]));
|
|
1363
|
-
}
|
|
1364
|
-
if (!Array.isArray(s)) throw new Error("expected array of bigints");
|
|
1365
|
-
for (const i of s) if (typeof i != "bigint") throw new Error("expected array of bigints");
|
|
1366
|
-
return o(n(s));
|
|
1367
|
-
},
|
|
1368
|
-
hashToScalar(s, i) {
|
|
1369
|
-
const c = t.Fn.ORDER;
|
|
1370
|
-
return ce(s, 1, Object.assign({}, r, {
|
|
1371
|
-
p: c,
|
|
1372
|
-
m: 1,
|
|
1373
|
-
DST: wr
|
|
1374
|
-
}, i))[0][0];
|
|
1375
|
-
}
|
|
1376
|
-
};
|
|
1377
|
-
}
|
|
1378
1368
|
Ln();
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
const [[n, o], [
|
|
1384
|
-
let
|
|
1385
|
-
const g =
|
|
1386
|
-
g && (
|
|
1387
|
-
const w =
|
|
1388
|
-
if (
|
|
1369
|
+
It();
|
|
1370
|
+
var De = (t, e) => (t + (t >= 0 ? e : -e) / _n) / e;
|
|
1371
|
+
function lr(t, e, r) {
|
|
1372
|
+
dn("scalar", t, ot, r);
|
|
1373
|
+
const [[n, o], [i, c]] = e, s = De(c * t, r), a = De(-o * t, r);
|
|
1374
|
+
let u = t - s * n - a * i, f = -s * o - a * c;
|
|
1375
|
+
const g = u < ot, m = f < ot;
|
|
1376
|
+
g && (u = -u), m && (f = -f);
|
|
1377
|
+
const w = Ee(Math.ceil(ye(r) / 2)) + ht;
|
|
1378
|
+
if (u < ot || u >= w || f < ot || f >= w) throw new Error("splitScalar (endomorphism): failed for k");
|
|
1389
1379
|
return {
|
|
1390
1380
|
k1neg: g,
|
|
1391
|
-
k1:
|
|
1392
|
-
k2neg:
|
|
1393
|
-
k2:
|
|
1381
|
+
k1: u,
|
|
1382
|
+
k2neg: m,
|
|
1383
|
+
k2: f
|
|
1394
1384
|
};
|
|
1395
1385
|
}
|
|
1396
|
-
function
|
|
1386
|
+
function ae(t) {
|
|
1397
1387
|
if (![
|
|
1398
1388
|
"compact",
|
|
1399
1389
|
"recovered",
|
|
@@ -1401,88 +1391,96 @@ function Ee(t) {
|
|
|
1401
1391
|
].includes(t)) throw new Error('Signature format must be "compact", "recovered", or "der"');
|
|
1402
1392
|
return t;
|
|
1403
1393
|
}
|
|
1404
|
-
function
|
|
1394
|
+
function Xt(t, e) {
|
|
1395
|
+
kt(t);
|
|
1405
1396
|
const r = {};
|
|
1406
1397
|
for (let n of Object.keys(e)) r[n] = t[n] === void 0 ? e[n] : t[n];
|
|
1407
|
-
return
|
|
1398
|
+
return Ot(r.lowS, "lowS"), Ot(r.prehash, "prehash"), r.format !== void 0 && ae(r.format), r;
|
|
1408
1399
|
}
|
|
1409
|
-
var
|
|
1400
|
+
var hr = class extends Error {
|
|
1410
1401
|
constructor(t = "") {
|
|
1411
1402
|
super(t);
|
|
1412
1403
|
}
|
|
1413
|
-
},
|
|
1414
|
-
Err:
|
|
1404
|
+
}, et = {
|
|
1405
|
+
Err: hr,
|
|
1415
1406
|
_tlv: {
|
|
1416
1407
|
encode: (t, e) => {
|
|
1417
|
-
const { Err: r } =
|
|
1418
|
-
if (t < 0 || t >
|
|
1408
|
+
const { Err: r } = et;
|
|
1409
|
+
if (fe(t, "tag"), t < 0 || t > 255) throw new r("tlv.encode: wrong tag");
|
|
1410
|
+
if (typeof e != "string") throw new TypeError('"data" expected string, got type=' + typeof e);
|
|
1419
1411
|
if (e.length & 1) throw new r("tlv.encode: unpadded data");
|
|
1420
|
-
const n = e.length / 2, o =
|
|
1412
|
+
const n = e.length / 2, o = Nt(n);
|
|
1421
1413
|
if (o.length / 2 & 128) throw new r("tlv.encode: long form length too big");
|
|
1422
|
-
const
|
|
1423
|
-
return
|
|
1414
|
+
const i = n > 127 ? Nt(o.length / 2 | 128) : "";
|
|
1415
|
+
return Nt(t) + i + o + e;
|
|
1424
1416
|
},
|
|
1425
1417
|
decode(t, e) {
|
|
1426
|
-
const { Err: r } =
|
|
1418
|
+
const { Err: r } = et;
|
|
1419
|
+
e = W(e, void 0, "DER data");
|
|
1427
1420
|
let n = 0;
|
|
1428
|
-
if (t < 0 || t >
|
|
1421
|
+
if (t < 0 || t > 255) throw new r("tlv.encode: wrong tag");
|
|
1429
1422
|
if (e.length < 2 || e[n++] !== t) throw new r("tlv.decode: wrong tlv");
|
|
1430
|
-
const o = e[n++],
|
|
1431
|
-
let
|
|
1432
|
-
if (!
|
|
1423
|
+
const o = e[n++], i = !!(o & 128);
|
|
1424
|
+
let c = 0;
|
|
1425
|
+
if (!i) c = o;
|
|
1433
1426
|
else {
|
|
1434
|
-
const
|
|
1435
|
-
if (!
|
|
1436
|
-
if (
|
|
1437
|
-
const
|
|
1438
|
-
if (
|
|
1439
|
-
if (
|
|
1440
|
-
for (const
|
|
1441
|
-
if (n +=
|
|
1427
|
+
const a = o & 127;
|
|
1428
|
+
if (!a) throw new r("tlv.decode(long): indefinite length not supported");
|
|
1429
|
+
if (a > 4) throw new r("tlv.decode(long): byte length is too big");
|
|
1430
|
+
const u = e.subarray(n, n + a);
|
|
1431
|
+
if (u.length !== a) throw new r("tlv.decode: length bytes not complete");
|
|
1432
|
+
if (u[0] === 0) throw new r("tlv.decode(long): zero leftmost byte");
|
|
1433
|
+
for (const f of u) c = c << 8 | f;
|
|
1434
|
+
if (n += a, c < 128) throw new r("tlv.decode(long): not minimal encoding");
|
|
1442
1435
|
}
|
|
1443
|
-
const
|
|
1444
|
-
if (
|
|
1436
|
+
const s = e.subarray(n, n + c);
|
|
1437
|
+
if (s.length !== c) throw new r("tlv.decode: wrong value length");
|
|
1445
1438
|
return {
|
|
1446
|
-
v:
|
|
1447
|
-
l: e.subarray(n +
|
|
1439
|
+
v: s,
|
|
1440
|
+
l: e.subarray(n + c)
|
|
1448
1441
|
};
|
|
1449
1442
|
}
|
|
1450
1443
|
},
|
|
1451
1444
|
_int: {
|
|
1452
1445
|
encode(t) {
|
|
1453
|
-
const { Err: e } =
|
|
1454
|
-
if (t <
|
|
1455
|
-
let r =
|
|
1446
|
+
const { Err: e } = et;
|
|
1447
|
+
if (we(t), t < ot) throw new e("integer: negative integers are not allowed");
|
|
1448
|
+
let r = Nt(t);
|
|
1456
1449
|
if (Number.parseInt(r[0], 16) & 8 && (r = "00" + r), r.length & 1) throw new e("unexpected DER parsing assertion: unpadded hex");
|
|
1457
1450
|
return r;
|
|
1458
1451
|
},
|
|
1459
1452
|
decode(t) {
|
|
1460
|
-
const { Err: e } =
|
|
1453
|
+
const { Err: e } = et;
|
|
1454
|
+
if (t.length < 1) throw new e("invalid signature integer: empty");
|
|
1461
1455
|
if (t[0] & 128) throw new e("invalid signature integer: negative");
|
|
1462
|
-
if (t[0] === 0 && !(t[1] & 128)) throw new e("invalid signature integer: unnecessary leading zero");
|
|
1463
|
-
return
|
|
1456
|
+
if (t.length > 1 && t[0] === 0 && !(t[1] & 128)) throw new e("invalid signature integer: unnecessary leading zero");
|
|
1457
|
+
return Ct(t);
|
|
1464
1458
|
}
|
|
1465
1459
|
},
|
|
1466
1460
|
toSig(t) {
|
|
1467
|
-
const { Err: e, _int: r, _tlv: n } =
|
|
1468
|
-
if (
|
|
1469
|
-
const { v:
|
|
1470
|
-
if (
|
|
1461
|
+
const { Err: e, _int: r, _tlv: n } = et, o = W(t, void 0, "signature"), { v: i, l: c } = n.decode(48, o);
|
|
1462
|
+
if (c.length) throw new e("invalid signature: left bytes after parsing");
|
|
1463
|
+
const { v: s, l: a } = n.decode(2, i), { v: u, l: f } = n.decode(2, a);
|
|
1464
|
+
if (f.length) throw new e("invalid signature: left bytes after parsing");
|
|
1471
1465
|
return {
|
|
1472
|
-
r: r.decode(
|
|
1473
|
-
s: r.decode(
|
|
1466
|
+
r: r.decode(s),
|
|
1467
|
+
s: r.decode(u)
|
|
1474
1468
|
};
|
|
1475
1469
|
},
|
|
1476
1470
|
hexFromSig(t) {
|
|
1477
|
-
const { _tlv: e, _int: r } =
|
|
1471
|
+
const { _tlv: e, _int: r } = et, n = e.encode(2, r.encode(t.r)) + e.encode(2, r.encode(t.s));
|
|
1478
1472
|
return e.encode(48, n);
|
|
1479
1473
|
}
|
|
1480
|
-
}
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1474
|
+
};
|
|
1475
|
+
Object.freeze(et._tlv);
|
|
1476
|
+
Object.freeze(et._int);
|
|
1477
|
+
Object.freeze(et);
|
|
1478
|
+
var ot = /* @__PURE__ */ BigInt(0), ht = /* @__PURE__ */ BigInt(1), _n = /* @__PURE__ */ BigInt(2), Tt = /* @__PURE__ */ BigInt(3), dr = /* @__PURE__ */ BigInt(4);
|
|
1479
|
+
function gr(t, e = {}) {
|
|
1480
|
+
const r = ar("weierstrass", t, e), n = r.Fp, o = r.Fn;
|
|
1481
|
+
let i = r.CURVE;
|
|
1482
|
+
const { h: c, n: s } = i;
|
|
1483
|
+
kt(e, {}, {
|
|
1486
1484
|
allowInfinityPoint: "boolean",
|
|
1487
1485
|
clearCofactor: "function",
|
|
1488
1486
|
isTorsionFree: "function",
|
|
@@ -1490,127 +1488,103 @@ function Er(t, e = {}) {
|
|
|
1490
1488
|
toBytes: "function",
|
|
1491
1489
|
endo: "object"
|
|
1492
1490
|
});
|
|
1493
|
-
const { endo:
|
|
1494
|
-
if (
|
|
1491
|
+
const { endo: a, allowInfinityPoint: u } = e;
|
|
1492
|
+
if (a && (!n.is0(i.a) || typeof a.beta != "bigint" || !Array.isArray(a.basises)))
|
|
1495
1493
|
throw new Error('invalid endo: expected "beta": bigint and "basises": array');
|
|
1496
|
-
const
|
|
1497
|
-
function
|
|
1494
|
+
const f = On(n, o);
|
|
1495
|
+
function g() {
|
|
1498
1496
|
if (!n.isOdd) throw new Error("compression is not supported: Field does not have .isOdd()");
|
|
1499
1497
|
}
|
|
1500
|
-
function
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1498
|
+
function m(F, h, y) {
|
|
1499
|
+
if (u && h.is0()) return Uint8Array.of(0);
|
|
1500
|
+
const { x: B, y: d } = h.toAffine(), l = n.toBytes(B);
|
|
1501
|
+
return Ot(y, "isCompressed"), y ? (g(), lt(Hn(!n.isOdd(d)), l)) : lt(Uint8Array.of(4), l, n.toBytes(d));
|
|
1502
|
+
}
|
|
1503
|
+
function w(F) {
|
|
1504
|
+
W(F, void 0, "Point");
|
|
1505
|
+
const { publicKey: h, publicKeyUncompressed: y } = f, B = F.length, d = F[0], l = F.subarray(1);
|
|
1506
|
+
if (u && B === 1 && d === 0) return {
|
|
1507
|
+
x: n.ZERO,
|
|
1508
|
+
y: n.ZERO
|
|
1509
|
+
};
|
|
1510
|
+
if (B === h && (d === 2 || d === 3)) {
|
|
1511
|
+
const b = n.fromBytes(l);
|
|
1512
|
+
if (!n.isValid(b)) throw new Error("bad point: is not on curve, wrong x");
|
|
1513
|
+
const E = H(b);
|
|
1511
1514
|
let p;
|
|
1512
1515
|
try {
|
|
1513
|
-
p = n.sqrt(
|
|
1514
|
-
} catch (
|
|
1515
|
-
const
|
|
1516
|
-
throw new Error("bad point: is not on curve, sqrt error" +
|
|
1516
|
+
p = n.sqrt(E);
|
|
1517
|
+
} catch (S) {
|
|
1518
|
+
const N = S instanceof Error ? ": " + S.message : "";
|
|
1519
|
+
throw new Error("bad point: is not on curve, sqrt error" + N);
|
|
1517
1520
|
}
|
|
1518
|
-
|
|
1519
|
-
const
|
|
1520
|
-
return (
|
|
1521
|
-
x:
|
|
1521
|
+
g();
|
|
1522
|
+
const v = n.isOdd(p);
|
|
1523
|
+
return (d & 1) === 1 !== v && (p = n.neg(p)), {
|
|
1524
|
+
x: b,
|
|
1522
1525
|
y: p
|
|
1523
1526
|
};
|
|
1524
|
-
} else if (
|
|
1525
|
-
const
|
|
1526
|
-
if (!
|
|
1527
|
+
} else if (B === y && d === 4) {
|
|
1528
|
+
const b = n.BYTES, E = n.fromBytes(l.subarray(0, b)), p = n.fromBytes(l.subarray(b, b * 2));
|
|
1529
|
+
if (!O(E, p)) throw new Error("bad point: is not on curve");
|
|
1527
1530
|
return {
|
|
1528
|
-
x:
|
|
1531
|
+
x: E,
|
|
1529
1532
|
y: p
|
|
1530
1533
|
};
|
|
1531
|
-
} else throw new Error(`bad point: got length ${
|
|
1532
|
-
}
|
|
1533
|
-
const
|
|
1534
|
-
function
|
|
1535
|
-
const h = n.sqr(
|
|
1536
|
-
return n.add(n.add(
|
|
1537
|
-
}
|
|
1538
|
-
function
|
|
1539
|
-
const
|
|
1540
|
-
return n.eql(
|
|
1541
|
-
}
|
|
1542
|
-
if (!
|
|
1543
|
-
const
|
|
1544
|
-
if (n.is0(n.add(
|
|
1545
|
-
function
|
|
1546
|
-
if (!n.isValid(h) ||
|
|
1534
|
+
} else throw new Error(`bad point: got length ${B}, expected compressed=${h} or uncompressed=${y}`);
|
|
1535
|
+
}
|
|
1536
|
+
const A = e.toBytes === void 0 ? m : e.toBytes, _ = e.fromBytes === void 0 ? w : e.fromBytes;
|
|
1537
|
+
function H(F) {
|
|
1538
|
+
const h = n.sqr(F), y = n.mul(h, F);
|
|
1539
|
+
return n.add(n.add(y, n.mul(F, i.a)), i.b);
|
|
1540
|
+
}
|
|
1541
|
+
function O(F, h) {
|
|
1542
|
+
const y = n.sqr(h), B = H(F);
|
|
1543
|
+
return n.eql(y, B);
|
|
1544
|
+
}
|
|
1545
|
+
if (!O(i.Gx, i.Gy)) throw new Error("bad curve params: generator point");
|
|
1546
|
+
const x = n.mul(n.pow(i.a, Tt), dr), q = n.mul(n.sqr(i.b), BigInt(27));
|
|
1547
|
+
if (n.is0(n.add(x, q))) throw new Error("bad curve params: a or b");
|
|
1548
|
+
function Z(F, h, y = !1) {
|
|
1549
|
+
if (!n.isValid(h) || y && n.is0(h)) throw new Error(`bad point coordinate ${F}`);
|
|
1547
1550
|
return h;
|
|
1548
1551
|
}
|
|
1549
|
-
function
|
|
1550
|
-
if (!(
|
|
1552
|
+
function T(F) {
|
|
1553
|
+
if (!(F instanceof R)) throw new Error("Weierstrass Point expected");
|
|
1551
1554
|
}
|
|
1552
|
-
function
|
|
1553
|
-
if (!
|
|
1554
|
-
return
|
|
1555
|
+
function Q(F) {
|
|
1556
|
+
if (!a || !a.basises) throw new Error("no endo");
|
|
1557
|
+
return lr(F, a.basises, o.ORDER);
|
|
1555
1558
|
}
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
if (n.eql(y, n.ONE)) return {
|
|
1559
|
-
x: d,
|
|
1560
|
-
y: u
|
|
1561
|
-
};
|
|
1562
|
-
const _ = U.is0();
|
|
1563
|
-
h == null && (h = _ ? n.ONE : n.inv(y));
|
|
1564
|
-
const S = n.mul(d, h), A = n.mul(u, h), p = n.mul(y, h);
|
|
1565
|
-
if (_) return {
|
|
1566
|
-
x: n.ZERO,
|
|
1567
|
-
y: n.ZERO
|
|
1568
|
-
};
|
|
1569
|
-
if (!n.eql(p, n.ONE)) throw new Error("invZ was invalid");
|
|
1570
|
-
return {
|
|
1571
|
-
x: S,
|
|
1572
|
-
y: A
|
|
1573
|
-
};
|
|
1574
|
-
}), D = Ue((U) => {
|
|
1575
|
-
if (U.is0()) {
|
|
1576
|
-
if (e.allowInfinityPoint && !n.is0(U.Y)) return;
|
|
1577
|
-
throw new Error("bad point: ZERO");
|
|
1578
|
-
}
|
|
1579
|
-
const { x: h, y: d } = U.toAffine();
|
|
1580
|
-
if (!n.isValid(h) || !n.isValid(d)) throw new Error("bad point: x or y not field elements");
|
|
1581
|
-
if (!v(h, d)) throw new Error("bad point: equation left != right");
|
|
1582
|
-
if (!U.isTorsionFree()) throw new Error("bad point: not in prime-order subgroup");
|
|
1583
|
-
return !0;
|
|
1584
|
-
});
|
|
1585
|
-
function N(U, h, d, u, y) {
|
|
1586
|
-
return d = new O(n.mul(d.X, U), d.Y, d.Z), h = Gt(u, h), d = Gt(y, d), h.add(d);
|
|
1559
|
+
function $(F, h, y, B, d) {
|
|
1560
|
+
return y = new R(n.mul(y.X, F), y.Y, y.Z), h = Zt(B, h), y = Zt(d, y), h.add(y);
|
|
1587
1561
|
}
|
|
1588
|
-
class
|
|
1589
|
-
static BASE = new
|
|
1590
|
-
static ZERO = new
|
|
1562
|
+
class R {
|
|
1563
|
+
static BASE = new R(i.Gx, i.Gy, n.ONE);
|
|
1564
|
+
static ZERO = new R(n.ZERO, n.ONE, n.ZERO);
|
|
1591
1565
|
static Fp = n;
|
|
1592
1566
|
static Fn = o;
|
|
1593
1567
|
X;
|
|
1594
1568
|
Y;
|
|
1595
1569
|
Z;
|
|
1596
|
-
constructor(h,
|
|
1597
|
-
this.X =
|
|
1570
|
+
constructor(h, y, B) {
|
|
1571
|
+
this.X = Z("x", h), this.Y = Z("y", y, !0), this.Z = Z("z", B), Object.freeze(this);
|
|
1598
1572
|
}
|
|
1599
1573
|
static CURVE() {
|
|
1600
|
-
return
|
|
1574
|
+
return i;
|
|
1601
1575
|
}
|
|
1602
1576
|
static fromAffine(h) {
|
|
1603
|
-
const { x:
|
|
1604
|
-
if (!h || !n.isValid(
|
|
1605
|
-
if (h instanceof
|
|
1606
|
-
return n.is0(
|
|
1577
|
+
const { x: y, y: B } = h || {};
|
|
1578
|
+
if (!h || !n.isValid(y) || !n.isValid(B)) throw new Error("invalid affine point");
|
|
1579
|
+
if (h instanceof R) throw new Error("projective point not allowed");
|
|
1580
|
+
return n.is0(y) && n.is0(B) ? R.ZERO : new R(y, B, n.ONE);
|
|
1607
1581
|
}
|
|
1608
1582
|
static fromBytes(h) {
|
|
1609
|
-
const
|
|
1610
|
-
return
|
|
1583
|
+
const y = R.fromAffine(_(W(h, void 0, "point")));
|
|
1584
|
+
return y.assertValidity(), y;
|
|
1611
1585
|
}
|
|
1612
1586
|
static fromHex(h) {
|
|
1613
|
-
return
|
|
1587
|
+
return R.fromBytes(se(h));
|
|
1614
1588
|
}
|
|
1615
1589
|
get x() {
|
|
1616
1590
|
return this.toAffine().x;
|
|
@@ -1618,11 +1592,19 @@ function Er(t, e = {}) {
|
|
|
1618
1592
|
get y() {
|
|
1619
1593
|
return this.toAffine().y;
|
|
1620
1594
|
}
|
|
1621
|
-
precompute(h = 8,
|
|
1622
|
-
return
|
|
1595
|
+
precompute(h = 8, y = !0) {
|
|
1596
|
+
return X.createCache(this, h), y || this.multiply(Tt), this;
|
|
1623
1597
|
}
|
|
1624
1598
|
assertValidity() {
|
|
1625
|
-
|
|
1599
|
+
const h = this;
|
|
1600
|
+
if (h.is0()) {
|
|
1601
|
+
if (e.allowInfinityPoint && n.is0(h.X) && n.eql(h.Y, n.ONE) && n.is0(h.Z)) return;
|
|
1602
|
+
throw new Error("bad point: ZERO");
|
|
1603
|
+
}
|
|
1604
|
+
const { x: y, y: B } = h.toAffine();
|
|
1605
|
+
if (!n.isValid(y) || !n.isValid(B)) throw new Error("bad point: x or y not field elements");
|
|
1606
|
+
if (!O(y, B)) throw new Error("bad point: equation left != right");
|
|
1607
|
+
if (!h.isTorsionFree()) throw new Error("bad point: not in prime-order subgroup");
|
|
1626
1608
|
}
|
|
1627
1609
|
hasEvenY() {
|
|
1628
1610
|
const { y: h } = this.toAffine();
|
|
@@ -1630,153 +1612,108 @@ function Er(t, e = {}) {
|
|
|
1630
1612
|
return !n.isOdd(h);
|
|
1631
1613
|
}
|
|
1632
1614
|
equals(h) {
|
|
1633
|
-
|
|
1634
|
-
const { X:
|
|
1635
|
-
return p &&
|
|
1615
|
+
T(h);
|
|
1616
|
+
const { X: y, Y: B, Z: d } = this, { X: l, Y: b, Z: E } = h, p = n.eql(n.mul(y, E), n.mul(l, d)), v = n.eql(n.mul(B, E), n.mul(b, d));
|
|
1617
|
+
return p && v;
|
|
1636
1618
|
}
|
|
1637
1619
|
negate() {
|
|
1638
|
-
return new
|
|
1620
|
+
return new R(this.X, n.neg(this.Y), this.Z);
|
|
1639
1621
|
}
|
|
1640
1622
|
double() {
|
|
1641
|
-
const { a: h, b:
|
|
1642
|
-
let
|
|
1643
|
-
return
|
|
1623
|
+
const { a: h, b: y } = i, B = n.mul(y, Tt), { X: d, Y: l, Z: b } = this;
|
|
1624
|
+
let E = n.ZERO, p = n.ZERO, v = n.ZERO, S = n.mul(d, d), N = n.mul(l, l), L = n.mul(b, b), I = n.mul(d, l);
|
|
1625
|
+
return I = n.add(I, I), v = n.mul(d, b), v = n.add(v, v), E = n.mul(h, v), p = n.mul(B, L), p = n.add(E, p), E = n.sub(N, p), p = n.add(N, p), p = n.mul(E, p), E = n.mul(I, E), v = n.mul(B, v), L = n.mul(h, L), I = n.sub(S, L), I = n.mul(h, I), I = n.add(I, v), v = n.add(S, S), S = n.add(v, S), S = n.add(S, L), S = n.mul(S, I), p = n.add(p, S), L = n.mul(l, b), L = n.add(L, L), S = n.mul(L, I), E = n.sub(E, S), v = n.mul(L, N), v = n.add(v, v), v = n.add(v, v), new R(E, p, v);
|
|
1644
1626
|
}
|
|
1645
1627
|
add(h) {
|
|
1646
|
-
|
|
1647
|
-
const { X:
|
|
1648
|
-
let p = n.ZERO,
|
|
1649
|
-
const
|
|
1650
|
-
let
|
|
1651
|
-
|
|
1652
|
-
let
|
|
1653
|
-
return
|
|
1628
|
+
T(h);
|
|
1629
|
+
const { X: y, Y: B, Z: d } = this, { X: l, Y: b, Z: E } = h;
|
|
1630
|
+
let p = n.ZERO, v = n.ZERO, S = n.ZERO;
|
|
1631
|
+
const N = i.a, L = n.mul(i.b, Tt);
|
|
1632
|
+
let I = n.mul(y, l), k = n.mul(B, b), j = n.mul(d, E), V = n.add(y, B), U = n.add(l, b);
|
|
1633
|
+
V = n.mul(V, U), U = n.add(I, k), V = n.sub(V, U), U = n.add(y, d);
|
|
1634
|
+
let J = n.add(l, E);
|
|
1635
|
+
return U = n.mul(U, J), J = n.add(I, j), U = n.sub(U, J), J = n.add(B, d), p = n.add(b, E), J = n.mul(J, p), p = n.add(k, j), J = n.sub(J, p), S = n.mul(N, U), p = n.mul(L, j), S = n.add(p, S), p = n.sub(k, S), S = n.add(k, S), v = n.mul(p, S), k = n.add(I, I), k = n.add(k, I), j = n.mul(N, j), U = n.mul(L, U), k = n.add(k, j), j = n.sub(I, j), j = n.mul(N, j), U = n.add(U, j), I = n.mul(k, U), v = n.add(v, I), I = n.mul(J, U), p = n.mul(V, p), p = n.sub(p, I), I = n.mul(V, k), S = n.mul(J, S), S = n.add(S, I), new R(p, v, S);
|
|
1654
1636
|
}
|
|
1655
1637
|
subtract(h) {
|
|
1656
|
-
return this.add(h.negate());
|
|
1638
|
+
return T(h), this.add(h.negate());
|
|
1657
1639
|
}
|
|
1658
1640
|
is0() {
|
|
1659
|
-
return this.equals(
|
|
1641
|
+
return this.equals(R.ZERO);
|
|
1660
1642
|
}
|
|
1661
1643
|
multiply(h) {
|
|
1662
|
-
const { endo:
|
|
1663
|
-
if (!o.isValidNot0(h)) throw new
|
|
1664
|
-
let
|
|
1665
|
-
const
|
|
1666
|
-
if (
|
|
1667
|
-
const { k1neg:
|
|
1668
|
-
|
|
1644
|
+
const { endo: y } = e;
|
|
1645
|
+
if (!o.isValidNot0(h)) throw new RangeError("invalid scalar: out of range");
|
|
1646
|
+
let B, d;
|
|
1647
|
+
const l = (b) => X.cached(this, b, (E) => Ne(R, E));
|
|
1648
|
+
if (y) {
|
|
1649
|
+
const { k1neg: b, k1: E, k2neg: p, k2: v } = Q(h), { p: S, f: N } = l(E), { p: L, f: I } = l(v);
|
|
1650
|
+
d = N.add(I), B = $(y.beta, S, L, b, p);
|
|
1669
1651
|
} else {
|
|
1670
|
-
const { p:
|
|
1671
|
-
|
|
1652
|
+
const { p: b, f: E } = l(h);
|
|
1653
|
+
B = b, d = E;
|
|
1672
1654
|
}
|
|
1673
|
-
return
|
|
1655
|
+
return Ne(R, [B, d])[0];
|
|
1674
1656
|
}
|
|
1675
1657
|
multiplyUnsafe(h) {
|
|
1676
|
-
const { endo:
|
|
1677
|
-
if (!o.isValid(
|
|
1678
|
-
if (
|
|
1679
|
-
if (
|
|
1680
|
-
if (
|
|
1681
|
-
if (
|
|
1682
|
-
const { k1neg:
|
|
1683
|
-
return
|
|
1684
|
-
} else return
|
|
1658
|
+
const { endo: y } = e, B = this, d = h;
|
|
1659
|
+
if (!o.isValid(d)) throw new RangeError("invalid scalar: out of range");
|
|
1660
|
+
if (d === ot || B.is0()) return R.ZERO;
|
|
1661
|
+
if (d === ht) return B;
|
|
1662
|
+
if (X.hasCache(this)) return this.multiply(d);
|
|
1663
|
+
if (y) {
|
|
1664
|
+
const { k1neg: l, k1: b, k2neg: E, k2: p } = Q(d), { p1: v, p2: S } = fr(R, B, b, p);
|
|
1665
|
+
return $(y.beta, v, S, l, E);
|
|
1666
|
+
} else return X.unsafe(B, d);
|
|
1685
1667
|
}
|
|
1686
1668
|
toAffine(h) {
|
|
1687
|
-
|
|
1669
|
+
const y = this;
|
|
1670
|
+
let B = h;
|
|
1671
|
+
const { X: d, Y: l, Z: b } = y;
|
|
1672
|
+
if (n.eql(b, n.ONE)) return {
|
|
1673
|
+
x: d,
|
|
1674
|
+
y: l
|
|
1675
|
+
};
|
|
1676
|
+
const E = y.is0();
|
|
1677
|
+
B == null && (B = E ? n.ONE : n.inv(b));
|
|
1678
|
+
const p = n.mul(d, B), v = n.mul(l, B), S = n.mul(b, B);
|
|
1679
|
+
if (E) return {
|
|
1680
|
+
x: n.ZERO,
|
|
1681
|
+
y: n.ZERO
|
|
1682
|
+
};
|
|
1683
|
+
if (!n.eql(S, n.ONE)) throw new Error("invZ was invalid");
|
|
1684
|
+
return {
|
|
1685
|
+
x: p,
|
|
1686
|
+
y: v
|
|
1687
|
+
};
|
|
1688
1688
|
}
|
|
1689
1689
|
isTorsionFree() {
|
|
1690
1690
|
const { isTorsionFree: h } = e;
|
|
1691
|
-
return
|
|
1691
|
+
return c === ht ? !0 : h ? h(R, this) : X.unsafe(this, s).is0();
|
|
1692
1692
|
}
|
|
1693
1693
|
clearCofactor() {
|
|
1694
1694
|
const { clearCofactor: h } = e;
|
|
1695
|
-
return
|
|
1695
|
+
return c === ht ? this : h ? h(R, this) : this.multiplyUnsafe(c);
|
|
1696
1696
|
}
|
|
1697
1697
|
isSmallOrder() {
|
|
1698
|
-
return this.
|
|
1698
|
+
return c === ht ? this.is0() : this.clearCofactor().is0();
|
|
1699
1699
|
}
|
|
1700
1700
|
toBytes(h = !0) {
|
|
1701
|
-
return
|
|
1701
|
+
return Ot(h, "isCompressed"), this.assertValidity(), A(R, this, h);
|
|
1702
1702
|
}
|
|
1703
1703
|
toHex(h = !0) {
|
|
1704
|
-
return
|
|
1704
|
+
return cn(this.toBytes(h));
|
|
1705
1705
|
}
|
|
1706
1706
|
toString() {
|
|
1707
1707
|
return `<Point ${this.is0() ? "ZERO" : this.toHex()}>`;
|
|
1708
1708
|
}
|
|
1709
1709
|
}
|
|
1710
|
-
const
|
|
1711
|
-
return
|
|
1710
|
+
const C = o.BITS, X = new cr(R, e.endo ? Math.ceil(C / 2) : C);
|
|
1711
|
+
return C >= 8 && R.BASE.precompute(8), Object.freeze(R.prototype), Object.freeze(R), R;
|
|
1712
1712
|
}
|
|
1713
|
-
function
|
|
1713
|
+
function Hn(t) {
|
|
1714
1714
|
return Uint8Array.of(t ? 2 : 3);
|
|
1715
1715
|
}
|
|
1716
|
-
function
|
|
1717
|
-
const r = t.ORDER;
|
|
1718
|
-
let n = rt;
|
|
1719
|
-
for (let m = r - z; m % ct === rt; m /= ct) n += z;
|
|
1720
|
-
const o = n, s = ct << o - z - z, i = s * ct, c = (r - z) / i, f = (c - z) / ct, l = i - z, a = s, g = t.pow(e, c), b = t.pow(e, (c + z) / ct);
|
|
1721
|
-
let w = (m, x) => {
|
|
1722
|
-
let v = g, B = t.pow(x, l), E = t.sqr(B);
|
|
1723
|
-
E = t.mul(E, x);
|
|
1724
|
-
let L = t.mul(m, E);
|
|
1725
|
-
L = t.pow(L, f), L = t.mul(L, B), B = t.mul(L, x), E = t.mul(L, m);
|
|
1726
|
-
let I = t.mul(E, B);
|
|
1727
|
-
L = t.pow(I, a);
|
|
1728
|
-
let V = t.eql(L, t.ONE);
|
|
1729
|
-
B = t.mul(E, b), L = t.mul(I, v), E = t.cmov(B, E, V), I = t.cmov(L, I, V);
|
|
1730
|
-
for (let M = o; M > z; M--) {
|
|
1731
|
-
let D = M - ct;
|
|
1732
|
-
D = ct << D - z;
|
|
1733
|
-
let N = t.pow(I, D);
|
|
1734
|
-
const O = t.eql(N, t.ONE);
|
|
1735
|
-
B = t.mul(E, v), v = t.mul(v, v), N = t.mul(I, v), E = t.cmov(B, E, O), I = t.cmov(N, I, O);
|
|
1736
|
-
}
|
|
1737
|
-
return {
|
|
1738
|
-
isValid: V,
|
|
1739
|
-
value: E
|
|
1740
|
-
};
|
|
1741
|
-
};
|
|
1742
|
-
if (t.ORDER % ve === St) {
|
|
1743
|
-
const m = (t.ORDER - St) / ve, x = t.sqrt(t.neg(e));
|
|
1744
|
-
w = (v, B) => {
|
|
1745
|
-
let E = t.sqr(B);
|
|
1746
|
-
const L = t.mul(v, B);
|
|
1747
|
-
E = t.mul(E, L);
|
|
1748
|
-
let I = t.pow(E, m);
|
|
1749
|
-
I = t.mul(I, L);
|
|
1750
|
-
const V = t.mul(I, x), M = t.mul(t.sqr(I), B), D = t.eql(M, v);
|
|
1751
|
-
return {
|
|
1752
|
-
isValid: D,
|
|
1753
|
-
value: t.cmov(V, I, D)
|
|
1754
|
-
};
|
|
1755
|
-
};
|
|
1756
|
-
}
|
|
1757
|
-
return w;
|
|
1758
|
-
}
|
|
1759
|
-
function pr(t, e) {
|
|
1760
|
-
yn(t);
|
|
1761
|
-
const { A: r, B: n, Z: o } = e;
|
|
1762
|
-
if (!t.isValid(r) || !t.isValid(n) || !t.isValid(o)) throw new Error("mapToCurveSimpleSWU: invalid opts");
|
|
1763
|
-
const s = vr(t, o);
|
|
1764
|
-
if (!t.isOdd) throw new Error("Field does not have .isOdd()");
|
|
1765
|
-
return (i) => {
|
|
1766
|
-
let c, f, l, a, g, b, w, m;
|
|
1767
|
-
c = t.sqr(i), c = t.mul(c, o), f = t.sqr(c), f = t.add(f, c), l = t.add(f, t.ONE), l = t.mul(l, n), a = t.cmov(o, t.neg(f), !t.eql(f, t.ZERO)), a = t.mul(a, r), f = t.sqr(l), b = t.sqr(a), g = t.mul(b, r), f = t.add(f, g), f = t.mul(f, l), b = t.mul(b, a), g = t.mul(b, n), f = t.add(f, g), w = t.mul(c, l);
|
|
1768
|
-
const { isValid: x, value: v } = s(f, b);
|
|
1769
|
-
m = t.mul(c, i), m = t.mul(m, v), w = t.cmov(w, l, x), m = t.cmov(m, v, x);
|
|
1770
|
-
const B = t.isOdd(i) === t.isOdd(m);
|
|
1771
|
-
m = t.cmov(t.neg(m), m, B);
|
|
1772
|
-
const E = Ft(t, [a], !0)[0];
|
|
1773
|
-
return w = t.mul(w, E), {
|
|
1774
|
-
x: w,
|
|
1775
|
-
y: m
|
|
1776
|
-
};
|
|
1777
|
-
};
|
|
1778
|
-
}
|
|
1779
|
-
function An(t, e) {
|
|
1716
|
+
function On(t, e) {
|
|
1780
1717
|
return {
|
|
1781
1718
|
secretKey: e.BYTES,
|
|
1782
1719
|
publicKey: 1 + t.BYTES,
|
|
@@ -1785,222 +1722,224 @@ function An(t, e) {
|
|
|
1785
1722
|
signature: 2 * e.BYTES
|
|
1786
1723
|
};
|
|
1787
1724
|
}
|
|
1788
|
-
function
|
|
1789
|
-
const { Fn: r } = t, n = e.randomBytes
|
|
1790
|
-
function
|
|
1725
|
+
function br(t, e = {}) {
|
|
1726
|
+
const { Fn: r } = t, n = e.randomBytes === void 0 ? an : e.randomBytes, o = Object.assign(On(t.Fp, r), { seed: Math.max(An(r.ORDER), 16) });
|
|
1727
|
+
function i(w) {
|
|
1791
1728
|
try {
|
|
1792
|
-
const
|
|
1793
|
-
return r.isValidNot0(
|
|
1729
|
+
const A = r.fromBytes(w);
|
|
1730
|
+
return r.isValidNot0(A);
|
|
1794
1731
|
} catch {
|
|
1795
1732
|
return !1;
|
|
1796
1733
|
}
|
|
1797
1734
|
}
|
|
1798
|
-
function
|
|
1799
|
-
const { publicKey:
|
|
1735
|
+
function c(w, A) {
|
|
1736
|
+
const { publicKey: _, publicKeyUncompressed: H } = o;
|
|
1800
1737
|
try {
|
|
1801
|
-
const
|
|
1802
|
-
return
|
|
1738
|
+
const O = w.length;
|
|
1739
|
+
return A === !0 && O !== _ || A === !1 && O !== H ? !1 : !!t.fromBytes(w);
|
|
1803
1740
|
} catch {
|
|
1804
1741
|
return !1;
|
|
1805
1742
|
}
|
|
1806
1743
|
}
|
|
1807
|
-
function
|
|
1808
|
-
return sr(
|
|
1744
|
+
function s(w) {
|
|
1745
|
+
return w = w === void 0 ? n(o.seed) : w, sr(W(w, o.seed, "seed"), r.ORDER);
|
|
1809
1746
|
}
|
|
1810
|
-
function
|
|
1811
|
-
return t.BASE.multiply(r.fromBytes(w)).toBytes(
|
|
1747
|
+
function a(w, A = !0) {
|
|
1748
|
+
return t.BASE.multiply(r.fromBytes(w)).toBytes(A);
|
|
1812
1749
|
}
|
|
1813
|
-
function
|
|
1814
|
-
const { secretKey:
|
|
1815
|
-
if (!
|
|
1816
|
-
const
|
|
1817
|
-
|
|
1750
|
+
function u(w) {
|
|
1751
|
+
const { secretKey: A, publicKey: _, publicKeyUncompressed: H } = o, O = r._lengths;
|
|
1752
|
+
if (!fn(w)) return;
|
|
1753
|
+
const x = W(w, void 0, "key").length, q = x === _ || x === H, Z = x === A || !!O?.includes(x);
|
|
1754
|
+
if (!(q && Z))
|
|
1755
|
+
return q;
|
|
1818
1756
|
}
|
|
1819
|
-
function
|
|
1820
|
-
if (
|
|
1821
|
-
if (
|
|
1822
|
-
const
|
|
1823
|
-
return t.fromBytes(
|
|
1757
|
+
function f(w, A, _ = !0) {
|
|
1758
|
+
if (u(w) === !0) throw new Error("first arg must be private key");
|
|
1759
|
+
if (u(A) === !1) throw new Error("second arg must be public key");
|
|
1760
|
+
const H = r.fromBytes(w);
|
|
1761
|
+
return t.fromBytes(A).multiply(H).toBytes(_);
|
|
1824
1762
|
}
|
|
1825
1763
|
const g = {
|
|
1826
|
-
isValidSecretKey:
|
|
1827
|
-
isValidPublicKey:
|
|
1828
|
-
randomSecretKey:
|
|
1829
|
-
},
|
|
1830
|
-
return Object.freeze({
|
|
1831
|
-
getPublicKey:
|
|
1832
|
-
getSharedSecret:
|
|
1833
|
-
keygen:
|
|
1764
|
+
isValidSecretKey: i,
|
|
1765
|
+
isValidPublicKey: c,
|
|
1766
|
+
randomSecretKey: s
|
|
1767
|
+
}, m = ur(s, a);
|
|
1768
|
+
return Object.freeze(g), Object.freeze(o), Object.freeze({
|
|
1769
|
+
getPublicKey: a,
|
|
1770
|
+
getSharedSecret: f,
|
|
1771
|
+
keygen: m,
|
|
1834
1772
|
Point: t,
|
|
1835
1773
|
utils: g,
|
|
1836
1774
|
lengths: o
|
|
1837
1775
|
});
|
|
1838
1776
|
}
|
|
1839
|
-
function
|
|
1840
|
-
|
|
1777
|
+
function wr(t, e, r = {}) {
|
|
1778
|
+
const n = e;
|
|
1779
|
+
ke(n), kt(r, {}, {
|
|
1841
1780
|
hmac: "function",
|
|
1842
1781
|
lowS: "boolean",
|
|
1843
1782
|
randomBytes: "function",
|
|
1844
1783
|
bits2int: "function",
|
|
1845
1784
|
bits2int_modN: "function"
|
|
1846
1785
|
}), r = Object.assign({}, r);
|
|
1847
|
-
const
|
|
1786
|
+
const o = r.randomBytes === void 0 ? an : r.randomBytes, i = r.hmac === void 0 ? (d, l) => de(n, d, l) : r.hmac, { Fp: c, Fn: s } = t, { ORDER: a, BITS: u } = s, { keygen: f, getPublicKey: g, getSharedSecret: m, utils: w, lengths: A } = br(t, r), _ = {
|
|
1848
1787
|
prehash: !0,
|
|
1849
1788
|
lowS: typeof r.lowS == "boolean" ? r.lowS : !0,
|
|
1850
1789
|
format: "compact",
|
|
1851
1790
|
extraEntropy: !1
|
|
1852
|
-
},
|
|
1853
|
-
function
|
|
1854
|
-
return d >
|
|
1791
|
+
}, H = a * _n + ht < c.ORDER;
|
|
1792
|
+
function O(d) {
|
|
1793
|
+
return d > a >> ht;
|
|
1855
1794
|
}
|
|
1856
|
-
function
|
|
1857
|
-
if (!
|
|
1858
|
-
return
|
|
1795
|
+
function x(d, l) {
|
|
1796
|
+
if (!s.isValidNot0(l)) throw new Error(`invalid signature ${d}: out of range 1..Point.Fn.ORDER`);
|
|
1797
|
+
return l;
|
|
1859
1798
|
}
|
|
1860
|
-
function
|
|
1861
|
-
if (
|
|
1799
|
+
function q() {
|
|
1800
|
+
if (H) throw new Error('"recovered" sig type is not supported for cofactor >2 curves');
|
|
1862
1801
|
}
|
|
1863
|
-
function
|
|
1864
|
-
|
|
1865
|
-
const
|
|
1866
|
-
return
|
|
1802
|
+
function Z(d, l) {
|
|
1803
|
+
ae(l);
|
|
1804
|
+
const b = A.signature;
|
|
1805
|
+
return W(d, l === "compact" ? b : l === "recovered" ? b + 1 : void 0);
|
|
1867
1806
|
}
|
|
1868
|
-
class
|
|
1807
|
+
class T {
|
|
1869
1808
|
r;
|
|
1870
1809
|
s;
|
|
1871
1810
|
recovery;
|
|
1872
|
-
constructor(
|
|
1873
|
-
if (this.r =
|
|
1874
|
-
if (
|
|
1811
|
+
constructor(l, b, E) {
|
|
1812
|
+
if (this.r = x("r", l), this.s = x("s", b), E != null) {
|
|
1813
|
+
if (q(), ![
|
|
1875
1814
|
0,
|
|
1876
1815
|
1,
|
|
1877
1816
|
2,
|
|
1878
1817
|
3
|
|
1879
|
-
].includes(
|
|
1880
|
-
this.recovery =
|
|
1818
|
+
].includes(E)) throw new Error("invalid recovery id");
|
|
1819
|
+
this.recovery = E;
|
|
1881
1820
|
}
|
|
1882
1821
|
Object.freeze(this);
|
|
1883
1822
|
}
|
|
1884
|
-
static fromBytes(
|
|
1885
|
-
|
|
1886
|
-
let
|
|
1887
|
-
if (
|
|
1888
|
-
const { r:
|
|
1889
|
-
return new
|
|
1823
|
+
static fromBytes(l, b = _.format) {
|
|
1824
|
+
Z(l, b);
|
|
1825
|
+
let E;
|
|
1826
|
+
if (b === "der") {
|
|
1827
|
+
const { r: N, s: L } = et.toSig(W(l));
|
|
1828
|
+
return new T(N, L);
|
|
1890
1829
|
}
|
|
1891
|
-
|
|
1892
|
-
const
|
|
1893
|
-
return new
|
|
1830
|
+
b === "recovered" && (E = l[0], b = "compact", l = l.subarray(1));
|
|
1831
|
+
const p = A.signature / 2, v = l.subarray(0, p), S = l.subarray(p, p * 2);
|
|
1832
|
+
return new T(s.fromBytes(v), s.fromBytes(S), E);
|
|
1894
1833
|
}
|
|
1895
|
-
static fromHex(
|
|
1896
|
-
return this.fromBytes(
|
|
1834
|
+
static fromHex(l, b) {
|
|
1835
|
+
return this.fromBytes(se(l), b);
|
|
1897
1836
|
}
|
|
1898
1837
|
assertRecovery() {
|
|
1899
|
-
const { recovery:
|
|
1900
|
-
if (
|
|
1901
|
-
return
|
|
1838
|
+
const { recovery: l } = this;
|
|
1839
|
+
if (l == null) throw new Error("invalid recovery id: must be present");
|
|
1840
|
+
return l;
|
|
1902
1841
|
}
|
|
1903
|
-
addRecoveryBit(
|
|
1904
|
-
return new
|
|
1842
|
+
addRecoveryBit(l) {
|
|
1843
|
+
return new T(this.r, this.s, l);
|
|
1905
1844
|
}
|
|
1906
|
-
recoverPublicKey(
|
|
1907
|
-
const { r:
|
|
1908
|
-
if (!
|
|
1909
|
-
const
|
|
1910
|
-
if (
|
|
1911
|
-
return
|
|
1845
|
+
recoverPublicKey(l) {
|
|
1846
|
+
const { r: b, s: E } = this, p = this.assertRecovery(), v = p === 2 || p === 3 ? b + a : b;
|
|
1847
|
+
if (!c.isValid(v)) throw new Error("invalid recovery id: sig.r+curve.n != R.x");
|
|
1848
|
+
const S = c.toBytes(v), N = t.fromBytes(lt(Hn((p & 1) === 0), S)), L = s.inv(v), I = $(W(l, void 0, "msgHash")), k = s.create(-I * L), j = s.create(E * L), V = t.BASE.multiplyUnsafe(k).add(N.multiplyUnsafe(j));
|
|
1849
|
+
if (V.is0()) throw new Error("invalid recovery: point at infinify");
|
|
1850
|
+
return V.assertValidity(), V;
|
|
1912
1851
|
}
|
|
1913
1852
|
hasHighS() {
|
|
1914
|
-
return
|
|
1915
|
-
}
|
|
1916
|
-
toBytes(
|
|
1917
|
-
if (
|
|
1918
|
-
const { r:
|
|
1919
|
-
return
|
|
1920
|
-
}
|
|
1921
|
-
toHex(
|
|
1922
|
-
return
|
|
1923
|
-
}
|
|
1924
|
-
}
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1853
|
+
return O(this.s);
|
|
1854
|
+
}
|
|
1855
|
+
toBytes(l = _.format) {
|
|
1856
|
+
if (ae(l), l === "der") return se(et.hexFromSig(this));
|
|
1857
|
+
const { r: b, s: E } = this, p = s.toBytes(b), v = s.toBytes(E);
|
|
1858
|
+
return l === "recovered" ? (q(), lt(Uint8Array.of(this.assertRecovery()), p, v)) : lt(p, v);
|
|
1859
|
+
}
|
|
1860
|
+
toHex(l) {
|
|
1861
|
+
return cn(this.toBytes(l));
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
Object.freeze(T.prototype), Object.freeze(T);
|
|
1865
|
+
const Q = r.bits2int === void 0 ? function(l) {
|
|
1866
|
+
if (l.length > 8192) throw new Error("input is too large");
|
|
1867
|
+
const b = Ct(l), E = l.length * 8 - u;
|
|
1868
|
+
return E > 0 ? b >> BigInt(E) : b;
|
|
1869
|
+
} : r.bits2int, $ = r.bits2int_modN === void 0 ? function(l) {
|
|
1870
|
+
return s.create(Q(l));
|
|
1871
|
+
} : r.bits2int_modN, R = Ee(u);
|
|
1872
|
+
function C(d) {
|
|
1873
|
+
return dn("num < 2^" + u, d, ot, R), s.toBytes(d);
|
|
1874
|
+
}
|
|
1875
|
+
function X(d, l) {
|
|
1876
|
+
return W(d, void 0, "message"), l ? W(n(d), void 0, "prehashed message") : d;
|
|
1877
|
+
}
|
|
1878
|
+
function F(d, l, b) {
|
|
1879
|
+
const { lowS: E, prehash: p, extraEntropy: v } = Xt(b, _);
|
|
1880
|
+
d = X(d, p);
|
|
1881
|
+
const S = $(d), N = s.fromBytes(l);
|
|
1882
|
+
if (!s.isValidNot0(N)) throw new Error("invalid private key");
|
|
1883
|
+
const L = [C(N), C(S)];
|
|
1884
|
+
if (v != null && v !== !1) {
|
|
1885
|
+
const V = v === !0 ? o(A.secretKey) : v;
|
|
1886
|
+
L.push(W(V, void 0, "extraEntropy"));
|
|
1887
|
+
}
|
|
1888
|
+
const I = lt(...L), k = S;
|
|
1889
|
+
function j(V) {
|
|
1890
|
+
const U = Q(V);
|
|
1891
|
+
if (!s.isValidNot0(U)) return;
|
|
1892
|
+
const J = s.inv(U), vt = t.BASE.multiply(U).toAffine(), Ft = s.create(vt.x);
|
|
1893
|
+
if (Ft === ot) return;
|
|
1894
|
+
const Lt = s.create(J * s.create(k + Ft * N));
|
|
1895
|
+
if (Lt === ot) return;
|
|
1896
|
+
let xe = (vt.x === Ft ? 0 : 2) | Number(vt.y & ht), Be = Lt;
|
|
1897
|
+
return E && O(Lt) && (Be = s.neg(Lt), xe ^= 1), new T(Ft, Be, H ? void 0 : xe);
|
|
1958
1898
|
}
|
|
1959
1899
|
return {
|
|
1960
|
-
seed:
|
|
1961
|
-
k2sig:
|
|
1900
|
+
seed: I,
|
|
1901
|
+
k2sig: j
|
|
1962
1902
|
};
|
|
1963
1903
|
}
|
|
1964
|
-
function
|
|
1965
|
-
const { seed:
|
|
1966
|
-
return
|
|
1904
|
+
function h(d, l, b = {}) {
|
|
1905
|
+
const { seed: E, k2sig: p } = F(d, l, b);
|
|
1906
|
+
return Wn(n.outputLen, s.BYTES, i)(E, p).toBytes(b.format);
|
|
1967
1907
|
}
|
|
1968
|
-
function
|
|
1969
|
-
const { lowS:
|
|
1970
|
-
if (
|
|
1971
|
-
const
|
|
1972
|
-
throw new Error("verify expects Uint8Array signature" +
|
|
1908
|
+
function y(d, l, b, E = {}) {
|
|
1909
|
+
const { lowS: p, prehash: v, format: S } = Xt(E, _);
|
|
1910
|
+
if (b = W(b, void 0, "publicKey"), l = X(l, v), !fn(d)) {
|
|
1911
|
+
const N = d instanceof T ? ", use sig.toBytes()" : "";
|
|
1912
|
+
throw new Error("verify expects Uint8Array signature" + N);
|
|
1973
1913
|
}
|
|
1974
|
-
|
|
1914
|
+
Z(d, S);
|
|
1975
1915
|
try {
|
|
1976
|
-
const
|
|
1977
|
-
if (
|
|
1978
|
-
const { r:
|
|
1979
|
-
return
|
|
1916
|
+
const N = T.fromBytes(d, S), L = t.fromBytes(b);
|
|
1917
|
+
if (p && N.hasHighS()) return !1;
|
|
1918
|
+
const { r: I, s: k } = N, j = $(l), V = s.inv(k), U = s.create(j * V), J = s.create(I * V), vt = t.BASE.multiplyUnsafe(U).add(L.multiplyUnsafe(J));
|
|
1919
|
+
return vt.is0() ? !1 : s.create(vt.x) === I;
|
|
1980
1920
|
} catch {
|
|
1981
1921
|
return !1;
|
|
1982
1922
|
}
|
|
1983
1923
|
}
|
|
1984
|
-
function
|
|
1985
|
-
const { prehash:
|
|
1986
|
-
return
|
|
1924
|
+
function B(d, l, b = {}) {
|
|
1925
|
+
const { prehash: E } = Xt(b, _);
|
|
1926
|
+
return l = X(l, E), T.fromBytes(d, "recovered").recoverPublicKey(l).toBytes();
|
|
1987
1927
|
}
|
|
1988
1928
|
return Object.freeze({
|
|
1989
|
-
keygen:
|
|
1990
|
-
getPublicKey:
|
|
1991
|
-
getSharedSecret:
|
|
1992
|
-
utils:
|
|
1993
|
-
lengths:
|
|
1929
|
+
keygen: f,
|
|
1930
|
+
getPublicKey: g,
|
|
1931
|
+
getSharedSecret: m,
|
|
1932
|
+
utils: w,
|
|
1933
|
+
lengths: A,
|
|
1994
1934
|
Point: t,
|
|
1995
|
-
sign:
|
|
1996
|
-
verify:
|
|
1997
|
-
recoverPublicKey:
|
|
1998
|
-
Signature:
|
|
1999
|
-
hash:
|
|
1935
|
+
sign: h,
|
|
1936
|
+
verify: y,
|
|
1937
|
+
recoverPublicKey: B,
|
|
1938
|
+
Signature: T,
|
|
1939
|
+
hash: n
|
|
2000
1940
|
});
|
|
2001
1941
|
}
|
|
2002
|
-
|
|
2003
|
-
var Ae = {
|
|
1942
|
+
var ve = {
|
|
2004
1943
|
p: BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),
|
|
2005
1944
|
n: BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),
|
|
2006
1945
|
h: BigInt(1),
|
|
@@ -2008,95 +1947,55 @@ var Ae = {
|
|
|
2008
1947
|
b: BigInt(7),
|
|
2009
1948
|
Gx: BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),
|
|
2010
1949
|
Gy: BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")
|
|
2011
|
-
},
|
|
1950
|
+
}, pr = {
|
|
2012
1951
|
beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),
|
|
2013
1952
|
basises: [[BigInt("0x3086d221a7d46bcde86c90e49284eb15"), -BigInt("0xe4437ed6010e88286f547fa90abfe4c3")], [BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"), BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]
|
|
2014
|
-
},
|
|
2015
|
-
function
|
|
2016
|
-
const e =
|
|
2017
|
-
if (!
|
|
2018
|
-
return
|
|
2019
|
-
}
|
|
2020
|
-
var
|
|
2021
|
-
Fp:
|
|
2022
|
-
endo:
|
|
2023
|
-
}),
|
|
2024
|
-
[
|
|
2025
|
-
"0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7",
|
|
2026
|
-
"0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581",
|
|
2027
|
-
"0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262",
|
|
2028
|
-
"0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"
|
|
2029
|
-
],
|
|
2030
|
-
[
|
|
2031
|
-
"0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b",
|
|
2032
|
-
"0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14",
|
|
2033
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001"
|
|
2034
|
-
],
|
|
2035
|
-
[
|
|
2036
|
-
"0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c",
|
|
2037
|
-
"0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3",
|
|
2038
|
-
"0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931",
|
|
2039
|
-
"0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"
|
|
2040
|
-
],
|
|
2041
|
-
[
|
|
2042
|
-
"0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b",
|
|
2043
|
-
"0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573",
|
|
2044
|
-
"0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f",
|
|
2045
|
-
"0x0000000000000000000000000000000000000000000000000000000000000001"
|
|
2046
|
-
]
|
|
2047
|
-
].map((t) => t.map((e) => BigInt(e)))), Rr = pr(gt, {
|
|
2048
|
-
A: BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),
|
|
2049
|
-
B: BigInt("1771"),
|
|
2050
|
-
Z: gt.create(BigInt("-11"))
|
|
2051
|
-
}), Dr = gr(Sn, (t) => {
|
|
2052
|
-
const { x: e, y: r } = Rr(gt.create(t[0]));
|
|
2053
|
-
return Sr(e, r);
|
|
2054
|
-
}, {
|
|
2055
|
-
DST: "secp256k1_XMD:SHA-256_SSWU_RO_",
|
|
2056
|
-
encodeDST: "secp256k1_XMD:SHA-256_SSWU_NU_",
|
|
2057
|
-
p: gt.ORDER,
|
|
2058
|
-
m: 1,
|
|
2059
|
-
k: 128,
|
|
2060
|
-
expand: "xmd",
|
|
2061
|
-
hash: zt
|
|
2062
|
-
});
|
|
1953
|
+
}, qe = /* @__PURE__ */ BigInt(2);
|
|
1954
|
+
function yr(t) {
|
|
1955
|
+
const e = ve.p, r = BigInt(3), n = BigInt(6), o = BigInt(11), i = BigInt(22), c = BigInt(23), s = BigInt(44), a = BigInt(88), u = t * t * t % e, f = u * u * t % e, g = P(P(P(f, r, e) * f % e, r, e) * f % e, qe, e) * u % e, m = P(g, o, e) * g % e, w = P(m, i, e) * m % e, A = P(w, s, e) * w % e, _ = P(P(P(P(P(P(A, a, e) * A % e, s, e) * w % e, r, e) * f % e, c, e) * m % e, n, e) * u % e, qe, e);
|
|
1956
|
+
if (!ue.eql(ue.sqr(_), t)) throw new Error("Cannot find square root");
|
|
1957
|
+
return _;
|
|
1958
|
+
}
|
|
1959
|
+
var ue = jt(ve.p, { sqrt: yr }), Er = /* @__PURE__ */ gr(ve, {
|
|
1960
|
+
Fp: ue,
|
|
1961
|
+
endo: pr
|
|
1962
|
+
}), Ur = /* @__PURE__ */ wr(Er, ge);
|
|
2063
1963
|
export {
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
Nr as
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
qn as y
|
|
1964
|
+
Tn as A,
|
|
1965
|
+
_r as C,
|
|
1966
|
+
Je as D,
|
|
1967
|
+
Br as E,
|
|
1968
|
+
xt as F,
|
|
1969
|
+
It as I,
|
|
1970
|
+
vr as L,
|
|
1971
|
+
xr as M,
|
|
1972
|
+
Ln as N,
|
|
1973
|
+
Nn as O,
|
|
1974
|
+
Bt as P,
|
|
1975
|
+
Vn as S,
|
|
1976
|
+
ge as T,
|
|
1977
|
+
Ir as _,
|
|
1978
|
+
an as a,
|
|
1979
|
+
Yn as b,
|
|
1980
|
+
Mn as c,
|
|
1981
|
+
nn as d,
|
|
1982
|
+
Rr as f,
|
|
1983
|
+
Or as g,
|
|
1984
|
+
Hr as h,
|
|
1985
|
+
lt as i,
|
|
1986
|
+
Un as j,
|
|
1987
|
+
Wt as k,
|
|
1988
|
+
Lr as l,
|
|
1989
|
+
Sr as m,
|
|
1990
|
+
tt as n,
|
|
1991
|
+
Gn as o,
|
|
1992
|
+
Ar as p,
|
|
1993
|
+
Ct as r,
|
|
1994
|
+
Tr as s,
|
|
1995
|
+
Ur as t,
|
|
1996
|
+
Nr as u,
|
|
1997
|
+
zn as v,
|
|
1998
|
+
Zn as w,
|
|
1999
|
+
Fr as x,
|
|
2000
|
+
Cn as y
|
|
2102
2001
|
};
|