コード例 #1
0
ファイル: Transaction.cs プロジェクト: ooosbkf/turtlecoin-net
        public override uint addInput(AccountKeys senderKeys, CryptoNote.TransactionTypes.InputKeyInfo info, KeyPair ephKeys)
        {
            checkIfSigning();
            KeyInput input = new KeyInput();

//C++ TO C# CONVERTER TODO TASK: The following line was determined to be a copy assignment (rather than a reference assignment) - this should be verified and a 'CopyFrom' method should be created:
//ORIGINAL LINE: input.amount = info.amount;
            input.amount.CopyFrom(info.amount);

            generate_key_image_helper(senderKeys, info.realOutput.transactionPublicKey, info.realOutput.outputInTransaction, ephKeys, input.keyImage);

            // fill outputs array and use relative offsets
            foreach (var @out in info.outputs)
            {
                input.outputIndexes.Add(@out.outputIndex);
            }

            input.outputIndexes = absolute_output_offsets_to_relative(input.outputIndexes);
            return(addInput(input));
        }
コード例 #2
0
ファイル: Transaction.cs プロジェクト: ooosbkf/turtlecoin-net
        public override void signInputKey(uint index, CryptoNote.TransactionTypes.InputKeyInfo info, KeyPair ephKeys)
        {
            auto input      = boost::get <KeyInput>(getInputChecked(transaction, index, CryptoNote.TransactionTypes.InputType.Key));
            Hash prefixHash = GetTransactionPrefixHash();

            List <Signature> signatures = new List <Signature>();
            List <PublicKey> keysPtrs   = new List <PublicKey>();

            foreach (var o in info.outputs)
            {
//C++ TO C# CONVERTER TODO TASK: There is no equivalent to 'reinterpret_cast' in C#:
                keysPtrs.Add(reinterpret_cast <const PublicKey>(o.targetKey));
            }

            signatures.Resize(keysPtrs.Count);

//C++ TO C# CONVERTER TODO TASK: There is no equivalent to 'reinterpret_cast' in C#:
            Crypto.GlobalMembers.generate_ring_signature(reinterpret_cast <const Hash&>(prefixHash), reinterpret_cast <const KeyImage&>(input.keyImage), keysPtrs, reinterpret_cast <const SecretKey&>(ephKeys.secretKey), new uint(info.realOutput.transactionIndex), signatures.data());

            getSignatures(new uint(index)) = signatures;
            invalidateHash();
        }