Organizing scripts: floCrypto v2.2.0

This commit is contained in:
sairajzero 2022-02-27 20:33:51 +05:30
parent 8094660f53
commit 3cb6c3f60c

View File

@ -6636,9 +6636,11 @@
})(typeof global !== 'undefined' ? global : window); })(typeof global !== 'undefined' ? global : window);
</script> </script>
<script id="floCrypto" version="2.0.1"> <script id="floCrypto" version="2.2.0">
/* FLO Crypto Operators*/ 'use strict';
const floCrypto = {
(function(GLOBAL) {
const floCrypto = GLOBAL.floCrypto = {
util: { util: {
p: BigInteger("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", 16), p: BigInteger("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", 16),
@ -6681,8 +6683,8 @@
}, },
getSenderPublicKeyString: function() { getSenderPublicKeyString: function() {
privateKey = ellipticCurveEncryption.senderRandom(); let privateKey = ellipticCurveEncryption.senderRandom();
senderPublicKeyString = ellipticCurveEncryption.senderPublicString(privateKey); var senderPublicKeyString = ellipticCurveEncryption.senderPublicString(privateKey);
return { return {
privateKey: privateKey, privateKey: privateKey,
senderPublicKeyString: senderPublicKeyString senderPublicKeyString: senderPublicKeyString
@ -6717,8 +6719,8 @@
//If the private key corresponded to a compressed public key, also drop the last byte (it should be 0x01). //If the private key corresponded to a compressed public key, also drop the last byte (it should be 0x01).
if (isPubKeyCompressed == true) pk.pop() if (isPubKeyCompressed == true) pk.pop()
pk.unshift(0) pk.unshift(0)
privateKeyDecimal = BigInteger(pk).toString() let privateKeyDecimal = BigInteger(pk).toString()
privateKeyHex = Crypto.util.bytesToHex(pk) let privateKeyHex = Crypto.util.bytesToHex(pk)
return { return {
privateKeyDecimal: privateKeyDecimal, privateKeyDecimal: privateKeyDecimal,
privateKeyHex: privateKeyHex privateKeyHex: privateKeyHex
@ -6784,7 +6786,7 @@
key.setCompressed(true); key.setCompressed(true);
var privateKeyArr = key.getBitcoinPrivateKeyByteArray(); var privateKeyArr = key.getBitcoinPrivateKeyByteArray();
privateKey = BigInteger.fromByteArrayUnsigned(privateKeyArr); var privateKey = BigInteger.fromByteArrayUnsigned(privateKeyArr);
var messageHash = Crypto.SHA256(data); var messageHash = Crypto.SHA256(data);
var messageHashBigInteger = new BigInteger(messageHash); var messageHashBigInteger = new BigInteger(messageHash);
@ -6972,6 +6974,8 @@
m => String.fromCharCode(parseInt(m.replace(/\\u/g, ''), 16))); m => String.fromCharCode(parseInt(m.replace(/\\u/g, ''), 16)));
} }
} }
})(typeof global !== "undefined" ? global : window);
</script> </script>
<script id="floBlockchainAPI" version="2.1.1a"> <script id="floBlockchainAPI" version="2.1.1a">
/* FLO Blockchain Operator to send/receive data from blockchain using API calls*/ /* FLO Blockchain Operator to send/receive data from blockchain using API calls*/