private Message PrepareMessageForNewKeyChunk(int lastSendKeyIndex) { var keyChunk = new BlockIdAndKeyAllocation(lastSendKeyIndex, CommonKeyStore.GetKeyAllocation()); var mac = MessageAuthenticator.GetMAC(keyChunk.GetBytes()); return(new AddKey(mac, keyChunk)); }
private Message PrepareAckForCommonKeyProposition(int propositionKeyChunkId) { var keyChunk = new BlockIdAndKeyAllocation(propositionKeyChunkId, CommonKeyStore.GetKeyAllocation()); var mac = MessageAuthenticator.GetMAC(keyChunk.GetBytes()); return(new AddingKeyAck(mac, keyChunk)); }
private bool DoesAckCorrespondsToLastSentKeyIndex(BlockIdAndKeyAllocation chunkId) { return(chunkId.BlockId == _lastSendKeyIndex); }