@bsv/sdk 1.0.29 → 1.0.32
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/dist/cjs/mod.js +25 -0
- package/dist/cjs/mod.js.map +1 -0
- package/dist/cjs/package.json +49 -0
- package/dist/cjs/src/compat/BSM.js +77 -0
- package/dist/cjs/src/compat/BSM.js.map +1 -0
- package/dist/cjs/src/compat/ECIES.js +512 -0
- package/dist/cjs/src/compat/ECIES.js.map +1 -0
- package/dist/cjs/src/compat/HD.js +344 -0
- package/dist/cjs/src/compat/HD.js.map +1 -0
- package/dist/cjs/src/compat/Mnemonic.js +298 -0
- package/dist/cjs/src/compat/Mnemonic.js.map +1 -0
- package/dist/cjs/src/compat/bip-39-wordlist-en.js +2057 -0
- package/dist/cjs/src/compat/bip-39-wordlist-en.js.map +1 -0
- package/dist/cjs/src/compat/index.js +37 -0
- package/dist/cjs/src/compat/index.js.map +1 -0
- package/dist/cjs/src/messages/EncryptedMessage.js +69 -0
- package/dist/cjs/src/messages/EncryptedMessage.js.map +1 -0
- package/dist/cjs/src/messages/SignedMessage.js +85 -0
- package/dist/cjs/src/messages/SignedMessage.js.map +1 -0
- package/dist/cjs/src/messages/index.js +29 -0
- package/dist/cjs/src/messages/index.js.map +1 -0
- package/dist/cjs/src/primitives/AESGCM.js +384 -0
- package/dist/cjs/src/primitives/AESGCM.js.map +1 -0
- package/dist/cjs/src/primitives/BasePoint.js +19 -0
- package/dist/cjs/src/primitives/BasePoint.js.map +1 -0
- package/dist/cjs/src/primitives/BigNumber.js +4272 -0
- package/dist/cjs/src/primitives/BigNumber.js.map +1 -0
- package/dist/cjs/src/primitives/Curve.js +1126 -0
- package/dist/cjs/src/primitives/Curve.js.map +1 -0
- package/dist/cjs/src/primitives/DRBG.js +99 -0
- package/dist/cjs/src/primitives/DRBG.js.map +1 -0
- package/dist/cjs/src/primitives/ECDSA.js +169 -0
- package/dist/cjs/src/primitives/ECDSA.js.map +1 -0
- package/dist/cjs/src/primitives/Hash.js +1387 -0
- package/dist/cjs/src/primitives/Hash.js.map +1 -0
- package/dist/cjs/src/primitives/JacobianPoint.js +400 -0
- package/dist/cjs/src/primitives/JacobianPoint.js.map +1 -0
- package/dist/cjs/src/primitives/K256.js +111 -0
- package/dist/cjs/src/primitives/K256.js.map +1 -0
- package/dist/cjs/src/primitives/Mersenne.js +118 -0
- package/dist/cjs/src/primitives/Mersenne.js.map +1 -0
- package/dist/cjs/src/primitives/MontgomoryMethod.js +150 -0
- package/dist/cjs/src/primitives/MontgomoryMethod.js.map +1 -0
- package/dist/cjs/src/primitives/Point.js +819 -0
- package/dist/cjs/src/primitives/Point.js.map +1 -0
- package/dist/cjs/src/primitives/PrivateKey.js +246 -0
- package/dist/cjs/src/primitives/PrivateKey.js.map +1 -0
- package/dist/cjs/src/primitives/PublicKey.js +168 -0
- package/dist/cjs/src/primitives/PublicKey.js.map +1 -0
- package/dist/cjs/src/primitives/Random.js +57 -0
- package/dist/cjs/src/primitives/Random.js.map +1 -0
- package/dist/cjs/src/primitives/ReductionContext.js +490 -0
- package/dist/cjs/src/primitives/ReductionContext.js.map +1 -0
- package/dist/cjs/src/primitives/Signature.js +357 -0
- package/dist/cjs/src/primitives/Signature.js.map +1 -0
- package/dist/cjs/src/primitives/SymmetricKey.js +82 -0
- package/dist/cjs/src/primitives/SymmetricKey.js.map +1 -0
- package/dist/cjs/src/primitives/TransactionSignature.js +172 -0
- package/dist/cjs/src/primitives/TransactionSignature.js.map +1 -0
- package/dist/cjs/src/primitives/index.js +51 -0
- package/dist/cjs/src/primitives/index.js.map +1 -0
- package/dist/cjs/src/primitives/utils.js +624 -0
- package/dist/cjs/src/primitives/utils.js.map +1 -0
- package/dist/cjs/src/script/LockingScript.js +35 -0
- package/dist/cjs/src/script/LockingScript.js.map +1 -0
- package/dist/cjs/src/script/OP.js +207 -0
- package/dist/cjs/src/script/OP.js.map +1 -0
- package/dist/cjs/src/script/Script.js +435 -0
- package/dist/cjs/src/script/Script.js.map +1 -0
- package/dist/cjs/src/script/ScriptChunk.js +3 -0
- package/dist/cjs/src/script/ScriptChunk.js.map +1 -0
- package/dist/cjs/src/script/ScriptTemplate.js +3 -0
- package/dist/cjs/src/script/ScriptTemplate.js.map +1 -0
- package/dist/cjs/src/script/Spend.js +1252 -0
- package/dist/cjs/src/script/Spend.js.map +1 -0
- package/dist/cjs/src/script/UnlockingScript.js +35 -0
- package/dist/cjs/src/script/UnlockingScript.js.map +1 -0
- package/dist/cjs/src/script/index.js +32 -0
- package/dist/cjs/src/script/index.js.map +1 -0
- package/dist/cjs/src/script/templates/P2PKH.js +120 -0
- package/dist/cjs/src/script/templates/P2PKH.js.map +1 -0
- package/dist/cjs/src/script/templates/RPuzzle.js +125 -0
- package/dist/cjs/src/script/templates/RPuzzle.js.map +1 -0
- package/dist/cjs/src/script/templates/index.js +11 -0
- package/dist/cjs/src/script/templates/index.js.map +1 -0
- package/dist/cjs/src/transaction/Broadcaster.js +3 -0
- package/dist/cjs/src/transaction/Broadcaster.js.map +1 -0
- package/dist/cjs/src/transaction/ChainTracker.js +3 -0
- package/dist/cjs/src/transaction/ChainTracker.js.map +1 -0
- package/dist/cjs/src/transaction/FeeModel.js +3 -0
- package/dist/cjs/src/transaction/FeeModel.js.map +1 -0
- package/dist/cjs/src/transaction/MerklePath.js +239 -0
- package/dist/cjs/src/transaction/MerklePath.js.map +1 -0
- package/dist/cjs/src/transaction/Transaction.js +616 -0
- package/dist/cjs/src/transaction/Transaction.js.map +1 -0
- package/dist/cjs/src/transaction/TransactionInput.js +3 -0
- package/dist/cjs/src/transaction/TransactionInput.js.map +1 -0
- package/dist/cjs/src/transaction/TransactionOutput.js +3 -0
- package/dist/cjs/src/transaction/TransactionOutput.js.map +1 -0
- package/dist/cjs/src/transaction/broadcasters/ARC.js +112 -0
- package/dist/cjs/src/transaction/broadcasters/ARC.js.map +1 -0
- package/dist/cjs/src/transaction/broadcasters/index.js +9 -0
- package/dist/cjs/src/transaction/broadcasters/index.js.map +1 -0
- package/dist/cjs/src/transaction/fee-models/SatoshisPerKilobyte.js +69 -0
- package/dist/cjs/src/transaction/fee-models/SatoshisPerKilobyte.js.map +1 -0
- package/dist/cjs/src/transaction/fee-models/index.js +9 -0
- package/dist/cjs/src/transaction/fee-models/index.js.map +1 -0
- package/dist/cjs/src/transaction/index.js +11 -0
- package/dist/cjs/src/transaction/index.js.map +1 -0
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/esm/mod.js +9 -0
- package/dist/esm/mod.js.map +1 -0
- package/dist/esm/src/compat/BSM.js +45 -0
- package/dist/esm/src/compat/BSM.js.map +1 -0
- package/dist/esm/src/compat/ECIES.js +483 -0
- package/dist/esm/src/compat/ECIES.js.map +1 -0
- package/dist/esm/src/compat/HD.js +322 -0
- package/dist/esm/src/compat/HD.js.map +1 -0
- package/dist/esm/src/compat/Mnemonic.js +272 -0
- package/dist/esm/src/compat/Mnemonic.js.map +1 -0
- package/dist/esm/src/compat/bip-39-wordlist-en.js +2054 -0
- package/dist/esm/src/compat/bip-39-wordlist-en.js.map +1 -0
- package/dist/esm/src/compat/index.js +5 -0
- package/dist/esm/src/compat/index.js.map +1 -0
- package/dist/esm/src/messages/EncryptedMessage.js +61 -0
- package/dist/esm/src/messages/EncryptedMessage.js.map +1 -0
- package/dist/esm/src/messages/SignedMessage.js +77 -0
- package/dist/esm/src/messages/SignedMessage.js.map +1 -0
- package/dist/esm/src/messages/index.js +3 -0
- package/dist/esm/src/messages/index.js.map +1 -0
- package/dist/esm/src/primitives/AESGCM.js +371 -0
- package/dist/esm/src/primitives/AESGCM.js.map +1 -0
- package/dist/esm/src/primitives/BasePoint.js +16 -0
- package/dist/esm/src/primitives/BasePoint.js.map +1 -0
- package/dist/esm/src/primitives/BigNumber.js +4307 -0
- package/dist/esm/src/primitives/BigNumber.js.map +1 -0
- package/dist/esm/src/primitives/Curve.js +1141 -0
- package/dist/esm/src/primitives/Curve.js.map +1 -0
- package/dist/esm/src/primitives/DRBG.js +98 -0
- package/dist/esm/src/primitives/DRBG.js.map +1 -0
- package/dist/esm/src/primitives/ECDSA.js +161 -0
- package/dist/esm/src/primitives/ECDSA.js.map +1 -0
- package/dist/esm/src/primitives/Hash.js +1391 -0
- package/dist/esm/src/primitives/Hash.js.map +1 -0
- package/dist/esm/src/primitives/JacobianPoint.js +398 -0
- package/dist/esm/src/primitives/JacobianPoint.js.map +1 -0
- package/dist/esm/src/primitives/K256.js +105 -0
- package/dist/esm/src/primitives/K256.js.map +1 -0
- package/dist/esm/src/primitives/Mersenne.js +117 -0
- package/dist/esm/src/primitives/Mersenne.js.map +1 -0
- package/dist/esm/src/primitives/MontgomoryMethod.js +149 -0
- package/dist/esm/src/primitives/MontgomoryMethod.js.map +1 -0
- package/dist/esm/src/primitives/Point.js +816 -0
- package/dist/esm/src/primitives/Point.js.map +1 -0
- package/dist/esm/src/primitives/PrivateKey.js +240 -0
- package/dist/esm/src/primitives/PrivateKey.js.map +1 -0
- package/dist/esm/src/primitives/PublicKey.js +162 -0
- package/dist/esm/src/primitives/PublicKey.js.map +1 -0
- package/dist/esm/src/primitives/Random.js +56 -0
- package/dist/esm/src/primitives/Random.js.map +1 -0
- package/dist/esm/src/primitives/ReductionContext.js +486 -0
- package/dist/esm/src/primitives/ReductionContext.js.map +1 -0
- package/dist/esm/src/primitives/Signature.js +360 -0
- package/dist/esm/src/primitives/Signature.js.map +1 -0
- package/dist/esm/src/primitives/SymmetricKey.js +76 -0
- package/dist/esm/src/primitives/SymmetricKey.js.map +1 -0
- package/dist/esm/src/primitives/TransactionSignature.js +144 -0
- package/dist/esm/src/primitives/TransactionSignature.js.map +1 -0
- package/dist/esm/src/primitives/index.js +13 -0
- package/dist/esm/src/primitives/index.js.map +1 -0
- package/dist/esm/src/primitives/utils.js +609 -0
- package/dist/esm/src/primitives/utils.js.map +1 -0
- package/dist/esm/src/script/LockingScript.js +29 -0
- package/dist/esm/src/script/LockingScript.js.map +1 -0
- package/dist/esm/src/script/OP.js +205 -0
- package/dist/esm/src/script/OP.js.map +1 -0
- package/dist/esm/src/script/Script.js +430 -0
- package/dist/esm/src/script/Script.js.map +1 -0
- package/dist/esm/src/script/ScriptChunk.js +2 -0
- package/dist/esm/src/script/ScriptChunk.js.map +1 -0
- package/dist/esm/src/script/ScriptTemplate.js +2 -0
- package/dist/esm/src/script/ScriptTemplate.js.map +1 -0
- package/dist/esm/src/script/Spend.js +1240 -0
- package/dist/esm/src/script/Spend.js.map +1 -0
- package/dist/esm/src/script/UnlockingScript.js +29 -0
- package/dist/esm/src/script/UnlockingScript.js.map +1 -0
- package/dist/esm/src/script/index.js +7 -0
- package/dist/esm/src/script/index.js.map +1 -0
- package/dist/esm/src/script/templates/P2PKH.js +113 -0
- package/dist/esm/src/script/templates/P2PKH.js.map +1 -0
- package/dist/esm/src/script/templates/RPuzzle.js +119 -0
- package/dist/esm/src/script/templates/RPuzzle.js.map +1 -0
- package/dist/esm/src/script/templates/index.js +3 -0
- package/dist/esm/src/script/templates/index.js.map +1 -0
- package/dist/esm/src/transaction/Broadcaster.js +2 -0
- package/dist/esm/src/transaction/Broadcaster.js.map +1 -0
- package/dist/esm/src/transaction/ChainTracker.js +2 -0
- package/dist/esm/src/transaction/ChainTracker.js.map +1 -0
- package/dist/esm/src/transaction/FeeModel.js +2 -0
- package/dist/esm/src/transaction/FeeModel.js.map +1 -0
- package/dist/esm/src/transaction/MerklePath.js +237 -0
- package/dist/esm/src/transaction/MerklePath.js.map +1 -0
- package/dist/esm/src/transaction/Transaction.js +617 -0
- package/dist/esm/src/transaction/Transaction.js.map +1 -0
- package/dist/esm/src/transaction/TransactionInput.js +2 -0
- package/dist/esm/src/transaction/TransactionInput.js.map +1 -0
- package/dist/esm/src/transaction/TransactionOutput.js +2 -0
- package/dist/esm/src/transaction/TransactionOutput.js.map +1 -0
- package/dist/esm/src/transaction/broadcasters/ARC.js +111 -0
- package/dist/esm/src/transaction/broadcasters/ARC.js.map +1 -0
- package/dist/esm/src/transaction/broadcasters/index.js +2 -0
- package/dist/esm/src/transaction/broadcasters/index.js.map +1 -0
- package/dist/esm/src/transaction/fee-models/SatoshisPerKilobyte.js +71 -0
- package/dist/esm/src/transaction/fee-models/SatoshisPerKilobyte.js.map +1 -0
- package/dist/esm/src/transaction/fee-models/index.js +2 -0
- package/dist/esm/src/transaction/fee-models/index.js.map +1 -0
- package/dist/esm/src/transaction/index.js +3 -0
- package/dist/esm/src/transaction/index.js.map +1 -0
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -0
- package/dist/types/mod.d.ts +9 -0
- package/dist/types/mod.d.ts.map +1 -0
- package/dist/types/src/compat/BSM.d.ts +28 -0
- package/dist/types/src/compat/BSM.d.ts.map +1 -0
- package/dist/types/src/compat/ECIES.d.ts +62 -0
- package/dist/types/src/compat/ECIES.d.ts.map +1 -0
- package/dist/types/src/compat/HD.d.ts +131 -0
- package/dist/types/src/compat/HD.d.ts.map +1 -0
- package/dist/types/src/compat/Mnemonic.d.ts +132 -0
- package/dist/types/src/compat/Mnemonic.d.ts.map +1 -0
- package/dist/types/src/compat/bip-39-wordlist-en.d.ts +5 -0
- package/dist/types/src/compat/bip-39-wordlist-en.d.ts.map +1 -0
- package/dist/types/src/compat/index.d.ts +5 -0
- package/dist/types/src/compat/index.d.ts.map +1 -0
- package/dist/types/src/messages/EncryptedMessage.d.ts +20 -0
- package/dist/types/src/messages/EncryptedMessage.d.ts.map +1 -0
- package/dist/types/src/messages/SignedMessage.d.ts +21 -0
- package/dist/types/src/messages/SignedMessage.d.ts.map +1 -0
- package/dist/types/src/messages/index.d.ts +3 -0
- package/dist/types/src/messages/index.d.ts.map +1 -0
- package/dist/types/src/primitives/AESGCM.d.ts +14 -0
- package/dist/types/src/primitives/AESGCM.d.ts.map +1 -0
- package/dist/types/src/primitives/BasePoint.d.ts +22 -0
- package/dist/types/src/primitives/BasePoint.d.ts.map +1 -0
- package/dist/types/src/primitives/BigNumber.d.ts +1895 -0
- package/dist/types/src/primitives/BigNumber.d.ts.map +1 -0
- package/dist/types/src/primitives/Curve.d.ts +55 -0
- package/dist/types/src/primitives/Curve.d.ts.map +1 -0
- package/dist/types/src/primitives/DRBG.d.ts +54 -0
- package/dist/types/src/primitives/DRBG.d.ts.map +1 -0
- package/dist/types/src/primitives/ECDSA.d.ts +39 -0
- package/dist/types/src/primitives/ECDSA.d.ts.map +1 -0
- package/dist/types/src/primitives/Hash.d.ts +450 -0
- package/dist/types/src/primitives/Hash.d.ts.map +1 -0
- package/dist/types/src/primitives/JacobianPoint.d.ts +164 -0
- package/dist/types/src/primitives/JacobianPoint.d.ts.map +1 -0
- package/dist/types/src/primitives/K256.d.ts +53 -0
- package/dist/types/src/primitives/K256.d.ts.map +1 -0
- package/dist/types/src/primitives/Mersenne.d.ts +72 -0
- package/dist/types/src/primitives/Mersenne.d.ts.map +1 -0
- package/dist/types/src/primitives/MontgomoryMethod.d.ts +96 -0
- package/dist/types/src/primitives/MontgomoryMethod.d.ts.map +1 -0
- package/dist/types/src/primitives/Point.d.ts +303 -0
- package/dist/types/src/primitives/Point.d.ts.map +1 -0
- package/dist/types/src/primitives/PrivateKey.d.ts +174 -0
- package/dist/types/src/primitives/PrivateKey.d.ts.map +1 -0
- package/dist/types/src/primitives/PublicKey.d.ts +120 -0
- package/dist/types/src/primitives/PublicKey.d.ts.map +1 -0
- package/dist/types/src/primitives/Random.d.ts +14 -0
- package/dist/types/src/primitives/Random.d.ts.map +1 -0
- package/dist/types/src/primitives/ReductionContext.d.ts +308 -0
- package/dist/types/src/primitives/ReductionContext.d.ts.map +1 -0
- package/dist/types/src/primitives/Signature.d.ts +162 -0
- package/dist/types/src/primitives/Signature.d.ts.map +1 -0
- package/dist/types/src/primitives/SymmetricKey.d.ts +55 -0
- package/dist/types/src/primitives/SymmetricKey.d.ts.map +1 -0
- package/dist/types/src/primitives/TransactionSignature.d.ts +36 -0
- package/dist/types/src/primitives/TransactionSignature.d.ts.map +1 -0
- package/dist/types/src/primitives/index.d.ts +13 -0
- package/dist/types/src/primitives/index.d.ts.map +1 -0
- package/dist/types/src/primitives/utils.d.ts +124 -0
- package/dist/types/src/primitives/utils.d.ts.map +1 -0
- package/dist/types/src/script/LockingScript.d.ts +25 -0
- package/dist/types/src/script/LockingScript.d.ts.map +1 -0
- package/dist/types/src/script/OP.d.ts +193 -0
- package/dist/types/src/script/OP.d.ts.map +1 -0
- package/dist/types/src/script/Script.d.ts +148 -0
- package/dist/types/src/script/Script.d.ts.map +1 -0
- package/dist/types/src/script/ScriptChunk.d.ts +8 -0
- package/dist/types/src/script/ScriptChunk.d.ts.map +1 -0
- package/dist/types/src/script/ScriptTemplate.d.ts +33 -0
- package/dist/types/src/script/ScriptTemplate.d.ts.map +1 -0
- package/dist/types/src/script/Spend.d.ts +103 -0
- package/dist/types/src/script/Spend.d.ts.map +1 -0
- package/dist/types/src/script/UnlockingScript.d.ts +25 -0
- package/dist/types/src/script/UnlockingScript.d.ts.map +1 -0
- package/dist/types/src/script/index.d.ts +8 -0
- package/dist/types/src/script/index.d.ts.map +1 -0
- package/dist/types/src/script/templates/P2PKH.d.ts +40 -0
- package/dist/types/src/script/templates/P2PKH.d.ts.map +1 -0
- package/dist/types/src/script/templates/RPuzzle.d.ts +47 -0
- package/dist/types/src/script/templates/RPuzzle.d.ts.map +1 -0
- package/dist/types/src/script/templates/index.d.ts +3 -0
- package/dist/types/src/script/templates/index.d.ts.map +1 -0
- package/dist/types/src/transaction/Broadcaster.d.ts +39 -0
- package/dist/types/src/transaction/Broadcaster.d.ts.map +1 -0
- package/dist/types/src/transaction/ChainTracker.d.ts +23 -0
- package/dist/types/src/transaction/ChainTracker.d.ts.map +1 -0
- package/dist/types/src/transaction/FeeModel.d.ts +12 -0
- package/dist/types/src/transaction/FeeModel.d.ts.map +1 -0
- package/dist/types/src/transaction/MerklePath.d.ts +91 -0
- package/dist/types/src/transaction/MerklePath.d.ts.map +1 -0
- package/dist/types/src/transaction/Transaction.d.ts +215 -0
- package/dist/types/src/transaction/Transaction.d.ts.map +1 -0
- package/dist/types/src/transaction/TransactionInput.d.ts +63 -0
- package/dist/types/src/transaction/TransactionInput.d.ts.map +1 -0
- package/dist/types/src/transaction/TransactionOutput.d.ts +36 -0
- package/dist/types/src/transaction/TransactionOutput.d.ts.map +1 -0
- package/dist/types/src/transaction/broadcasters/ARC.d.ts +28 -0
- package/dist/types/src/transaction/broadcasters/ARC.d.ts.map +1 -0
- package/dist/types/src/transaction/broadcasters/index.d.ts +2 -0
- package/dist/types/src/transaction/broadcasters/index.d.ts.map +1 -0
- package/dist/types/src/transaction/fee-models/SatoshisPerKilobyte.d.ts +26 -0
- package/dist/types/src/transaction/fee-models/SatoshisPerKilobyte.d.ts.map +1 -0
- package/dist/types/src/transaction/fee-models/index.d.ts +2 -0
- package/dist/types/src/transaction/fee-models/index.d.ts.map +1 -0
- package/dist/types/src/transaction/index.d.ts +7 -0
- package/dist/types/src/transaction/index.d.ts.map +1 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BigNumber.d.ts","sourceRoot":"","sources":["../../../../src/primitives/BigNumber.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,uBAAuB,CAAA;AAEpD;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,CA2BrB;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,CAO1B;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,CAO1B;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAK;IAE5B;;;;;;;;;;OAUG;IACH,QAAQ,EAAE,MAAM,CAAA;IAEhB;;;;;;;;OAQG;IACH,KAAK,EAAE,MAAM,EAAE,CAAA;IAEf;;;;;;;;OAQG;IACH,MAAM,E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AE,MAAM,GAAG,SAAS;IAIxC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,UAAU,CAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS;IAIjE;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,MAAM,CAAE,GAAG,EAAE,MAAM,EAAE,EAAE,MAAM,GAAE,KAAK,GAAG,QAAgB,GAAG,SAAS;IAoB1E;;;;;;;;;;OAUG;IACH,IAAI,CAAE,MAAM,GAAE,KAAK,GAAG,QAAgB,GAAG,MAAM,EAAE;IA2BjD;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,QAAQ,CAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,OAAe,GAAG,SAAS;IAkClE;;;;;;;;;OASG;IACH,MAAM,IAAK,MAAM;IAgDjB;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,aAAa,CAClB,GAAG,EAAE,MAAM,EAAE,EAAE,cAAc,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM,GAC3D,SAAS;IA4BZ;;;;;;;;;OASG;IACH,WAAW,IAAK,MAAM,EAAE;CAGzB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import BigNumber from './BigNumber.js';
|
|
2
|
+
import ReductionContext from './ReductionContext.js';
|
|
3
|
+
import Point from './Point.js';
|
|
4
|
+
export default class Curve {
|
|
5
|
+
p: BigNumber;
|
|
6
|
+
red: ReductionContext;
|
|
7
|
+
redN: BigNumber | null;
|
|
8
|
+
zero: BigNumber;
|
|
9
|
+
one: BigNumber;
|
|
10
|
+
two: BigNumber;
|
|
11
|
+
g: Point;
|
|
12
|
+
n: BigNumber;
|
|
13
|
+
a: BigNumber;
|
|
14
|
+
b: BigNumber;
|
|
15
|
+
tinv: BigNumber;
|
|
16
|
+
zeroA: boolean;
|
|
17
|
+
threeA: boolean;
|
|
18
|
+
endo: any;
|
|
19
|
+
_endoWnafT1: any[];
|
|
20
|
+
_endoWnafT2: any[];
|
|
21
|
+
_wnafT1: any[];
|
|
22
|
+
_wnafT2: any[];
|
|
23
|
+
_wnafT3: any[];
|
|
24
|
+
_wnafT4: any[];
|
|
25
|
+
_bitLength: number;
|
|
26
|
+
static assert(expression: unknown, message?: string): void;
|
|
27
|
+
getNAF(num: BigNumber, w: number, bits: number): number[];
|
|
28
|
+
getJSF(k1: BigNumber, k2: BigNumber): number[][];
|
|
29
|
+
static cachedProperty(obj: any, name: string, computer: any): void;
|
|
30
|
+
static parseBytes(bytes: string | number[]): number[];
|
|
31
|
+
static intFromLE(bytes: number[]): BigNumber;
|
|
32
|
+
constructor();
|
|
33
|
+
_getEndomorphism(conf: any): {
|
|
34
|
+
beta: BigNumber;
|
|
35
|
+
lambda: BigNumber;
|
|
36
|
+
basis: Array<{
|
|
37
|
+
a: BigNumber;
|
|
38
|
+
b: BigNumber;
|
|
39
|
+
}>;
|
|
40
|
+
} | undefined;
|
|
41
|
+
_getEndoRoots(num: BigNumber): [BigNumber, BigNumber];
|
|
42
|
+
_getEndoBasis(lambda: BigNumber): [{
|
|
43
|
+
a: BigNumber;
|
|
44
|
+
b: BigNumber;
|
|
45
|
+
}, {
|
|
46
|
+
a: BigNumber;
|
|
47
|
+
b: BigNumber;
|
|
48
|
+
}];
|
|
49
|
+
_endoSplit(k: BigNumber): {
|
|
50
|
+
k1: BigNumber;
|
|
51
|
+
k2: BigNumber;
|
|
52
|
+
};
|
|
53
|
+
validate(point: Point): boolean;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=Curve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Curve.d.ts","sourceRoot":"","sources":["../../../../src/primitives/Curve.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,gBAAgB,MAAM,uBAAuB,CAAA;AAEpD,OAAO,KAAK,MAAM,YAAY,CAAA;AAQ9B,MAAM,CAA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B,CAAE,IAAI,KAAA,GAAG;QACvB,IAAI,EAAE,SAAS,CAAA;QACf,MAAM,EAAE,SAAS,CAAA;QACjB,KAAK,EAAE,KAAK,CAAC;YAAE,CAAC,EAAE,SAAS,CAAC;YAAC,CAAC,EAAE,SAAS,CAAA;SAAE,CAAC,CAAA;KAC7C,GAAG,SAAS;IAgDb,aAAa,CAAE,GAAG,EAAE,SAAS,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC;IAetD,aAAa,CAAE,MAAM,EAAE,SAAS,GAAG,CAAC;QAAE,CAAC,EAAE,SAAS,CAAC;QAAC,CAAC,EAAE,SAAS,CAAA;KAAE,EAAE;QAAE,CAAC,EAAE,SAAS,CAAC;QAAC,CAAC,EAAE,SAAS,CAAA;KAAE,CAAC;IA4EnG,UAAU,CAAE,CAAC,EAAE,SAAS,GAAG;QAAE,EAAE,EAAE,SAAS,CAAC;QAAC,EAAE,EAAE,SAAS,CAAA;KAAE;IAmB3D,QAAQ,CAAE,KAAK,EAAE,KAAK,GAAG,OAAO;CAUjC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { SHA256HMAC } from './Hash.js';
|
|
2
|
+
/**
|
|
3
|
+
* This class behaves as a HMAC-based deterministic random bit generator (DRBG). It implements a deterministic random number generator using SHA256HMAC HASH function. It takes an initial entropy and nonce when instantiated for seeding purpose.
|
|
4
|
+
* @class DRBG
|
|
5
|
+
*
|
|
6
|
+
* @constructor
|
|
7
|
+
* @param entropy - Initial entropy either in number array or hexadecimal string.
|
|
8
|
+
* @param nonce - Initial nonce either in number array or hexadecimal string.
|
|
9
|
+
*
|
|
10
|
+
* @throws Throws an error message 'Not enough entropy. Minimum is 256 bits' when entropy's length is less than 32.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* const drbg = new DRBG('af12de...', '123ef...');
|
|
14
|
+
*/
|
|
15
|
+
export default class DRBG {
|
|
16
|
+
K: number[];
|
|
17
|
+
V: number[];
|
|
18
|
+
constructor(entropy: number[] | string, nonce: number[] | string);
|
|
19
|
+
/**
|
|
20
|
+
* Generates HMAC using the K value of the instance. This method is used internally for operations.
|
|
21
|
+
*
|
|
22
|
+
* @method hmac
|
|
23
|
+
* @returns The SHA256HMAC object created with K value.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const hmac = drbg.hmac();
|
|
27
|
+
*/
|
|
28
|
+
hmac(): SHA256HMAC;
|
|
29
|
+
/**
|
|
30
|
+
* Updates the `K` and `V` values of the instance based on the seed.
|
|
31
|
+
* The seed if not provided uses `V` as seed.
|
|
32
|
+
*
|
|
33
|
+
* @method update
|
|
34
|
+
* @param seed - an optional value that used to update `K` and `V`. Default is `undefined`.
|
|
35
|
+
* @returns Nothing, but updates the internal state `K` and `V` value.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* drbg.update('e13af...');
|
|
39
|
+
*/
|
|
40
|
+
update(seed?: any): void;
|
|
41
|
+
/**
|
|
42
|
+
* Generates deterministic random hexadecimal string of given length.
|
|
43
|
+
* In every generation process, it also updates the internal state `K` and `V`.
|
|
44
|
+
*
|
|
45
|
+
* @method generate
|
|
46
|
+
* @param len - The length of required random number.
|
|
47
|
+
* @returns The required deterministic random hexadecimal string.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* const randomHex = drbg.generate(256);
|
|
51
|
+
*/
|
|
52
|
+
generate(len: number): string;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=DRBG.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DRBG.d.ts","sourceRoot":"","sources":["../../../../src/primitives/DRBG.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAGtC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,OAAO,IAAI;IACvB,CAAC,EAAE,MAAM,EAAE,CAAA;IACX,CAAC,EAAE,MAAM,EAAE,CAAA;gBAEE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;IAkBjE;;;;;;;;OAQG;IACH,IAAI,IAAK,UAAU;IAInB;;;;;;;;;;OAUG;IACH,MAAM,CAAE,IAAI,CAAC,KAAA,GAAG,IAAI;IAiBpB;;;;;;;;;;OAUG;IACH,QAAQ,CAAE,GAAG,EAAE,MAAM,GAAG,MAAM;CAW/B"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import BigNumber from './BigNumber.js';
|
|
2
|
+
import Signature from './Signature.js';
|
|
3
|
+
import Point from './Point.js';
|
|
4
|
+
/**
|
|
5
|
+
* Generates a digital signature for a given message.
|
|
6
|
+
*
|
|
7
|
+
* @function sign
|
|
8
|
+
* @param msg - The BigNumber message for which the signature has to be computed.
|
|
9
|
+
* @param key - Private key in BigNumber.
|
|
10
|
+
* @param forceLowS - Optional boolean flag if True forces "s" to be the lower of two possible values.
|
|
11
|
+
* @param customK - Optional specification for k value, which can be a function or BigNumber.
|
|
12
|
+
* @returns Returns the elliptic curve digital signature of the message.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const msg = new BigNumber('2664878')
|
|
16
|
+
* const key = new BigNumber('123456')
|
|
17
|
+
* const signature = sign(msg, key)
|
|
18
|
+
*/
|
|
19
|
+
export declare const sign: (msg: BigNumber, key: BigNumber, forceLowS?: boolean, customK?: BigNumber | Function) => Signature;
|
|
20
|
+
/**
|
|
21
|
+
* Verifies a digital signature of a given message.
|
|
22
|
+
*
|
|
23
|
+
* Message and key used during the signature generation process, and the previously computed signature
|
|
24
|
+
* are used to validate the authenticity of the digital signature.
|
|
25
|
+
*
|
|
26
|
+
* @function verify
|
|
27
|
+
* @param msg - The BigNumber message for which the signature has to be verified.
|
|
28
|
+
* @param sig - Signature object consisting of parameters 'r' and 's'.
|
|
29
|
+
* @param key - Public key in Point.
|
|
30
|
+
* @returns Returns true if the signature is valid and false otherwise.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* const msg = new BigNumber('2664878', 16)
|
|
34
|
+
* const key = new Point(new BigNumber(10), new BigNumber(20)
|
|
35
|
+
* const signature = sign(msg, new BigNumber('123456'))
|
|
36
|
+
* const isVerified = verify(msg, sig, key)
|
|
37
|
+
*/
|
|
38
|
+
export declare const verify: (msg: BigNumber, sig: Signature, key: Point) => boolean;
|
|
39
|
+
//# sourceMappingURL=ECDSA.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ECDSA.d.ts","sourceRoot":"","sources":["../../../../src/primitives/ECDSA.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,SAAS,MAAM,gBAAgB,CAAA;AAEtC,OAAO,KAAK,MAAM,YAAY,CAAA;AAiC9B;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,IAAI,QAAS,SAAS,OAAO,SAAS,cAAa,OAAO,YAAoB,SAAS,GAAG,QAAQ,KAAG,SAqEjH,CAAA;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,MAAM,QAAS,SAAS,OAAO,SAAS,OAAO,KAAK,KAAG,OAuBnE,CAAA"}
|
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The BaseHash class is an abstract base class for cryptographic hash functions.
|
|
3
|
+
* It provides a common structure and functionality for hash function classes.
|
|
4
|
+
*
|
|
5
|
+
* @class BaseHash
|
|
6
|
+
*
|
|
7
|
+
* @property pending - Stores partially processed message segments.
|
|
8
|
+
* @property pendingTotal - The total number of characters that are being stored in `pending`
|
|
9
|
+
* @property blockSize - The size of each block to processed.
|
|
10
|
+
* @property outSize - The size of the final hash output.
|
|
11
|
+
* @property endian - The endianness used during processing, can either be 'big' or 'little'.
|
|
12
|
+
* @property _delta8 - The block size divided by 8, useful in various computations.
|
|
13
|
+
* @property _delta32 - The block size divided by 32, useful in various computations.
|
|
14
|
+
* @property padLength - The length of padding to be added to finalize the computation.
|
|
15
|
+
* @property hmacStrength - The HMAC strength value.
|
|
16
|
+
*
|
|
17
|
+
* @param blockSize - The size of the block to be hashed.
|
|
18
|
+
* @param outSize - The size of the resulting hash.
|
|
19
|
+
* @param hmacStrength - The strength of the HMAC.
|
|
20
|
+
* @param padLength - The length of the padding to be added.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* Sub-classes would extend this base BaseHash class like:
|
|
24
|
+
* class RIPEMD160 extends BaseHash {
|
|
25
|
+
* constructor () {
|
|
26
|
+
* super(512, 160, 192, 64);
|
|
27
|
+
* // ...
|
|
28
|
+
* }
|
|
29
|
+
* // ...
|
|
30
|
+
* }
|
|
31
|
+
*/
|
|
32
|
+
declare abstract class BaseHash {
|
|
33
|
+
pending: number[] | null;
|
|
34
|
+
pendingTotal: number;
|
|
35
|
+
blockSize: number;
|
|
36
|
+
outSize: number;
|
|
37
|
+
endian: 'big' | 'little';
|
|
38
|
+
_delta8: number;
|
|
39
|
+
_delta32: number;
|
|
40
|
+
padLength: number;
|
|
41
|
+
hmacStrength: number;
|
|
42
|
+
constructor(blockSize: number, outSize: number, hmacStrength: number, padLength: number);
|
|
43
|
+
_update(msg: number[], start: number): void;
|
|
44
|
+
_digest(): number[];
|
|
45
|
+
_digestHex(): string;
|
|
46
|
+
/**
|
|
47
|
+
* Converts the input message into an array, pads it, and joins into 32bit blocks.
|
|
48
|
+
* If there is enough data, it tries updating the hash computation.
|
|
49
|
+
*
|
|
50
|
+
* @method update
|
|
51
|
+
* @param msg - The message segment to include in the hashing computation.
|
|
52
|
+
* @param enc - The encoding of the message. If 'hex', the string will be treated as such, 'utf8' otherwise.
|
|
53
|
+
*
|
|
54
|
+
* @returns Returns the instance of the object for chaining.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* sha256.update('Hello World', 'utf8');
|
|
58
|
+
*/
|
|
59
|
+
update(msg: number[] | string, enc?: 'hex' | 'utf8'): this;
|
|
60
|
+
/**
|
|
61
|
+
* Finalizes the hash computation and returns the hash value/result.
|
|
62
|
+
*
|
|
63
|
+
* @method digest
|
|
64
|
+
*
|
|
65
|
+
* @returns Returns the final hash value.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* const hash = sha256.digest();
|
|
69
|
+
*/
|
|
70
|
+
digest(): number[];
|
|
71
|
+
/**
|
|
72
|
+
* Finalizes the hash computation and returns the hash value/result as a hex string.
|
|
73
|
+
*
|
|
74
|
+
* @method digest
|
|
75
|
+
*
|
|
76
|
+
* @returns Returns the final hash value as a hex string.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* const hash = sha256.digestHex();
|
|
80
|
+
*/
|
|
81
|
+
digestHex(): string;
|
|
82
|
+
/**
|
|
83
|
+
* [Private Method] Used internally to prepare the padding for the final stage of the hash computation.
|
|
84
|
+
*
|
|
85
|
+
* @method _pad
|
|
86
|
+
* @private
|
|
87
|
+
*
|
|
88
|
+
* @returns Returns an array denoting the padding.
|
|
89
|
+
*/
|
|
90
|
+
private _pad;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
*
|
|
94
|
+
* @param msg
|
|
95
|
+
* @param enc Optional. Encoding to use if msg is string. Default is 'utf8'.
|
|
96
|
+
* @returns array of byte values from msg. If msg is an array, a copy is returned.
|
|
97
|
+
*/
|
|
98
|
+
export declare function toArray(msg: number[] | string, enc?: 'hex' | 'utf8'): number[];
|
|
99
|
+
/**
|
|
100
|
+
* An implementation of RIPEMD160 cryptographic hash function. Extends the BaseHash class.
|
|
101
|
+
* It provides a way to compute a 'digest' for any kind of input data; transforming the data
|
|
102
|
+
* into a unique output of fixed size. The output is deterministic; it will always be
|
|
103
|
+
* the same for the same input.
|
|
104
|
+
*
|
|
105
|
+
* @class RIPEMD160
|
|
106
|
+
* @param None
|
|
107
|
+
*
|
|
108
|
+
* @constructor
|
|
109
|
+
* Use the RIPEMD160 constructor to create an instance of RIPEMD160 hash function.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* const ripemd160 = new RIPEMD160();
|
|
113
|
+
*
|
|
114
|
+
* @property h - Array that is updated iteratively as part of hashing computation.
|
|
115
|
+
*/
|
|
116
|
+
export declare class RIPEMD160 extends BaseHash {
|
|
117
|
+
h: number[];
|
|
118
|
+
constructor();
|
|
119
|
+
_update(msg: number[], start: number): void;
|
|
120
|
+
_digest(): number[];
|
|
121
|
+
_digestHex(): string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* An implementation of SHA256 cryptographic hash function. Extends the BaseHash class.
|
|
125
|
+
* It provides a way to compute a 'digest' for any kind of input data; transforming the data
|
|
126
|
+
* into a unique output of fixed size. The output is deterministic; it will always be
|
|
127
|
+
* the same for the same input.
|
|
128
|
+
*
|
|
129
|
+
* @class SHA256
|
|
130
|
+
* @param None
|
|
131
|
+
*
|
|
132
|
+
* @constructor
|
|
133
|
+
* Use the SHA256 constructor to create an instance of SHA256 hash function.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* const sha256 = new SHA256();
|
|
137
|
+
*
|
|
138
|
+
* @property h - The initial hash constants
|
|
139
|
+
* @property W - Provides a way to recycle usage of the array memory.
|
|
140
|
+
* @property k - The round constants used for each round of SHA-256
|
|
141
|
+
*/
|
|
142
|
+
export declare class SHA256 extends BaseHash {
|
|
143
|
+
h: number[];
|
|
144
|
+
W: number[];
|
|
145
|
+
k: number[];
|
|
146
|
+
constructor();
|
|
147
|
+
_update(msg: number[], start?: number): void;
|
|
148
|
+
_digest(): number[];
|
|
149
|
+
_digestHex(): string;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* An implementation of SHA1 cryptographic hash function. Extends the BaseHash class.
|
|
153
|
+
* It provides a way to compute a 'digest' for any kind of input data; transforming the data
|
|
154
|
+
* into a unique output of fixed size. The output is deterministic; it will always be
|
|
155
|
+
* the same for the same input.
|
|
156
|
+
*
|
|
157
|
+
* @class SHA1
|
|
158
|
+
* @param None
|
|
159
|
+
*
|
|
160
|
+
* @constructor
|
|
161
|
+
* Use the SHA1 constructor to create an instance of SHA1 hash function.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* const sha1 = new SHA1();
|
|
165
|
+
*
|
|
166
|
+
* @property h - The initial hash constants.
|
|
167
|
+
* @property W - Provides a way to recycle usage of the array memory.
|
|
168
|
+
* @property k - The round constants used for each round of SHA-1.
|
|
169
|
+
*/
|
|
170
|
+
export declare class SHA1 extends BaseHash {
|
|
171
|
+
h: number[];
|
|
172
|
+
W: number[];
|
|
173
|
+
k: number[];
|
|
174
|
+
constructor();
|
|
175
|
+
_update(msg: number[], start?: number): void;
|
|
176
|
+
_digest(): number[];
|
|
177
|
+
_digestHex(): string;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* An implementation of SHA512 cryptographic hash function. Extends the BaseHash class.
|
|
181
|
+
* It provides a way to compute a 'digest' for any kind of input data; transforming the data
|
|
182
|
+
* into a unique output of fixed size. The output is deterministic; it will always be
|
|
183
|
+
* the same for the same input.
|
|
184
|
+
*
|
|
185
|
+
* @class SHA512
|
|
186
|
+
* @param None
|
|
187
|
+
*
|
|
188
|
+
* @constructor
|
|
189
|
+
* Use the SHA512 constructor to create an instance of SHA512 hash function.
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* const sha512 = new SHA512();
|
|
193
|
+
*
|
|
194
|
+
* @property h - The initial hash constants.
|
|
195
|
+
* @property W - Provides a way to recycle usage of the array memory.
|
|
196
|
+
* @property k - The round constants used for each round of SHA-512.
|
|
197
|
+
*/
|
|
198
|
+
export declare class SHA512 extends BaseHash {
|
|
199
|
+
h: number[];
|
|
200
|
+
W: number[];
|
|
201
|
+
k: number[];
|
|
202
|
+
constructor();
|
|
203
|
+
_prepareBlock(msg: any, start: any): void;
|
|
204
|
+
_update(msg: any, start: any): void;
|
|
205
|
+
_digest(): number[];
|
|
206
|
+
_digestHex(): string;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* The `SHA256HMAC` class is used to create Hash-based Message Authentication Code (HMAC) using the SHA-256 cryptographic hash function.
|
|
210
|
+
*
|
|
211
|
+
* HMAC is a specific type of MAC involving a cryptographic hash function and a secret cryptographic key. It may be used to simultaneously verify both the data integrity and the authenticity of a message.
|
|
212
|
+
*
|
|
213
|
+
* This class also uses the SHA-256 cryptographic hash algorithm that produces a 256-bit (32-byte) hash value.
|
|
214
|
+
*
|
|
215
|
+
* @property inner - Represents the inner hash of SHA-256.
|
|
216
|
+
* @property outer - Represents the outer hash of SHA-256.
|
|
217
|
+
* @property blockSize - The block size for the SHA-256 hash function, in bytes. It's set to 64 bytes.
|
|
218
|
+
* @property outSize - The output size of the SHA-256 hash function, in bytes. It's set to 32 bytes.
|
|
219
|
+
*/
|
|
220
|
+
export declare class SHA256HMAC {
|
|
221
|
+
inner: SHA256;
|
|
222
|
+
outer: SHA256;
|
|
223
|
+
blockSize: number;
|
|
224
|
+
outSize: number;
|
|
225
|
+
/**
|
|
226
|
+
* The constructor for the `SHA256HMAC` class.
|
|
227
|
+
*
|
|
228
|
+
* It initializes the `SHA256HMAC` object and sets up the inner and outer padded keys.
|
|
229
|
+
* If the key size is larger than the blockSize, it is digested using SHA-256.
|
|
230
|
+
* If the key size is less than the blockSize, it is padded with zeroes.
|
|
231
|
+
*
|
|
232
|
+
* @constructor
|
|
233
|
+
* @param key - The key to use to create the HMAC. Can be a number array or a string in hexadecimal format.
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* const myHMAC = new SHA256HMAC('deadbeef');
|
|
237
|
+
*/
|
|
238
|
+
constructor(key: number[] | string);
|
|
239
|
+
/**
|
|
240
|
+
* Updates the `SHA256HMAC` object with part of the message to be hashed.
|
|
241
|
+
*
|
|
242
|
+
* @method update
|
|
243
|
+
* @param msg - Part of the message to hash. Can be a number array or a string.
|
|
244
|
+
* @param enc - If 'hex', then the input is encoded as hexadecimal. If undefined or not 'hex', then no encoding is performed.
|
|
245
|
+
* @returns Returns the instance of `SHA256HMAC` for chaining calls.
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* myHMAC.update('deadbeef', 'hex');
|
|
249
|
+
*/
|
|
250
|
+
update(msg: number[] | string, enc?: 'hex'): SHA256HMAC;
|
|
251
|
+
/**
|
|
252
|
+
* Finalizes the HMAC computation and returns the resultant hash.
|
|
253
|
+
*
|
|
254
|
+
* @method digest
|
|
255
|
+
* @returns Returns the digest of the hashed data. Can be a number array or a string.
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* let hashedMessage = myHMAC.digest();
|
|
259
|
+
*/
|
|
260
|
+
digest(): number[];
|
|
261
|
+
/**
|
|
262
|
+
* Finalizes the HMAC computation and returns the resultant hash as a hex string.
|
|
263
|
+
*
|
|
264
|
+
* @method digest
|
|
265
|
+
* @returns Returns the digest of the hashed data as a hex string
|
|
266
|
+
*
|
|
267
|
+
* @example
|
|
268
|
+
* let hashedMessage = myHMAC.digestHex();
|
|
269
|
+
*/
|
|
270
|
+
digestHex(): string;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* The `SHA512HMAC` class is used to create Hash-based Message Authentication Code (HMAC) using the SHA-512 cryptographic hash function.
|
|
274
|
+
*
|
|
275
|
+
* HMAC is a specific type of MAC involving a cryptographic hash function and a secret cryptographic key. It may be used to simultaneously verify both the data integrity and the authenticity of a message.
|
|
276
|
+
*
|
|
277
|
+
* This class also uses the SHA-512 cryptographic hash algorithm that produces a 512-bit (64-byte) hash value.
|
|
278
|
+
*
|
|
279
|
+
* @property inner - Represents the inner hash of SHA-512.
|
|
280
|
+
* @property outer - Represents the outer hash of SHA-512.
|
|
281
|
+
* @property blockSize - The block size for the SHA-512 hash function, in bytes. It's set to 128 bytes.
|
|
282
|
+
* @property outSize - The output size of the SHA-512 hash function, in bytes. It's set to 64 bytes.
|
|
283
|
+
*/
|
|
284
|
+
export declare class SHA512HMAC {
|
|
285
|
+
inner: SHA512;
|
|
286
|
+
outer: SHA512;
|
|
287
|
+
blockSize: number;
|
|
288
|
+
outSize: number;
|
|
289
|
+
/**
|
|
290
|
+
* The constructor for the `SHA512HMAC` class.
|
|
291
|
+
*
|
|
292
|
+
* It initializes the `SHA512HMAC` object and sets up the inner and outer padded keys.
|
|
293
|
+
* If the key size is larger than the blockSize, it is digested using SHA-512.
|
|
294
|
+
* If the key size is less than the blockSize, it is padded with zeroes.
|
|
295
|
+
*
|
|
296
|
+
* @constructor
|
|
297
|
+
* @param key - The key to use to create the HMAC. Can be a number array or a string in hexadecimal format.
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* const myHMAC = new SHA512HMAC('deadbeef');
|
|
301
|
+
*/
|
|
302
|
+
constructor(key: number[] | string);
|
|
303
|
+
/**
|
|
304
|
+
* Updates the `SHA512HMAC` object with part of the message to be hashed.
|
|
305
|
+
*
|
|
306
|
+
* @method update
|
|
307
|
+
* @param msg - Part of the message to hash. Can be a number array or a string.
|
|
308
|
+
* @param enc - If 'hex', then the input is encoded as hexadecimal. If undefined or not 'hex', then no encoding is performed.
|
|
309
|
+
* @returns Returns the instance of `SHA512HMAC` for chaining calls.
|
|
310
|
+
*
|
|
311
|
+
* @example
|
|
312
|
+
* myHMAC.update('deadbeef', 'hex');
|
|
313
|
+
*/
|
|
314
|
+
update(msg: number[] | string, enc?: 'hex' | 'utf8'): SHA512HMAC;
|
|
315
|
+
/**
|
|
316
|
+
* Finalizes the HMAC computation and returns the resultant hash.
|
|
317
|
+
*
|
|
318
|
+
* @method digest
|
|
319
|
+
* @returns Returns the digest of the hashed data as a number array.
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
* let hashedMessage = myHMAC.digest();
|
|
323
|
+
*/
|
|
324
|
+
digest(): number[];
|
|
325
|
+
/**
|
|
326
|
+
* Finalizes the HMAC computation and returns the resultant hash as a hex string.
|
|
327
|
+
*
|
|
328
|
+
* @method digest
|
|
329
|
+
* @returns Returns the digest of the hashed data as a hex string
|
|
330
|
+
*
|
|
331
|
+
* @example
|
|
332
|
+
* let hashedMessage = myHMAC.digestHex();
|
|
333
|
+
*/
|
|
334
|
+
digestHex(): string;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Computes RIPEMD160 hash of a given message.
|
|
338
|
+
* @function ripemd160
|
|
339
|
+
* @param msg - The message to compute the hash for.
|
|
340
|
+
* @param enc - The encoding of msg if string. Default is 'utf8'.
|
|
341
|
+
*
|
|
342
|
+
* @returns the computed RIPEMD160 hash of the message.
|
|
343
|
+
*
|
|
344
|
+
* @example
|
|
345
|
+
* const digest = ripemd160('Hello, world!');
|
|
346
|
+
*/
|
|
347
|
+
export declare const ripemd160: (msg: number[] | string, enc?: 'hex' | 'utf8') => number[];
|
|
348
|
+
/**
|
|
349
|
+
* Computes SHA1 hash of a given message.
|
|
350
|
+
* @function sha1
|
|
351
|
+
* @param msg - The message to compute the hash for.
|
|
352
|
+
* @param enc - The encoding of msg if string. Default is 'utf8'.
|
|
353
|
+
*
|
|
354
|
+
* @returns the computed SHA1 hash of the message.
|
|
355
|
+
*
|
|
356
|
+
* @example
|
|
357
|
+
* const digest = sha1('Hello, world!');
|
|
358
|
+
*/
|
|
359
|
+
export declare const sha1: (msg: number[] | string, enc?: 'hex' | 'utf8') => number[];
|
|
360
|
+
/**
|
|
361
|
+
* Computes SHA256 hash of a given message.
|
|
362
|
+
* @function sha256
|
|
363
|
+
* @param msg - The message to compute the hash for.
|
|
364
|
+
* @param enc - The encoding of msg if string. Default is 'utf8'.
|
|
365
|
+
*
|
|
366
|
+
* @returns the computed SHA256 hash of the message.
|
|
367
|
+
*
|
|
368
|
+
* @example
|
|
369
|
+
* const digest = sha256('Hello, world!');
|
|
370
|
+
*/
|
|
371
|
+
export declare const sha256: (msg: number[] | string, enc?: 'hex' | 'utf8') => number[];
|
|
372
|
+
/**
|
|
373
|
+
* Computes SHA512 hash of a given message.
|
|
374
|
+
* @function sha512
|
|
375
|
+
* @param msg - The message to compute the hash for.
|
|
376
|
+
* @param enc - The encoding of msg if string. Default is 'utf8'.
|
|
377
|
+
*
|
|
378
|
+
* @returns the computed SHA512 hash of the message.
|
|
379
|
+
*
|
|
380
|
+
* @example
|
|
381
|
+
* const digest = sha512('Hello, world!');
|
|
382
|
+
*/
|
|
383
|
+
export declare const sha512: (msg: number[] | string, enc?: 'hex' | 'utf8') => number[];
|
|
384
|
+
/**
|
|
385
|
+
* Performs a 'double hash' using SHA256. This means the data is hashed twice
|
|
386
|
+
* with SHA256. First, the SHA256 hash of the message is computed, then the
|
|
387
|
+
* SHA256 hash of the resulting hash is computed.
|
|
388
|
+
* @function hash256
|
|
389
|
+
* @param msg - The message to compute the hash for.
|
|
390
|
+
* @param enc - The encoding of msg if string. Default is 'utf8'.
|
|
391
|
+
*
|
|
392
|
+
* @returns the double hashed SHA256 output.
|
|
393
|
+
*
|
|
394
|
+
* @example
|
|
395
|
+
* const doubleHash = hash256('Hello, world!');
|
|
396
|
+
*/
|
|
397
|
+
export declare const hash256: (msg: number[] | string, enc?: 'hex' | 'utf8') => number[];
|
|
398
|
+
/**
|
|
399
|
+
* Computes SHA256 hash of a given message and then computes a RIPEMD160 hash of the result.
|
|
400
|
+
*
|
|
401
|
+
* @function hash160
|
|
402
|
+
* @param msg - The message to compute the hash for.
|
|
403
|
+
* @param enc - The encoding of msg if string. Default is 'utf8'.
|
|
404
|
+
*
|
|
405
|
+
* @returns the RIPEMD160 hash of the SHA256 hash of the input message.
|
|
406
|
+
*
|
|
407
|
+
* @example
|
|
408
|
+
* const hash = hash160('Hello, world!');
|
|
409
|
+
*/
|
|
410
|
+
export declare const hash160: (msg: number[] | string, enc?: 'hex' | 'utf8') => number[];
|
|
411
|
+
/**
|
|
412
|
+
* Computes SHA256 HMAC of a given message with a given key.
|
|
413
|
+
* @function sha256hmac
|
|
414
|
+
* @param key - The key used to compute the HMAC
|
|
415
|
+
* @param msg - The message to compute the hash for.
|
|
416
|
+
* @param enc - The encoding of msg if string. Default is 'utf8'.
|
|
417
|
+
*
|
|
418
|
+
* @returns the computed HMAC of the message.
|
|
419
|
+
*
|
|
420
|
+
* @example
|
|
421
|
+
* const digest = sha256hmac('deadbeef', 'ffff001d');
|
|
422
|
+
*/
|
|
423
|
+
export declare const sha256hmac: (key: number[] | string, msg: number[] | string, enc?: 'hex') => number[];
|
|
424
|
+
/**
|
|
425
|
+
* Computes SHA512 HMAC of a given message with a given key.
|
|
426
|
+
* @function sha512hmac
|
|
427
|
+
* @param key - The key used to compute the HMAC
|
|
428
|
+
* @param msg - The message to compute the hash for.
|
|
429
|
+
* @param enc - The encoding of msg if string. Default is 'utf8'.
|
|
430
|
+
*
|
|
431
|
+
* @returns the computed HMAC of the message.
|
|
432
|
+
*
|
|
433
|
+
* @example
|
|
434
|
+
* const digest = sha512hmac('deadbeef', 'ffff001d');
|
|
435
|
+
*/
|
|
436
|
+
export declare const sha512hmac: (key: number[] | string, msg: number[] | string, enc?: 'hex') => number[];
|
|
437
|
+
/**
|
|
438
|
+
* Limited SHA-512-only PBKDF2 function for use in deprecated BIP39 code.
|
|
439
|
+
* @function pbkdf2
|
|
440
|
+
* @param password - The PBKDF2 password
|
|
441
|
+
* @param salt - The PBKDF2 salt
|
|
442
|
+
* @param iterations - The number of of iterations to run
|
|
443
|
+
* @param keylen - The length of the key
|
|
444
|
+
* @param digest - The digest (must be sha512 for this implementation)
|
|
445
|
+
*
|
|
446
|
+
* @returns The computed key
|
|
447
|
+
*/
|
|
448
|
+
export declare function pbkdf2(password: number[], salt: number[], iterations: number, keylen: number, digest?: string): number[];
|
|
449
|
+
export {};
|
|
450
|
+
//# sourceMappingURL=Hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Hash.d.ts","sourceRoot":"","sources":["../../../../src/primitives/Hash.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,uBAAe,QAAQ;IACrB,OAAO,EAAE,MAAM,EAAE,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