Example #1
0
        private Message PrepareMessageForNewKeyChunk(int lastSendKeyIndex)
        {
            var keyChunk = new BlockIdAndKeyAllocation(lastSendKeyIndex, CommonKeyStore.GetKeyAllocation());
            var mac      = MessageAuthenticator.GetMAC(keyChunk.GetBytes());

            return(new AddKey(mac, keyChunk));
        }
Example #2
0
        private Message PrepareAckForCommonKeyProposition(int propositionKeyChunkId)
        {
            var keyChunk = new BlockIdAndKeyAllocation(propositionKeyChunkId, CommonKeyStore.GetKeyAllocation());
            var mac      = MessageAuthenticator.GetMAC(keyChunk.GetBytes());

            return(new AddingKeyAck(mac, keyChunk));
        }
Example #3
0
 private bool DoesAckCorrespondsToLastSentKeyIndex(BlockIdAndKeyAllocation chunkId)
 {
     return(chunkId.BlockId == _lastSendKeyIndex);
 }