public void SetSenderChainKey(ChainKey senderChainKey) { var chainKey = new Chain.ChainKey { key = senderChainKey.Key, index = senderChainKey.Index }; Structure.SenderChain.chainKey = chainKey; }
public void SetReceiverChainKey(ECPublicKey senderEphemeral, ChainKey chainKey) { var chainAndIndex = GetReceiverChain(senderEphemeral); var chain = chainAndIndex.Item1; var chainKeyStructure = new Chain.ChainKey { key = chainKey.Key, index = (UInt32)chainKey.Index }; chain.chainKey = chainKeyStructure; }
public void SetSenderChain(ECKeyPair senderRatchetKeyPair, ChainKey chainKey) { var chainKeyStructure = new Chain.ChainKey { key = chainKey.Key, index = (UInt32)chainKey.Index }; var senderChain = new Chain { SenderRatchetKey = senderRatchetKeyPair.PublicKey.Serialize(), SenderRatchetKeyPrivate = senderRatchetKeyPair.PrivateKey.Serialize(), chainKey = chainKeyStructure }; Structure.SenderChain = senderChain; }
public void AddReceiverChain(ECPublicKey senderRatchetKey, ChainKey chainKey) { var chainKeyStructure = new Chain.ChainKey { key = chainKey.Key, index = (UInt32)chainKey.Index }; var chain = new Chain { chainKey = chainKeyStructure, SenderRatchetKey = senderRatchetKey.Serialize() }; Structure.ReceiverChains.Add(chain); if(Structure.ReceiverChains.Count > 5) { Structure.ReceiverChains.RemoveAt(0); } }